From 1a677d2b4a4bc615602f8c2a22bc07ec1356e5be Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 16 十月 2025 17:39:06 +0800
Subject: [PATCH] 2025.10.16 1. 根据全局响应增强器GlobalResponseAdvice,将原先的BaseResPack接口包装函数统一去除; 2. 新增三种类型的数据产品数据库实体 3. 新增典型问题场景清单中间数据产品接口
---
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SubTaskRep.kt | 46 +++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 43 insertions(+), 3 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SubTaskRep.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SubTaskRep.kt
index feb9778..ccaa109 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SubTaskRep.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SubTaskRep.kt
@@ -1,20 +1,60 @@
package cn.flightfeather.supervision.domain.ds1.repository
+import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds1.entity.Subtask
import cn.flightfeather.supervision.domain.ds1.mapper.SubtaskMapper
+import cn.flightfeather.supervision.lightshare.vo.AreaVo
+import cn.flightfeather.supervision.lightshare.vo.SubTaskSummary
import org.springframework.stereotype.Repository
+import tk.mybatis.mapper.entity.Example
+import java.time.LocalDateTime
@Repository
class SubTaskRep(private val subtaskMapper: SubtaskMapper) {
-
- fun find(id:String): Subtask? {
- return subtaskMapper.selectByPrimaryKey(id)
+ fun update(subtask: Subtask): Int {
+ return subtaskMapper.updateByPrimaryKey(subtask)
}
+
+ fun findOne(primaryKey:String): Subtask? {
+ return subtaskMapper.selectByPrimaryKey(primaryKey)
+ }
+
+ fun findAll(subtask: Subtask): List<Subtask?> {
+ return subtaskMapper.select(subtask)
+ }
+
/**
* 鏍规嵁鎬讳换鍔°�佸満鏅被鍨嬨�侀棶棰樼被鍨嬶紝鑾峰彇鍙戠幇璇ョ绫婚棶棰樼殑鍦烘櫙淇℃伅
*/
fun findSubtasks(topTaskId: String, sceneTypeId:String, proType: String): List<Subtask?> {
return subtaskMapper.findSubTasksByProType(topTaskId, sceneTypeId, proType)
}
+
+ /**
+ * 鏌ユ壘姝e湪鎵ц鐨勫贰鏌ヤ换鍔�
+ */
+ fun findByStatus(status: Constant.TaskProgress): List<Subtask?> {
+ return subtaskMapper.selectByExample(Example(Subtask::class.java).apply {
+ createCriteria().andEqualTo("status", status.text)
+ })
+ }
+
+ fun findByTime(sT: LocalDateTime, eT: LocalDateTime): List<Subtask?> {
+ return subtaskMapper.selectByExample(Example(Subtask::class.java).apply {
+ createCriteria().andBetween("planstarttime", sT, eT)
+ })
+ }
+
+ fun findByTime(year: Int, month: Int): List<Subtask?> {
+ val sT = LocalDateTime.of(year, month, 1, 0, 0, 0)
+ val eT = sT.plusMonths(1).minusSeconds(1)
+ return findByTime(sT, eT)
+ }
+
+
+ // 宸℃煡浠诲姟闂鏁存敼璇︽儏缁熻鐩稿叧
+ fun findSummary(areaVo: AreaVo): List<SubTaskSummary> {
+ return subtaskMapper.getSummaryByArea(areaVo)
+ }
}
\ No newline at end of file
--
Gitblit v1.9.3