From 0392c333ed3d987cb2ab3dac4e1a972cff405f21 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 25 四月 2024 17:42:08 +0800
Subject: [PATCH] 1. 新增后台任务关联模块 2. 新增自动评分后台任务; 3. 修复部分bug

---
 src/main/resources/mapper/ds1/SubtaskMapper.xml |  197 +++++++++++++++++++++++++++++++++++++------------
 1 files changed, 149 insertions(+), 48 deletions(-)

diff --git a/src/main/resources/mapper/ds1/SubtaskMapper.xml b/src/main/resources/mapper/ds1/SubtaskMapper.xml
index 3879e6e..e3ddd41 100644
--- a/src/main/resources/mapper/ds1/SubtaskMapper.xml
+++ b/src/main/resources/mapper/ds1/SubtaskMapper.xml
@@ -5,53 +5,53 @@
     <!--
       WARNING - @mbg.generated
     -->
-    <id column="ST_GUID" property="stGuid" jdbcType="VARCHAR" />
-    <result column="T_GUID" property="tGuid" jdbcType="VARCHAR" />
-    <result column="TS_GUID" property="tsGuid" jdbcType="VARCHAR" />
-    <result column="ST_name" property="stName" jdbcType="VARCHAR" />
-    <result column="ST_Priority" property="stPriority" jdbcType="BIT" />
-    <result column="ST_TypeNo" property="stTypeno" jdbcType="TINYINT" />
-    <result column="ST_Type" property="stType" jdbcType="VARCHAR" />
-    <result column="ST_ProvinceCode" property="stProvincecode" jdbcType="VARCHAR" />
-    <result column="ST_ProvinceName" property="stProvincename" jdbcType="VARCHAR" />
-    <result column="ST_CityCode" property="stCitycode" jdbcType="VARCHAR" />
-    <result column="ST_CityName" property="stCityname" jdbcType="VARCHAR" />
-    <result column="ST_DistrictCode" property="stDistrictcode" jdbcType="VARCHAR" />
-    <result column="ST_DistrictName" property="stDistrictname" jdbcType="VARCHAR" />
-    <result column="ST_TownCode" property="stTowncode" jdbcType="VARCHAR" />
-    <result column="ST_TownName" property="stTownname" jdbcType="VARCHAR" />
-    <result column="ST_ScenseName" property="stScensename" jdbcType="VARCHAR" />
-    <result column="ST_ScenseID" property="stScenseid" jdbcType="VARCHAR" />
-    <result column="ST_ScenseAddress" property="stScenseaddress" jdbcType="VARCHAR" />
-    <result column="ST_DeadLineType" property="stDeadlinetype" jdbcType="VARCHAR" />
-    <result column="ST_PlanStartTime" property="stPlanstarttime" jdbcType="TIMESTAMP" />
-    <result column="ST_PlanEndTime" property="stPlanendtime" jdbcType="TIMESTAMP" />
-    <result column="ST_DeployerGUID" property="stDeployerguid" jdbcType="VARCHAR" />
-    <result column="ST_DeployerUserName" property="stDeployerusername" jdbcType="VARCHAR" />
-    <result column="ST_DeployerRealName" property="stDeployerrealname" jdbcType="VARCHAR" />
-    <result column="ST_DeployTime" property="stDeploytime" jdbcType="TIMESTAMP" />
-    <result column="ST_ExecutionStartTime" property="stExecutionstarttime" jdbcType="TIMESTAMP" />
-    <result column="ST_ExecutionEndTime" property="stExecutionendtime" jdbcType="TIMESTAMP" />
-    <result column="ST_ExecutorGUIDs" property="stExecutorguids" jdbcType="VARCHAR" />
-    <result column="ST_ExecutorUserNames" property="stExecutorusernames" jdbcType="VARCHAR" />
-    <result column="ST_ExecutorRealTimes" property="stExecutorrealtimes" jdbcType="VARCHAR" />
-    <result column="ST_Status" property="stStatus" jdbcType="VARCHAR" />
-    <result column="ST_NotifedCount" property="stNotifedcount" jdbcType="INTEGER" />
-    <result column="ST_RuleList" property="stRulelist" jdbcType="VARCHAR" />
+    <id column="ST_GUID" property="stguid" jdbcType="VARCHAR" />
+    <result column="T_GUID" property="tguid" jdbcType="VARCHAR" />
+    <result column="TS_GUID" property="tsguid" jdbcType="VARCHAR" />
+    <result column="ST_name" property="name" jdbcType="VARCHAR" />
+    <result column="ST_Priority" property="priority" jdbcType="BIT" />
+    <result column="ST_TypeNo" property="typeno" jdbcType="TINYINT" />
+    <result column="ST_Type" property="type" jdbcType="VARCHAR" />
+    <result column="ST_ProvinceCode" property="provincecode" jdbcType="VARCHAR" />
+    <result column="ST_ProvinceName" property="provincename" jdbcType="VARCHAR" />
+    <result column="ST_CityCode" property="citycode" jdbcType="VARCHAR" />
+    <result column="ST_CityName" property="cityname" jdbcType="VARCHAR" />
+    <result column="ST_DistrictCode" property="districtcode" jdbcType="VARCHAR" />
+    <result column="ST_DistrictName" property="districtname" jdbcType="VARCHAR" />
+    <result column="ST_TownCode" property="towncode" jdbcType="VARCHAR" />
+    <result column="ST_TownName" property="townname" jdbcType="VARCHAR" />
+    <result column="ST_ScenseName" property="scensename" jdbcType="VARCHAR" />
+    <result column="ST_ScenseID" property="scenseid" jdbcType="VARCHAR" />
+    <result column="ST_ScenseAddress" property="scenseaddress" jdbcType="VARCHAR" />
+    <result column="ST_DeadLineType" property="deadlinetype" jdbcType="VARCHAR" />
+    <result column="ST_PlanStartTime" property="planstarttime" jdbcType="TIMESTAMP" />
+    <result column="ST_PlanEndTime" property="planendtime" jdbcType="TIMESTAMP" />
+    <result column="ST_DeployerGUID" property="deployerguid" jdbcType="VARCHAR" />
+    <result column="ST_DeployerUserName" property="deployerusername" jdbcType="VARCHAR" />
+    <result column="ST_DeployerRealName" property="deployerrealname" jdbcType="VARCHAR" />
+    <result column="ST_DeployTime" property="deploytime" jdbcType="TIMESTAMP" />
+    <result column="ST_ExecutionStartTime" property="executionstarttime" jdbcType="TIMESTAMP" />
+    <result column="ST_ExecutionEndTime" property="executionendtime" jdbcType="TIMESTAMP" />
+    <result column="ST_ExecutorGUIDs" property="executorguids" jdbcType="VARCHAR" />
+    <result column="ST_ExecutorUserNames" property="executorusernames" jdbcType="VARCHAR" />
+    <result column="ST_ExecutorRealTimes" property="executorrealtimes" jdbcType="VARCHAR" />
+    <result column="ST_Status" property="status" jdbcType="VARCHAR" />
+    <result column="ST_NotifedCount" property="notifedcount" jdbcType="INTEGER" />
+    <result column="ST_RuleList" property="rulelist" jdbcType="VARCHAR" />
     <result column="ST_AssessorGUID" property="stAssessorguid" jdbcType="VARCHAR" />
