From bf5b01b14dc7bfc214e646425a62f5593890d7e3 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期六, 08 十一月 2025 22:05:37 +0800
Subject: [PATCH] 清洗数据库日期错误,并且导入日期通用化处理

---
 src/main/resources/mapper/progressTrack/DjJdgzNetworkLevel3Dao.xml |  115 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 100 insertions(+), 15 deletions(-)

diff --git a/src/main/resources/mapper/progressTrack/DjJdgzNetworkLevel3Dao.xml b/src/main/resources/mapper/progressTrack/DjJdgzNetworkLevel3Dao.xml
index ffa642e..e017744 100644
--- a/src/main/resources/mapper/progressTrack/DjJdgzNetworkLevel3Dao.xml
+++ b/src/main/resources/mapper/progressTrack/DjJdgzNetworkLevel3Dao.xml
@@ -47,10 +47,16 @@
             and a.TEAMGROUP_ID = ${teamId}
         </if>
         <if test="cabinId!=null">
-            and a.cabin_id LIKE '%${cabinId}%'
+            and ',' || a.cabin_id || ',' LIKE '%,${cabinId},%';
+        </if>
+        <if test="isealCabin!=10000 and isealCabin!=null">
+            and a.iseal_cabin = ${isealCabin}
+        </if>
+        <if test="isLt!=10000 and isLt!=null">
+            and a.islt = ${isLt}
         </if>
         <if test="type!=null and type!=''">
-            and a.type = #{type}
+            and a.type = '${type}'
         </if>
         <if test="name!=null and name!=''">
             and a.name LIKE '%${name}%'
@@ -95,35 +101,46 @@
     </select>
     <select id="getNodeList" resultType="com.example.server.progressTrack.Dto.TableNodeDto">
         SELECT
-        b.name,
-        a.NETWORK_ID,
-        a.process_name,
-        a.ID, a.REQUIRED_COMPLETION_TIME, a.ACTUAL_COMPLETION, a.CURRENT_STATUS
-        FROM `dj_jdgz_network_level3_list` a
-        LEFT JOIN dj_jdgz_network_level3 b on b.ID = a.NETWORK_ID
-        LEFT JOIN dj_jdgz_network_level1 c on c.ID = b.LEVEL1_NETWORK_ID
+        c.name,
+        b.NETWORK_ID,
+        b.process_name,
+        c.islt,
+        c.iseal_cabin,
+        b.ID, b.REQUIRED_COMPLETION_TIME, b.ACTUAL_COMPLETION, b.CURRENT_STATUS
+        FROM dj_jdgz_track_record a
+        LEFT JOIN dj_jdgz_network_level3_list b on b.ID = a.LEVEL3_NODE_ID
+        LEFT JOIN dj_jdgz_network_level3 c on c.ID = b.NETWORK_ID
+        LEFT JOIN dj_jdgz_network_level1 d on d.ID = c.LEVEL1_NETWORK_ID
         where
         a.is_delete = 0
         and b.is_delete = 0
         and c.is_delete = 0
+        and d.is_delete = 0
         <if test="shipId!=null">
-            and c.ship_id = ${shipId}
+            and d.ship_id = ${shipId}
         </if>
         <if test="deptId!=null">
-            and b.dept_id = ${deptId}
+            and c.dept_id = ${deptId}
         </if>
         <if test="teamId!=null">
-            and b.TEAMGROUP_ID = ${teamId}
+            and c.TEAMGROUP_ID = ${teamId}
         </if>
         <if test="cabinId!=null">
-            and b.cabin_id LIKE '%${cabinId}%'
+            and c.cabin_id = ${cabinId}
+        </if>
+        <if test="isCabin!=10000 and isCabin!=null">
+            and c.iseal_cabin = ${isCabin}
+        </if>
+        <if test="islt!=10000 and islt!=null">
+            and c.islt = ${islt}
         </if>
         <if test="type!=null and type!=''">
-            and b.type = #{type}
+            and c.type = '${type}'
         </if>
         <if test="name!=null and name!=''">
-            and b.name LIKE '%${name}%'
+            and c.name LIKE '%${name}%'
         </if>
+        ORDER BY NETWORK_ID
     </select>
     <select id="getStatist" resultType="com.example.server.progressTrack.Dto.StatistProductDto">
         SELECT
@@ -135,6 +152,12 @@
             COUNT(DISTINCT CASE WHEN fvp.process_name = '鎷嗘閴村畾' THEN b.id END) AS jdsl,
             COUNT(DISTINCT CASE WHEN fvp.process_name = '璁惧杩斿巶' THEN b.id END) AS fcsl,
             COUNT(DISTINCT CASE WHEN fvp.process_name = '鍥炶' THEN b.id END) AS hzsl,
