src/main/kotlin/de/uapcore/lightpit/dao/PostgresDataAccessObject.kt

changeset 235
4258b9e010ae
parent 232
296e12ff8d1c
child 239
9365c7fb0240
equal deleted inserted replaced
234:d71bc6db42ef 235:4258b9e010ae
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 }

mercurial