-    <result column="ST_AssessorUserName" property="stAssessorusername" jdbcType="VARCHAR" />
-    <result column="ST_AssessorRealName" property="stAssessorrealname" jdbcType="VARCHAR" />
-    <result column="ST_AssessTime" property="stAssesstime" jdbcType="TIMESTAMP" />
-    <result column="ST_AssessResult" property="stAssessresult" jdbcType="VARCHAR" />
-    <result column="ST_ThirdAssessorGUID" property="stThirdassessorguid" jdbcType="VARCHAR" />
-    <result column="ST_ThirdAssessorUserName" property="stThirdassessorusername" jdbcType="VARCHAR" />
-    <result column="ST_ThirdAssessorRealName" property="stThirdassessorrealname" jdbcType="VARCHAR" />
-    <result column="ST_ThirdAssessTime" property="stThirdassesstime" jdbcType="TIMESTAMP" />
-    <result column="ST_ThirdAssessResult" property="stThirdassessresult" jdbcType="VARCHAR" />
-    <result column="ST_Extension1" property="stExtension1" jdbcType="VARCHAR" />
-    <result column="ST_Extension2" property="stExtension2" jdbcType="VARCHAR" />
-    <result column="ST_Extension3" property="stExtension3" jdbcType="VARCHAR" />
-    <result column="ST_Remark" property="stRemark" jdbcType="VARCHAR" />
+    <result column="ST_AssessorUserName" property="assessorusername" jdbcType="VARCHAR" />
+    <result column="ST_AssessorRealName" property="assessorrealname" jdbcType="VARCHAR" />
+    <result column="ST_AssessTime" property="assesstime" jdbcType="TIMESTAMP" />
+    <result column="ST_AssessResult" property="assessresult" jdbcType="VARCHAR" />
+    <result column="ST_ThirdAssessorGUID" property="thirdassessorguid" jdbcType="VARCHAR" />
+    <result column="ST_ThirdAssessorUserName" property="thirdassessorusername" jdbcType="VARCHAR" />
+    <result column="ST_ThirdAssessorRealName" property="thirdassessorrealname" jdbcType="VARCHAR" />
+    <result column="ST_ThirdAssessTime" property="thirdassesstime" jdbcType="TIMESTAMP" />
+    <result column="ST_ThirdAssessResult" property="thirdassessresult" jdbcType="VARCHAR" />
+    <result column="ST_Extension1" property="extension1" jdbcType="VARCHAR" />
+    <result column="ST_Extension2" property="extension2" jdbcType="VARCHAR" />
+    <result column="ST_Extension3" property="extension3" jdbcType="VARCHAR" />
+    <result column="ST_Remark" property="remark" jdbcType="VARCHAR" />
   </resultMap>
   
   <resultMap id="SubtaskSearchResultVo" type="cn.flightfeather.supervision.lightshare.vo.SubtaskSearchResultVo">