+            COUNT(DISTINCT CASE WHEN fvp.process_name = '鎷嗗嵏鍑鸿埍' THEN b.id END) AS ccsl,
+            COUNT(DISTINCT CASE WHEN fvp.process_name = '鍏ュ簱' THEN b.id END) AS rksl,
+            COUNT(DISTINCT CASE WHEN fvp.process_name = '瀛樻斁浣嶇疆' THEN b.id END) AS cfsl,
+            COUNT(DISTINCT CASE WHEN fvp.process_name = '绉讳氦T闃�' THEN b.id END) AS yjsl,
+            COUNT(DISTINCT CASE WHEN fvp.process_name = '璁惧鍒板巶' THEN b.id END) AS dcsl,
+            COUNT(DISTINCT CASE WHEN fvp.process_name = '璁惧瀹夎' THEN b.id END) AS azsl,
             COUNT(DISTINCT CASE WHEN all_complete.network_id IS NOT NULL THEN b.id END) AS wcsl
         FROM
             dj_sys_teamgroup_class a
@@ -167,6 +190,10 @@
                     network_id
                 FROM
                     dj_jdgz_network_level3_list
+                LEFT JOIN dj_jdgz_network_level3 ON dj_jdgz_network_level3_list.network_id = dj_jdgz_network_level3.id
+                where dj_jdgz_network_level3_list.is_delete = 0
+                and dj_jdgz_network_level3.is_delete = 0
+                and dj_jdgz_network_level3.type = '${type}'
                 GROUP BY
                     network_id
                 HAVING
@@ -179,6 +206,64 @@
         ORDER BY
             sort;
     </select>
+    <select id="getRemark" resultType="java.lang.String">
+        SELECT
+            b.remark
+        FROM
+            dj_jdgz_track_record b
+                LEFT JOIN dj_jdgz_network_level3 a ON b.LEVEL3_NETWORK_ID = a.ID
+        WHERE
+            a.is_delete = 0
+          AND b.is_delete = 0
+          AND a.id = ${networkId}
+          AND a.type = '${type}'
+          AND b.remark IS NOT NULL
+        ORDER BY
+            ABS((julianday('now') - julianday(b.CREATE_DATE)) * 86400) desc,
+            ABS((julianday('now') - julianday(b.UPDATE_DATE)) * 86400) desc
+
+            LIMIT 1;
+    </select>
+    <select id="getdata" resultType="com.example.server.progressTrack.Dto.Level3ExportCloum">
+        select c.NAME,b.PROCESS_NAME,b.CURRENT_STATUS,b.REQUIRED_COMPLETION_TIME,b.ACTUAL_COMPLETION,c.dept_id,c.teamgroup_id
+        FROM dj_jdgz_track_record a
+        LEFT JOIN dj_jdgz_network_level3_list b on b.ID = a.LEVEL3_NODE_ID
+        LEFT JOIN dj_jdgz_network_level3 c on c.ID = b.NETWORK_ID
+        LEFT JOIN dj_jdgz_network_level1 d on d.ID = c.LEVEL1_NETWORK_ID
+        where a.IS_DELETE = 0
+        and c.LEVEL1_NETWORK_ID = ${level1NetworkId}
+        and c.LEVEL1_NETWORK_ID = d.id
+        and b.IS_DELETE = 0
+        and b.NETWORK_ID = c.id
+        and c.IS_DELETE = 0
+        and d.IS_DELETE = 0
+        <if test="deptId!=null">
+            and c.DEPT_ID = ${deptId}
+        </if>
+        <if test="teamGroupId!=null">
+            and c.TEAMGROUP_ID = ${teamGroupId}
+        </if>
+        <if test="status!=null and status=='杩涜涓�'">
+            and (b.CURRENT_STATUS = 0 or b.CURRENT_STATUS is null)
+            and b.REQUIRED_COMPLETION_TIME &gt;= ( SELECT date( 'now', '-' || d.advent_day || ' days' ) )
+        </if>
+        <if test="status!=null and status=='涓存湡'">
+            and (b.CURRENT_STATUS = 0 or b.CURRENT_STATUS is null)
+            and b.REQUIRED_COMPLETION_TIME &lt; ( SELECT date( 'now', '-' || d.advent_day || ' days' ) )
+        </if>
+        <if test="status!=null and status=='閫炬湡'">
+            and (b.CURRENT_STATUS = 0 or b.CURRENT_STATUS is null)
+            and b.REQUIRED_COMPLETION_TIME &lt; ( SELECT datetime( 'now' ) )
+        </if>
+        <if test="status!=null and status=='姝e父瀹屾垚'">
+            and b.CURRENT_STATUS = 1
+            AND b.REQUIRED_COMPLETION_TIME &gt;= b.ACTUAL_COMPLETION
+        </if>
+        <if test="status!=null and status=='瓒呮湡瀹屾垚'">
+            and b.CURRENT_STATUS = 1
+            AND b.REQUIRED_COMPLETION_TIME &lt; b.ACTUAL_COMPLETION
+        </if>
+    </select>
 
 
 </mapper>

--
Gitblit v1.9.1