Browse Source

sql优化处理

wangzhun 2 years ago
parent
commit
329ef56d32

+ 23 - 23
DataCheck/src/main/resources/customMapper/CheckAndDetectMapper.xml

@@ -110,17 +110,17 @@
         FROM
         (
         SELECT
-        start_code,end_code,b.prj_id,area
+        start_code,end_code,prj_id,area
         FROM
         tf_ywpn_detect_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         and a.check_flag=1
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.startCode !=null">
                 and start_code=#{checkDataDto.startCode}
@@ -137,13 +137,13 @@
         start_code,end_code,b.prj_id,area
         FROM
         tf_ywpn_check_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.startCode !=null">
                 and start_code=#{checkDataDto.startCode}
@@ -162,10 +162,10 @@
         LEFT JOIN
         (
             SELECT
-            a.*,b.prj_id
+            a.*
             FROM
             tf_ywpn_detect_data_w a
-            LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+
             WHERE
             a.STATUS = 0
             and a.del_flag=0
@@ -176,10 +176,10 @@
             LEFT JOIN
             (
             SELECT
-            a.*,b.prj_id
+            a.*
             FROM
             tf_ywpn_check_data_w a
-            LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+
             WHERE
             a.STATUS = 0
             and a.del_flag=0
@@ -191,16 +191,16 @@
                     RIGHT JOIN
                     (
                     SELECT
-                    a.*,b.prj_id
+                    a.*
                     FROM
                     tf_ywpn_check_data_w a
-                    LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+
                     WHERE
                     a.STATUS = 0
                     and a.del_flag=0
                     <if test="checkDataDto !=null  ">
                         <if test="checkDataDto.prjId !=null">
-                            and b.prj_id=#{checkDataDto.prjId}
+                            and prj_id=#{checkDataDto.prjId}
                         </if>
                         <if test="checkDataDto.startCode !=null">
                             and start_code=#{checkDataDto.startCode}
@@ -221,10 +221,10 @@
                     LEFT JOIN
                     (
                     SELECT
-                    a.*,b.prj_id
+                    a.*
                     FROM
                     tf_ywpn_check_data_w a
-                    LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+
                     WHERE
                     a.STATUS = 0
                     and a.del_flag=0
@@ -297,18 +297,18 @@
         SELECT
         start_code,
         end_code,
-        b.prj_id,
+        prj_id,
         area
         FROM
         tf_ywpn_detect_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+
         WHERE
         a.STATUS = 0
         AND a.del_flag = 0
         AND a.check_flag = 1
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.district !=null">
                 and area=#{checkDataDto.district}
@@ -322,13 +322,13 @@
         area
         FROM
         tf_ywpn_check_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+
         WHERE
         a.STATUS = 0
         AND a.del_flag = 0
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.district !=null">
                 and area=#{checkDataDto.district}
@@ -341,7 +341,7 @@
         b.prj_id
         FROM
         tf_ywpn_detect_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+
         WHERE
         a.STATUS = 0
         AND a.del_flag = 0
@@ -352,11 +352,11 @@
         AND a.area = b.area
         LEFT JOIN (
         SELECT
-        a.*,
-        b.prj_id
+        a.*
+
         FROM
         tf_ywpn_check_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+
         WHERE
         a.STATUS = 0
         AND a.del_flag = 0

+ 24 - 26
DataCheck/src/main/resources/customMapper/CheckAndHandleDataMapper.xml

@@ -138,8 +138,8 @@
         c.check_flag
         FROM
         (
-        SELECT start_code, end_code,b.prj_id,area FROM tf_ywpn_handle_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT start_code, end_code,prj_id,area FROM tf_ywpn_handle_data_w a
+
         WHERE
         a.STATUS = 0
         and a.del_flag=0
@@ -148,7 +148,7 @@
         </if>
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.startCode !=null">
                 and start_code=#{checkDataDto.startCode}
@@ -167,15 +167,15 @@
             </if>
         </if>
         UNION
-        SELECT start_code, end_code,b.prj_id,area FROM tf_ywpn_check_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT start_code, end_code,prj_id,area FROM tf_ywpn_check_data_w a
+
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         and a.check_flag=1
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.startCode !=null">
                 and start_code=#{checkDataDto.startCode}
@@ -190,8 +190,8 @@
         ) b
         <if test="checkDataDto ==null ">
             LEFT JOIN (
-            SELECT  a.*,b.prj_id FROM tf_ywpn_handle_data_w a
-            LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+            SELECT  a.* FROM tf_ywpn_handle_data_w a
+
             WHERE
             a.STATUS = 0
             and a.del_flag=0
@@ -202,14 +202,14 @@
             <choose>
                 <when test="checkDataDto.checkFlag !=null">
                     RIGHT JOIN (
-                    SELECT  a.*,b.prj_id FROM tf_ywpn_handle_data_w a
+                    SELECT  a.* FROM tf_ywpn_handle_data_w a
                     LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
                     WHERE
                     a.STATUS = 0
                     and a.del_flag=0
                     <if test="checkDataDto !=null  ">
                         <if test="checkDataDto.prjId !=null">
-                            and b.prj_id=#{checkDataDto.prjId}
+                            and prj_id=#{checkDataDto.prjId}
                         </if>
                         <if test="checkDataDto.startCode !=null">
                             and start_code=#{checkDataDto.startCode}
@@ -231,8 +231,8 @@
                 </when>
                 <when test="checkDataDto.checkFlag ==null">
                     LEFT JOIN (
-                    SELECT  a.*,b.prj_id FROM tf_ywpn_handle_data_w a
-                    LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+                    SELECT  a.* FROM tf_ywpn_handle_data_w a
+
                     WHERE
                     a.STATUS = 0
                     and a.del_flag=0
@@ -243,8 +243,8 @@
         </if>
         LEFT JOIN
         (
-        SELECT  a.*,b.prj_id FROM tf_ywpn_check_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT  a.* FROM tf_ywpn_check_data_w a
+
         WHERE
         a.STATUS = 0
         and a.del_flag=0
@@ -343,18 +343,18 @@
         SELECT
         start_code,
         end_code,
-        b.prj_id,
+        prj_id,
         area
         FROM
         tf_ywpn_handle_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+
         WHERE
         a.STATUS = 0
         AND a.del_flag = 0
         AND a.check_flag = 2
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.district !=null">
                 and area=#{checkDataDto.district}
@@ -364,18 +364,18 @@
         SELECT
         start_code,
         end_code,
-        b.prj_id,
+        prj_id,
         area
         FROM
         tf_ywpn_check_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+
         WHERE
         a.STATUS = 0
         AND a.del_flag = 0
         AND a.check_flag = 1
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.district !=null">
                 and area=#{checkDataDto.district}
@@ -384,11 +384,10 @@
         ) b
         LEFT JOIN (
         SELECT
-        a.*,
-        b.prj_id
+        a.*
         FROM
         tf_ywpn_handle_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+
         WHERE
         a.STATUS = 0
         AND a.del_flag = 0
@@ -401,11 +400,10 @@
         )
         LEFT JOIN (
         SELECT
-        a.*,
-        b.prj_id
+        a.*
         FROM
         tf_ywpn_check_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+
         WHERE
         a.STATUS = 0
         AND a.del_flag = 0

+ 25 - 25
DataCheck/src/main/resources/customMapper/CheckAndMonitorSettleMapper.xml

@@ -106,15 +106,15 @@
         d.remark remark2
         FROM
         (
-        SELECT start_code, end_code,b.prj_id FROM tf_ywpn_check_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT start_code, end_code,prj_id FROM tf_ywpn_check_data_w a
+
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         and a.check_flag=1
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.startCode !=null">
                 and start_code=#{checkDataDto.startCode}
@@ -124,14 +124,14 @@
             </if>
         </if>
         UNION
-        SELECT start_code , end_code,b.prj_id FROM tf_ywpn_whatinfo_monitorsettle_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT start_code , end_code,prj_id FROM tf_ywpn_whatinfo_monitorsettle_w a
+
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.startCode !=null">
                 and start_code=#{checkDataDto.startCode}
@@ -146,8 +146,8 @@
         ) b
         LEFT JOIN
         (
-        SELECT a.*,b.prj_id FROM tf_ywpn_check_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT a.* FROM tf_ywpn_check_data_w a
+
         WHERE
         a.STATUS = 0
         and a.del_flag=0
@@ -157,8 +157,8 @@
         <if test="checkDataDto ==null ">
             LEFT JOIN
             (
-            SELECT a.*,b.prj_id FROM tf_ywpn_whatinfo_monitorsettle_w a
-            LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+            SELECT a.* FROM tf_ywpn_whatinfo_monitorsettle_w a
+
             WHERE
             a.STATUS = 0
             and a.del_flag=0
@@ -170,14 +170,14 @@
                 <when test="checkDataDto.checkFlag !=null">
                     RIGHT JOIN
                     (
-                    SELECT a.*,b.prj_id FROM tf_ywpn_whatinfo_monitorsettle_w a
-                    LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+                    SELECT a.* FROM tf_ywpn_whatinfo_monitorsettle_w a
+
                     WHERE
                     a.STATUS = 0
                     and a.del_flag=0
                     <if test="checkDataDto !=null  ">
                         <if test="checkDataDto.prjId !=null">
-                            and b.prj_id=#{checkDataDto.prjId}
+                            and prj_id=#{checkDataDto.prjId}
                         </if>
                         <if test="checkDataDto.startCode !=null">
                             and start_code=#{checkDataDto.startCode}
@@ -195,8 +195,8 @@
                 <when test="checkDataDto.checkFlag ==null">
                     LEFT JOIN
                     (
-                    SELECT a.*,b.prj_id FROM tf_ywpn_whatinfo_monitorsettle_w a
-                    LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+                    SELECT a.* FROM tf_ywpn_whatinfo_monitorsettle_w a
+
                     WHERE
                     a.STATUS = 0
                     and a.del_flag=0
@@ -280,33 +280,33 @@
         d.check_length check_length2
         FROM
         (
-        SELECT start_code, end_code,b.prj_id FROM tf_ywpn_check_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT start_code, end_code,prj_id FROM tf_ywpn_check_data_w a
+
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         and a.check_flag=1
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
         </if>
         UNION
-        SELECT start_code , end_code,b.prj_id FROM tf_ywpn_whatinfo_monitorsettle_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT start_code , end_code,prj_id FROM tf_ywpn_whatinfo_monitorsettle_w a
+
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
         </if>
         ) b
         LEFT JOIN
         (
-        SELECT a.*,b.prj_id FROM tf_ywpn_check_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT a.* FROM tf_ywpn_check_data_w a
+
         WHERE
         a.STATUS = 0
         and a.del_flag=0
@@ -315,8 +315,8 @@
         c ON ( c.start_code = b.start_code AND c.end_code = b.end_code AND b.prj_id=c.prj_id )
         LEFT JOIN
         (
-        SELECT a.*,b.prj_id FROM tf_ywpn_whatinfo_monitorsettle_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT a.* FROM tf_ywpn_whatinfo_monitorsettle_w a
+
         WHERE
         a.STATUS = 0
         and a.del_flag=0

+ 17 - 24
DataCheck/src/main/resources/customMapper/CheckDetectAndPreDataMapper.xml

@@ -100,15 +100,15 @@
         d.remark remark2
         FROM
         (
-        SELECT start_code, end_code,b.prj_id,area FROM tf_ywpn_detect_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT start_code, end_code,prj_id,area FROM tf_ywpn_detect_data_w a
+
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         and a.check_flag=1
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.startCode !=null">
                 and start_code=#{checkDataDto.startCode}
@@ -121,8 +121,8 @@
             </if>
         </if>
         UNION
-        SELECT start_code, end_code ,b.prj_id,a.district area FROM tf_ywpn_whatinfo_presettle_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT start_code, end_code ,prj_id,a.district area FROM tf_ywpn_whatinfo_presettle_w a
+
         WHERE
         a.STATUS = 0
         and a.del_flag=0
@@ -131,7 +131,7 @@
         </if>
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.startCode !=null">
                 and start_code=#{checkDataDto.startCode}
@@ -152,8 +152,8 @@
         ) b
         LEFT JOIN
         (
-        SELECT a.*,b.prj_id FROM tf_ywpn_detect_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT a.* FROM tf_ywpn_detect_data_w a
+
         WHERE
         a.STATUS = 0
         and a.del_flag=0
@@ -164,10 +164,9 @@
             LEFT JOIN
             (
             SELECT
-            a.*,b.prj_id
+            a.*
             FROM
             tf_ywpn_whatinfo_presettle_w a
-            LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
             WHERE
             a.STATUS = 0
             and a.del_flag=0
@@ -180,16 +179,15 @@
                     RIGHT JOIN
                     (
                     SELECT
-                    a.*,b.prj_id
+                    a.*
                     FROM
                     tf_ywpn_whatinfo_presettle_w a
-                    LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
                     WHERE
                     a.STATUS = 0
                     and a.del_flag=0
                     <if test="checkDataDto !=null  ">
                         <if test="checkDataDto.prjId !=null">
-                            and b.prj_id=#{checkDataDto.prjId}
+                            and prj_id=#{checkDataDto.prjId}
                         </if>
                         <if test="checkDataDto.startCode !=null">
                             and start_code=#{checkDataDto.startCode}
@@ -214,10 +212,9 @@
                     LEFT JOIN
                     (
                     SELECT
-                    a.*,b.prj_id
+                    a.*
                     FROM
                     tf_ywpn_whatinfo_presettle_w a
-                    LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
                     WHERE
                     a.STATUS = 0
                     and a.del_flag=0
@@ -299,15 +296,14 @@
         d.pipe_length_up pipe_length_up2
         FROM
         (
-        SELECT start_code, end_code ,b.prj_id,area FROM tf_ywpn_detect_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT start_code, end_code ,prj_id,area FROM tf_ywpn_detect_data_w a
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         and a.check_flag=1
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.district !=null">
                 and area=#{checkDataDto.district}
@@ -315,14 +311,13 @@
         </if>
         UNION
         SELECT start_code, end_code ,b.prj_id,a.district area FROM tf_ywpn_whatinfo_presettle_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         and a.check_flag=1
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.district !=null">
                 and a.district=#{checkDataDto.district}
@@ -331,8 +326,7 @@
         ) b
         LEFT JOIN
         (
-        SELECT a.*,b.prj_id FROM tf_ywpn_detect_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT a.* FROM tf_ywpn_detect_data_w a
         WHERE
         a.STATUS = 0
         and a.del_flag=0
@@ -342,10 +336,9 @@
         LEFT JOIN
         (
         SELECT
-        a.*,b.prj_id
+        a.*
         FROM
         tf_ywpn_whatinfo_presettle_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
         WHERE
         a.STATUS = 0
         and a.del_flag=0

+ 15 - 25
DataCheck/src/main/resources/customMapper/DetectAndHandleMapper.xml

@@ -127,17 +127,16 @@
         FROM
         (
         SELECT
-        start_code,end_code,b.prj_id,area
+        start_code,end_code,prj_id,area
         FROM
         tf_ywpn_detect_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         and a.check_flag=1
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.startCode !=null">
                 and start_code=#{checkDataDto.startCode}
@@ -151,16 +150,15 @@
         </if>
         UNION
         SELECT
-        start_code,end_code,b.prj_id,area
+        start_code,end_code,prj_id,area
         FROM
         tf_ywpn_handle_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.startCode !=null">
                 and start_code=#{checkDataDto.startCode}
@@ -185,10 +183,9 @@
         LEFT JOIN
         (
             SELECT
-             a.*,b.prj_id
+             a.*
             FROM
             tf_ywpn_detect_data_w a
-            LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
             WHERE
             a.STATUS = 0
             and a.del_flag=0
@@ -198,10 +195,9 @@
             LEFT JOIN
             (
             SELECT
-            a.*,b.prj_id
+            a.*
             FROM
             tf_ywpn_handle_data_w a
-            LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
             WHERE
             a.STATUS = 0
             and a.del_flag=0
@@ -214,16 +210,15 @@
                     RIGHT JOIN
                     (
                     SELECT
-                    a.*,b.prj_id
+                    a.*
                     FROM
                     tf_ywpn_handle_data_w a
-                    LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
                     WHERE
                     a.STATUS = 0
                     and a.del_flag=0
                     <if test="checkDataDto !=null  ">
                         <if test="checkDataDto.prjId !=null">
-                            and b.prj_id=#{checkDataDto.prjId}
+                            and prj_id=#{checkDataDto.prjId}
                         </if>
                         <if test="checkDataDto.startCode !=null">
                             and start_code=#{checkDataDto.startCode}
@@ -247,10 +242,9 @@
                     LEFT JOIN
                     (
                     SELECT
-                    a.*,b.prj_id
+                    a.*
                     FROM
                     tf_ywpn_handle_data_w a
-                    LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
                     WHERE
                     a.STATUS = 0
                     and a.del_flag=0
@@ -326,17 +320,16 @@
         FROM
         (
         SELECT
-        start_code,end_code,b.prj_id,area
+        start_code,end_code,prj_id,area
         FROM
         tf_ywpn_detect_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         and a.check_flag=1
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.district !=null">
                 and area=#{checkDataDto.district}
@@ -344,17 +337,16 @@
         </if>
         UNION
         SELECT
-        start_code,end_code,b.prj_id,area
+        start_code,end_code,prj_id,area
         FROM
         tf_ywpn_handle_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         and a.check_flag=1
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.district !=null">
                 and area=#{checkDataDto.district}
@@ -364,10 +356,9 @@
         LEFT JOIN
         (
         SELECT
-        a.*,b.prj_id
+        a.*
         FROM
         tf_ywpn_detect_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
         WHERE
         a.STATUS = 0
         and a.del_flag=0
@@ -376,10 +367,9 @@
         LEFT JOIN
         (
         SELECT
-        a.*,b.prj_id
+        a.*
         FROM
         tf_ywpn_handle_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
         WHERE
         a.STATUS = 0
         and a.del_flag=0

+ 15 - 23
DataCheck/src/main/resources/customMapper/DetectAndMonitorSettleMapper.xml

@@ -88,15 +88,14 @@
         d.remark remark2
         FROM
         (
-        SELECT start_code, end_code,b.prj_id FROM tf_ywpn_detect_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT start_code, end_code,prj_id FROM tf_ywpn_detect_data_w a
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         and a.check_flag=1
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.startCode !=null">
                 and start_code=#{checkDataDto.startCode}
@@ -106,8 +105,7 @@
             </if>
         </if>
         UNION
-        SELECT start_code, end_code ,b.prj_id FROM tf_ywpn_whatinfo_monitorsettle_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT start_code, end_code ,prj_id FROM tf_ywpn_whatinfo_monitorsettle_w a
         WHERE
         a.STATUS = 0
         and a.del_flag=0
@@ -116,7 +114,7 @@
         </if>
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.startCode !=null">
                 and start_code=#{checkDataDto.startCode}
@@ -134,8 +132,7 @@
         ) b
         LEFT JOIN
         (
-        SELECT a.*,b.prj_id FROM tf_ywpn_detect_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT a.* FROM tf_ywpn_detect_data_w a
         WHERE
         a.STATUS = 0
         and a.del_flag=0
@@ -146,10 +143,9 @@
             LEFT JOIN
             (
             SELECT
-            a.*,b.prj_id
+            a.*
             FROM
             tf_ywpn_whatinfo_monitorsettle_w a
-            LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
             WHERE
             a.STATUS = 0
             and a.del_flag=0
@@ -162,7 +158,7 @@
                     RIGHT JOIN
                     (
                     SELECT
-                    a.*,b.prj_id
+                    a.*
                     FROM
                     tf_ywpn_whatinfo_monitorsettle_w a
                     LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
@@ -171,7 +167,7 @@
                     and a.del_flag=0
                     <if test="checkDataDto !=null  ">
                         <if test="checkDataDto.prjId !=null">
-                            and b.prj_id=#{checkDataDto.prjId}
+                            and prj_id=#{checkDataDto.prjId}
                         </if>
                         <if test="checkDataDto.startCode !=null">
                             and start_code=#{checkDataDto.startCode}
@@ -192,10 +188,9 @@
                     LEFT JOIN
                     (
                     SELECT
-                    a.*,b.prj_id
+                    a.*
                     FROM
                     tf_ywpn_whatinfo_monitorsettle_w a
-                    LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
                     WHERE
                     a.STATUS = 0
                     and a.del_flag=0
@@ -270,33 +265,31 @@
         d.check_length check_length2
         FROM
         (
-        SELECT start_code, end_code,b.prj_id FROM tf_ywpn_detect_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT start_code, end_code,prj_id FROM tf_ywpn_detect_data_w a
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         and a.check_flag=1
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
         </if>
         UNION
-        SELECT start_code, end_code ,b.prj_id FROM tf_ywpn_whatinfo_monitorsettle_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT start_code, end_code ,prj_id FROM tf_ywpn_whatinfo_monitorsettle_w a
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         and a.check_flag=1
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
         </if>
         ) b
         LEFT JOIN
         (
-        SELECT a.*,b.prj_id FROM tf_ywpn_detect_data_w a
+        SELECT a.* FROM tf_ywpn_detect_data_w a
         LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
         WHERE
         a.STATUS = 0
@@ -307,10 +300,9 @@
         LEFT JOIN
         (
         SELECT
-        a.*,b.prj_id
+        a.*
         FROM
         tf_ywpn_whatinfo_monitorsettle_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
         WHERE
         a.STATUS = 0
         and a.del_flag=0

+ 17 - 17
DataCheck/src/main/resources/customMapper/DetectAndTaskMapper.xml

@@ -91,12 +91,12 @@
         FROM
         (
          SELECT start_code, end_code ,b.prj_id,area FROM tf_ywpn_detect_data_w a
-         LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+
          WHERE a.STATUS = '0'
         and a.del_flag=0
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.startCode !=null">
                 and start_code=#{checkDataDto.startCode}
@@ -112,13 +112,13 @@
             </if>
         </if>
              UNION
-         SELECT start_code, end_code ,b.prj_id,area  FROM tf_ywpn_task_data_w a
-         LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+         SELECT start_code, end_code ,prj_id,area  FROM tf_ywpn_task_data_w a
+
          WHERE a.STATUS = '0'
         and a.del_flag=0
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.startCode !=null">
                 and start_code=#{checkDataDto.startCode}
@@ -134,8 +134,8 @@
         <if test="checkDataDto ==null ">
             LEFT JOIN
             (
-            SELECT  a.*,b.prj_id FROM tf_ywpn_detect_data_w a
-            LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+            SELECT  a.* FROM tf_ywpn_detect_data_w a
+
             WHERE a.STATUS = '0'
             and a.del_flag=0
             ) c
@@ -146,7 +146,7 @@
                 <when test="checkDataDto.checkFlag !=null">
                     RIGHT JOIN
                     (
-                    SELECT  a.*,b.prj_id FROM tf_ywpn_detect_data_w a
+                    SELECT  a.* FROM tf_ywpn_detect_data_w a
                     LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
                     WHERE a.STATUS = '0'
                     and a.del_flag=0
@@ -173,7 +173,7 @@
                 <when test="checkDataDto.checkFlag ==null">
                     LEFT JOIN
                     (
-                    SELECT  a.*,b.prj_id FROM tf_ywpn_detect_data_w a
+                    SELECT  a.* FROM tf_ywpn_detect_data_w a
                     LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
                     WHERE a.STATUS = '0'
                     and a.del_flag=0
@@ -246,26 +246,26 @@
         c.section_data_two section_data_two2
         FROM
         (
-        SELECT start_code, end_code,b.prj_id,area FROM tf_ywpn_detect_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT start_code, end_code,prj_id,area FROM tf_ywpn_detect_data_w a
+
         WHERE a.STATUS = '0'
         and a.del_flag=0
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.district !=null">
                 and area=#{checkDataDto.district}
             </if>
         </if>
         UNION
-        SELECT start_code, end_code,b.prj_id,area  FROM tf_ywpn_task_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+        SELECT start_code, end_code,prj_id,area  FROM tf_ywpn_task_data_w a
+
         WHERE a.STATUS = '0'
         and a.del_flag=0
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.district !=null">
                 and area=#{checkDataDto.district}
@@ -274,7 +274,7 @@
         ) b
         LEFT JOIN
         (
-        SELECT  a.*,b.prj_id FROM tf_ywpn_detect_data_w a
+        SELECT  a.* FROM tf_ywpn_detect_data_w a
         LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
         WHERE a.STATUS = '0'
         and a.del_flag=0
@@ -282,7 +282,7 @@
         ON ( c.start_code = b.start_code AND c.end_code = b.end_code  AND c.prj_id=b.prj_id AND c.area=b.area  )
         LEFT JOIN
         (
-        SELECT a.*,b.prj_id  FROM tf_ywpn_task_data_w a
+        SELECT a.* FROM tf_ywpn_task_data_w a
         LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
         WHERE a.STATUS = '0'
         and a.del_flag=0

+ 15 - 25
DataCheck/src/main/resources/customMapper/PresetteleAndHandleMapper.xml

@@ -157,17 +157,16 @@
         FROM
         (
         SELECT
-        start_code,end_code,b.prj_id,area
+        start_code,end_code,prj_id,area
         FROM
         tf_ywpn_handle_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         and a.check_flag=2
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.startCode !=null">
                 and start_code=#{checkDataDto.startCode}
@@ -181,16 +180,15 @@
         </if>
         UNION
         SELECT
-        start_code, end_code,b.prj_id,a.district area
+        start_code, end_code,prj_id,a.district area
         FROM
         tf_ywpn_whatinfo_presettle_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.startCode !=null">
                 and start_code=#{checkDataDto.startCode}
@@ -209,10 +207,9 @@
         LEFT JOIN
         (
             SELECT
-            a.*,b.prj_id
+            a.*
             FROM
             tf_ywpn_handle_data_w a
-            LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
             WHERE
             a.STATUS = 0
             and a.del_flag=0
@@ -223,10 +220,9 @@
             LEFT JOIN
             (
             SELECT
-            a.*,b.prj_id
+            a.*
             FROM
             tf_ywpn_whatinfo_presettle_w a
-            LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
             WHERE
             a.STATUS = 0
             and a.del_flag=0
@@ -238,16 +234,15 @@
                     RIGHT JOIN
                     (
                     SELECT
-                    a.*,b.prj_id
+                    a.*
                     FROM
                     tf_ywpn_whatinfo_presettle_w a
-                    LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
                     WHERE
                     a.STATUS = 0
                     and a.del_flag=0
                     <if test="checkDataDto !=null  ">
                         <if test="checkDataDto.prjId !=null">
-                            and b.prj_id=#{checkDataDto.prjId}
+                            and prj_id=#{checkDataDto.prjId}
                         </if>
                         <if test="checkDataDto.startCode !=null">
                             and start_code=#{checkDataDto.startCode}
@@ -268,10 +263,9 @@
                     LEFT JOIN
                     (
                     SELECT
-                    a.*,b.prj_id
+                    a.*
                     FROM
                     tf_ywpn_whatinfo_presettle_w a
-                    LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
                     WHERE
                     a.STATUS = 0
                     and a.del_flag=0
@@ -349,17 +343,16 @@
         FROM
         (
         SELECT
-        start_code,end_code,b.prj_id,area
+        start_code,end_code,prj_id,area
         FROM
         tf_ywpn_handle_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         and a.check_flag=2
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.district !=null">
                 and area=#{checkDataDto.district}
@@ -367,16 +360,15 @@
         </if>
         UNION
         SELECT
-        start_code,end_code,b.prj_id,a.district area
+        start_code,end_code,prj_id,a.district area
         FROM
         tf_ywpn_whatinfo_presettle_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
         WHERE
         a.STATUS = 0
         and a.del_flag=0
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.district !=null">
                 and a.district=#{checkDataDto.district}
@@ -386,10 +378,9 @@
         LEFT JOIN
         (
         SELECT
-        a.*,b.prj_id
+        a.*,prj_id
         FROM
         tf_ywpn_handle_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
         WHERE
         a.STATUS = 0
         and a.del_flag=0
@@ -399,10 +390,9 @@
         LEFT JOIN
         (
         SELECT
-        a.*,b.prj_id
+        a.*
         FROM
         tf_ywpn_whatinfo_presettle_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
         WHERE
         a.STATUS = 0
         and a.del_flag=0

+ 15 - 21
DataCheck/src/main/resources/customMapper/RainAndHandleMapper.xml

@@ -136,13 +136,12 @@
         c.check_flag
         FROM
         (
-        SELECT start_code, end_code,b.prj_id,area  FROM tf_ywpn_check_data_w a
+        SELECT start_code, end_code,prj_id,area  FROM tf_ywpn_check_data_w a
         left join
-        tf_ywpn_batchinfo_w b on a.info_id=b.id
         WHERE a.rain_task='是' and a.STATUS = 0   and a.del_flag=0
         <if test="checkDataDto !=null  ">
                 <if test="checkDataDto.prjId !=null">
-                    and b.prj_id=#{checkDataDto.prjId}
+                    and prj_id=#{checkDataDto.prjId}
                 </if>
                 <if test="checkDataDto.startCode !=null">
                    and start_code=#{checkDataDto.startCode}
@@ -155,15 +154,14 @@
                 </if>
             </if>
             UNION
-            SELECT start_code, end_code,b.prj_id,area  FROM tf_ywpn_handle_data_w a
-            left join
-            tf_ywpn_batchinfo_w b on a.info_id=b.id
+            SELECT start_code, end_code,prj_id,area  FROM tf_ywpn_handle_data_w a
+
             WHERE a.STATUS = 0 and a.del_flag=0
             and a.pipe_properties='雨水'
             and a.pd_check_length is not null
             <if test="checkDataDto !=null  ">
                 <if test="checkDataDto.prjId !=null">
-                    and b.prj_id=#{checkDataDto.prjId}
+                    and prj_id=#{checkDataDto.prjId}
                 </if>
                 <if test="checkDataDto.startCode !=null">
                     and start_code=#{checkDataDto.startCode}
@@ -181,18 +179,16 @@
             ) a
             LEFT JOIN
             (
-            SELECT a.*,b.prj_id FROM tf_ywpn_check_data_w a
+            SELECT a.* FROM tf_ywpn_check_data_w a
             left join
-            tf_ywpn_batchinfo_w b on a.info_id=b.id
             WHERE a.rain_task='是' and a.STATUS = 0 and a.del_flag=0
             )
             b ON a.start_code = b.start_code AND a.end_code = b.end_code AND a.prj_id=b.prj_id AND a.area=b.area
             <if test="checkDataDto ==null ">
                 LEFT JOIN
                 (
-                SELECT a.*,b.prj_id  FROM tf_ywpn_handle_data_w a
-                left join
-                tf_ywpn_batchinfo_w b on a.info_id=b.id
+                SELECT a.*  FROM tf_ywpn_handle_data_w a
+
                 WHERE a.STATUS = 0 and a.del_flag=0
                 and a.pipe_properties='雨水'
                 and a.pd_check_length is not null
@@ -204,15 +200,14 @@
                     <when test="checkDataDto.checkFlag !=null">
                         RIGHT JOIN
                         (
-                        SELECT a.*,b.prj_id  FROM tf_ywpn_handle_data_w a
-                        left join
-                        tf_ywpn_batchinfo_w b on a.info_id=b.id
+                        SELECT a.*  FROM tf_ywpn_handle_data_w a
+
                         WHERE a.STATUS = 0 and a.del_flag=0
                         and a.pipe_properties='雨水'
                         and a.pd_check_length is not null
                         <if test="checkDataDto !=null  ">
                             <if test="checkDataDto.prjId !=null">
-                                and b.prj_id=#{checkDataDto.prjId}
+                                and prj_id=#{checkDataDto.prjId}
                             </if>
                             <if test="checkDataDto.startCode !=null">
                                 and start_code=#{checkDataDto.startCode}
@@ -233,9 +228,8 @@
                     <when test="checkDataDto.checkFlag ==null">
                         LEFT JOIN
                         (
-                        SELECT a.*,b.prj_id  FROM tf_ywpn_handle_data_w a
-                        left join
-                        tf_ywpn_batchinfo_w b on a.info_id=b.id
+                        SELECT a.*  FROM tf_ywpn_handle_data_w a
+
                         WHERE a.STATUS = 0 and a.del_flag=0
                         and a.pipe_properties='雨水'
                         and a.pd_check_length is not null
@@ -283,13 +277,13 @@
         a.*
         FROM
         tf_ywpn_handle_data_w a
-        LEFT JOIN tf_ywpn_batchinfo_w b ON a.info_id = b.id
+
         WHERE
         a.STATUS = 0
         AND a.del_flag = 0
         <if test="checkDataDto !=null  ">
             <if test="checkDataDto.prjId !=null">
-                and b.prj_id=#{checkDataDto.prjId}
+                and prj_id=#{checkDataDto.prjId}
             </if>
             <if test="checkDataDto.district !=null">
                 and area=#{checkDataDto.district}