@@ -148,6 +148,21 @@
         <result column="ST_Extension3" property="extension3" jdbcType="VARCHAR" />
         <result column="ST_Remark" property="remark" jdbcType="VARCHAR" />
     </resultMap>
+
+    <resultMap id="SubTaskSummary" type="cn.flightfeather.supervision.lightshare.vo.SubTaskSummary" >
+        <result column="ST_GUID" property="stGuid" jdbcType="VARCHAR" />
+        <result column="ST_name" property="stName" jdbcType="VARCHAR" />
+        <result column="ST_PlanStartTime" property="stPlanTime" jdbcType="TIMESTAMP" />
+        <result column="ST_Status" property="stStatus" jdbcType="VARCHAR" />
+        <result column="S_GUID" property="sceneId" jdbcType="VARCHAR" />
+        <result column="S_Name" property="sceneName" jdbcType="VARCHAR" />
+        <result column="S_Type" property="sceneType" jdbcType="VARCHAR" />
+        <result column="I_GUID" property="insGuid" jdbcType="VARCHAR" />
+        <result column="proNum" property="proNum" jdbcType="INTEGER" />
+        <result column="changeNum" property="changeNum" jdbcType="INTEGER" />
+        <result column="proCheckedNum" property="proCheckedNum" jdbcType="INTEGER" />
+        <result column="changeCheckedNum" property="changeCheckedNum" jdbcType="INTEGER" />
+    </resultMap>
   <sql id="Base_Column_List" >
     <!--
       WARNING - @mbg.generated
@@ -226,10 +241,10 @@
         LEFT JOIN sm_t_problemtype AS f ON d.PT_GUID = f.PT_GUID
         RIGHT JOIN im_t_mediafile AS e ON d.PL_GUID = e.MF_BusinessGUID
         WHERE
+        a.ST_DistrictCode = #{param3}
         <if test="param1 != null">
