浏览代码

PSSR查询增加表别名

jiangbiao 5 月之前
父节点
当前提交
5635f79bad

+ 5 - 5
master/src/main/resources/mybatis/pssr/TPssrOverhaulExchangerMapper.xml

@@ -35,11 +35,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 
     <select id="selectNoConfirmCount"  parameterType="Long" resultType="int">
-        SELECT  and d.del_flag = 0
-            (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_EXCHANGER WHERE sub_id = #{subId} and CONFIRMED_PERSON IS NULL) +
-            (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_FILTER WHERE sub_id = #{subId} and RESP_PERSON IS NULL) +
-            (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_TOWER WHERE sub_id = #{subId} and CONFIRMED_PERSON IS NULL) +
-            (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_VALVE WHERE sub_id = #{subId} and IDENTIFYING_PERSON IS NULL)
+        SELECT
+            (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_EXCHANGER WHERE sub_id = #{subId} and CONFIRMED_PERSON IS NULL and del_flag = 0) +
+            (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_FILTER WHERE sub_id = #{subId} and RESP_PERSON IS NULL and del_flag = 0) +
+            (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_TOWER WHERE sub_id = #{subId} and CONFIRMED_PERSON IS NULL and del_flag = 0) +
+            (SELECT COUNT(1) FROM T_PSSR_OVERHAUL_VALVE WHERE sub_id = #{subId} and IDENTIFYING_PERSON IS NULL and del_flag = 0)
         FROM dual
     </select>
 

+ 4 - 4
master/src/main/resources/mybatis/pssr/TPssrPumpCleaningMapper.xml

@@ -38,10 +38,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 
     <select id="selectNoConfirmCount"  parameterType="Long" resultType="int">
-        select  and d.del_flag = 0
-            (select count(1) from T_PSSR_PUMP_CLEANING where sub_id = #{subId} and (confirmer1 is null or confirmer2 is null))+
-            (select count(1) from T_PSSR_PUMP_FILL where sub_id = #{subId} and (confirmer1 is null or confirmer2 is null))+
-            (select count(1) from T_PSSR_PUMP_OVERHAUL where sub_id = #{subId} and (confirmer1 is null or confirmer2 is null))
+        select
+            (select count(1) from T_PSSR_PUMP_CLEANING where sub_id = #{subId} and (confirmer1 is null or confirmer2 is null)  and d.del_flag = 0)+
+            (select count(1) from T_PSSR_PUMP_FILL where sub_id = #{subId} and (confirmer1 is null or confirmer2 is null)  and d.del_flag = 0)+
+            (select count(1) from T_PSSR_PUMP_OVERHAUL where sub_id = #{subId} and (confirmer1 is null or confirmer2 is null  and d.del_flag = 0))
         from dual
     </select>
 

+ 6 - 6
master/src/main/resources/mybatis/pssr/TPssrSafetyBleedMapper.xml

@@ -42,12 +42,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 
     <select id="selectNoConfirmCount"  parameterType="Long" resultType="int">
-        select  and d.del_flag = 0
-            (select count(1) from T_PSSR_SAFETY_BLEED where sub_id = #{subId} and (confirmer1 is null or confirmer2 is null))+
-            (select count(1) from T_PSSR_SAFETY_BREATH where sub_id = #{subId} and (confirmer1 is null or confirmer2 is null))+
-            (select count(1) from T_PSSR_SAFETY_BRUST where sub_id = #{subId} and (confirmer1 is null or confirmer2 is null))+
-            (select count(1) from T_PSSR_SAFETY_FLAMEARRESTER where sub_id = #{subId} and (confirmer1 is null or confirmer2 is null))+
-            (select count(1) from T_PSSR_SAFETY_VALVE where sub_id = #{subId} and (confirmer1 is null or confirmer2 is null))
+        select
+            (select count(1) from T_PSSR_SAFETY_BLEED where sub_id = #{subId} and (confirmer1 is null or confirmer2 is null)  and d.del_flag = 0)+
+            (select count(1) from T_PSSR_SAFETY_BREATH where sub_id = #{subId} and (confirmer1 is null or confirmer2 is null)  and d.del_flag = 0)+
+            (select count(1) from T_PSSR_SAFETY_BRUST where sub_id = #{subId} and (confirmer1 is null or confirmer2 is null)  and d.del_flag = 0)+
+            (select count(1) from T_PSSR_SAFETY_FLAMEARRESTER where sub_id = #{subId} and (confirmer1 is null or confirmer2 is null)  and d.del_flag = 0)+
+            (select count(1) from T_PSSR_SAFETY_VALVE where sub_id = #{subId} and (confirmer1 is null or confirmer2 is null)  and d.del_flag = 0)
         from dual
     </select>