694 executeUpdate() |
694 executeUpdate() |
695 } |
695 } |
696 } |
696 } |
697 |
697 |
698 //</editor-fold> |
698 //</editor-fold> |
|
699 |
|
700 //<editor-fold desc="Issue History"> |
|
701 |
|
702 override fun listIssueHistory(projectId: Int, days: Int) = |
|
703 withStatement( |
|
704 """ |
|
705 select evt.*, evtdata.* |
|
706 from lpit_issue_history_event evt |
|
707 join lpit_issue using (issueid) |
|
708 join lpit_issue_history_data evtdata using (eventid) |
|
709 where project = ? |
|
710 and time > now() - (? * interval '1' day) |
|
711 order by time desc |
|
712 """.trimIndent() |
|
713 ) { |
|
714 setInt(1, projectId) |
|
715 setInt(2, days) |
|
716 queryAll { rs-> |
|
717 with(rs) { |
|
718 IssueHistoryEntry( |
|
719 getTimestamp("time"), |
|
720 getEnum("type"), |
|
721 IssueHistoryData(getInt("issueid"), |
|
722 component = getString("component") ?: "", |
|
723 status = getEnum("status"), |
|
724 category = getEnum("category"), |
|
725 subject = getString("subject"), |
|
726 description = getString("description") ?: "", |
|
727 assignee = getString("assignee") ?: "", |
|
728 eta = getDate("eta"), |
|
729 affected = getString("affected") ?: "", |
|
730 resolved = getString("resolved") ?: "" |
|
731 ) |
|
732 ) |
|
733 } |
|
734 } |
|
735 } |
|
736 |
|
737 //</editor-fold> |
699 } |
738 } |