-          ((d.PL_ChangedTime is not null and d.PL_ChangedTime > #{param1}) OR d.PL_Time > #{param2})
+            AND ((d.PL_ChangedTime is not null and d.PL_ChangedTime > #{param1}) OR d.PL_Time > #{param2})
         </if>
-        AND a.ST_DistrictCode = #{param3}
         <if test="param4 != null">
             AND b.S_TypeID = #{param4}
         </if>
@@ -251,4 +266,90 @@
             and b.S_TypeID = #{param4}
         </if>
     </select>
+
+    <select id="selectByTopTask2" resultMap="BaseResultMap">
+        select * from tm_t_subtask as a left join sm_t_scense as b on a.ST_ScenseID = b.S_GUID
+        where a.T_GUID = #{param1}
+        <if test="param2 != null">
+            and b.S_TypeID = #{param2}
+        </if>
+    </select>
+
+    <select id="getSummary" resultMap="SubTaskSummary">
+        SELECT
+        a.ST_GUID,
+        a.ST_name,
+        a.ST_PlanStartTime,
+        a.ST_Status,
+        b.S_GUID,
+        b.S_Name,
+        b.S_Type,
+        c.I_GUID,
+        SUM(d.PL_GUID is NOT null) AS proNum,
+        SUM(d.PL_IsChanged = TRUE) AS changeNum,
+        SUM(d.PL_Extension3 != 'unCheck') AS proCheckedNum,
+        SUM(
+        d.PL_Extension3 = 'change_pass' || d.PL_Extension3 = 'change_fail'
+        ) AS changeCheckedNum
+
+        FROM
+        tm_t_subtask AS a
+        LEFT JOIN sm_t_scense AS b ON a.ST_ScenseID = b.S_GUID
+        LEFT JOIN im_t_inspection AS c ON a.ST_GUID = c.ST_GUID
+        LEFT JOIN im_t_problemlist AS d ON a.ST_GUID = d.ST_GUID
+        WHERE
+        a.T_GUID = #{param1}
+        <if test="param2 != null">
+            and b.S_TypeID = #{param2}
+        </if>
+        GROUP BY
+        a.ST_GUID
+    </select>
+
+    <select id="getSummaryByScene" resultMap="SubTaskSummary">
+        SELECT
+        a.ST_GUID,
+        a.ST_name,
+        a.ST_PlanStartTime,
+        a.ST_Status,
+        b.S_GUID,
+        b.S_Name,
+        b.S_Type,
+        c.I_GUID,
+        SUM(d.PL_GUID is NOT null) AS proNum,
+        SUM(d.PL_IsChanged = TRUE) AS changeNum,
+        SUM(d.PL_Extension3 != 'unCheck') AS proCheckedNum,
+        SUM(
+        d.PL_Extension3 = 'change_pass' || d.PL_Extension3 = 'change_fail'
+        ) AS changeCheckedNum
+
+        FROM
+        tm_t_subtask AS a
+        LEFT JOIN sm_t_scense AS b ON a.ST_ScenseID = b.S_GUID
+        LEFT JOIN im_t_inspection AS c ON a.ST_GUID = c.ST_GUID
+        LEFT JOIN im_t_problemlist AS d ON a.ST_GUID = d.ST_GUID
+        WHERE
+        a.ST_ScenseID = #{sceneId}
+        <if test="startTime != null">
+            and a.ST_PlanStartTime BETWEEN #{startTime} AND #{endTime}
+        </if>
+        GROUP BY
+        a.ST_GUID
+        ORDER BY a.ST_PlanStartTime DESC
+    </select>
+
+    <select id="findSubTasksByProType" resultMap="BaseResultMap">
+        SELECT
+        a.*
+        FROM
+        tm_t_subtask AS a
+        LEFT JOIN im_t_problemlist AS b ON a.ST_GUID = b.ST_GUID
+        LEFT JOIN sm_t_problemtype AS c ON b.PT_GUID = c.PT_GUID
+        LEFT JOIN sm_t_scense AS d ON a.ST_ScenseID = d.S_GUID
+        WHERE
+        a.T_GUID = #{topTaskId}
+        AND c.PT_TypeName = #{proType}
+        AND d.S_TypeID = #{sceneTypeId}
+        GROUP BY a.ST_GUID
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3