From 46872a311da9480d3edb19223aca2e0833fb1e31 Mon Sep 17 00:00:00 2001
From: hcong <1050828145@qq.com>
Date: 星期二, 17 十二月 2024 11:41:00 +0800
Subject: [PATCH] 1. 完成数据产品中间结果基本信息和具体信息入库 2. 修改ColInspectionInfo.kt 监管时间格式修改为yyyy-mm-dd 3. 新增数据产品类型枚举类 DataProductType 4. 修改BaseTemplate实现类通过重写genData方法生成Template相关数据 5. TODO 其他未涉及到的产品对象的中间结果对象

---
 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