From 84569abda51ecf6c5549dec4cadee8d043422379 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期二, 30 九月 2025 09:33:28 +0800
Subject: [PATCH] 2025.9.30

---
 src/main/resources/mapper/ds1/ClueTaskMapper.xml |   67 +++++++++++++++++++++++++++++++++
 1 files changed, 66 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/ds1/ClueTaskMapper.xml b/src/main/resources/mapper/ds1/ClueTaskMapper.xml
index 5995d6a..8dd5186 100644
--- a/src/main/resources/mapper/ds1/ClueTaskMapper.xml
+++ b/src/main/resources/mapper/ds1/ClueTaskMapper.xml
@@ -23,6 +23,7 @@
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="executor_ids" jdbcType="VARCHAR" property="executorIds" />
     <result column="internal_task" jdbcType="BIT" property="internalTask" />
+    <result column="finished" jdbcType="BIT" property="finished" />
   </resultMap>
   <sql id="Base_Column_List">
     <!--
@@ -30,6 +31,70 @@
     -->
     guid, clue_id, task_time, province_code, province_name, city_code, city_name, district_code, 
     district_name, town_code, town_name, response_level, travel_mode, has_uav, create_time, 
-    update_time, executor_ids, internal_task
+    update_time, executor_ids, internal_task, finished
   </sql>
+
+<!--  閫氱敤SQL璇彞-->
+  <sql id="Where_Area">
+    <if test="provinceCode != null">
+      AND ${tableAlias}.province_code = #{provinceCode}
+    </if>
+    <if test="provinceName != null">
+      AND ${tableAlias}.province_name = #{provinceName}
+    </if>
+    <if test="cityCode != null">
+      AND ${tableAlias}.city_code = #{cityCode}
+    </if>
+    <if test="cityName != null">
+      AND ${tableAlias}.city_name = #{cityName}
+    </if>
+    <if test="districtCode != null">
+      AND ${tableAlias}.district_code = #{districtCode}
+    </if>
+    <if test="districtName != null">
+      AND ${tableAlias}.district_name = #{districtName}
+    </if>
+    <if test="townCode != null">
+      AND ${tableAlias}.town_code = #{townCode}
+    </if>
+    <if test="townName != null">
+      AND ${tableAlias}.town_name = #{townName}
+    </if>
+  </sql>
+  <sql id="Where_Task_Time">
+    <if test="startTime != null">
+      AND ${tableAlias}.task_time &gt;= #{startTime}
+    </if>
+    <if test="endTime != null">
+      AND ${tableAlias}.task_time &lt;= #{endTime}
+    </if>
+  </sql>
+
+<!--  杩斿洖缁撴灉妯℃澘-->
+  <resultMap extends="BaseResultMap" id="SummaryMap" type="com.flightfeather.grid.vo.ClueTaskSummaryVo">
+  </resultMap>
+
+<!--  鏌ヨ璇彞-->
+  <select id="selectSummaryCount" resultMap="SummaryMap">
+    select
+    count(*) as totalCount,
+    sum(if(internal_task = true, 1, 0)) as internalTaskCount,
+    sum(if(internal_task = false, 1, 0)) as externalTaskCount,
+    sum(if(finished = true, 1, 0)) as finishedCount,
+    sum(if(finished = false, 1, 0)) as unfinishedCount,
+    sum(if(finished = true and internal_task = true, 1, 0)) as internalFinishedCount,
+    sum(if(finished = false and internal_task = true, 1, 0)) as internalUnFinishedCount,
+    sum(if(finished = true and internal_task = false, 1, 0)) as externalFinishedCount,
+    sum(if(finished = false and internal_task = false, 1, 0)) as externalUnFinishedCount
+    from g_t_clue_task as a
+    <where>
+      <include refid="Where_Area">
+        <property name="tableAlias" value="a"/>
+      </include>
+      <include refid="Where_Task_Time">
+        <property name="tableAlias" value="a"/>
+      </include>
+    </where>
+  </select>
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3