Преглед изворни кода

【CHG】修改查询字段

zhaomn пре 2 година
родитељ
комит
20b3f0fb1a

+ 19 - 5
railway-business/src/main/resources/mapper/bi/ShowBpdjxjhMapper.xml

@@ -208,28 +208,42 @@
   <select id="countByywc" resultType="java.lang.Integer">
     select count(*)
     from show_bpdjxjh
-    where LPAD(jh_month, 2, 0) = LPAD(#{month}, 2, 0)
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type='bdsjxjh' and imp_result = '1')
+      and LPAD(jh_month, 2, 0) = LPAD(#{month}, 2, 0)
       and completion_state = '1';
   </select>
 
   <select id="countBywwc" resultType="java.lang.Integer">
     select count(*)
     from show_bpdjxjh
-    where LPAD(jh_month, 2, 0) = LPAD(#{month}, 2, 0) and (completion_state != '1' or completion_state = '')
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type='bdsjxjh' and imp_result = '1')
+      and LPAD(jh_month, 2, 0) = LPAD(#{month}, 2, 0) and (completion_state != '1' or completion_state = '')
   </select>
 
   <select id="countXyjhwc" resultType="java.lang.Integer">
-    select count(*) from show_bpdjxjh where LPAD(jh_month, 2, 0) = LPAD(#{month}, 2, 0)
+    select count(*)
+    from show_bpdjxjh
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type='bdsjxjh' and imp_result = '1')
+      and LPAD(jh_month, 2, 0) = LPAD(#{month}, 2, 0)
   </select>
 
   <select id="countNdsys" resultType="java.lang.Integer">
-    select count(*) from show_bpdjxjh where completion_state != '1' or completion_state = ''
+    select count(*)
+    from show_bpdjxjh
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type='bdsjxjh' and imp_result = '1')
+      and completion_state != '1' or completion_state = ''
   </select>
 
   <select id="listWwcmx" resultType="java.lang.String">
     select substation_name
     from show_bpdjxjh
-    where LPAD(jh_month, 2, 0) = LPAD(#{month}, 2, 0) and (completion_state != '1' or completion_state = '')
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type='bdsjxjh' and imp_result = '1')
+      and LPAD(jh_month, 2, 0) = LPAD(#{month}, 2, 0) and (completion_state != '1' or completion_state = '')
   </select>
 
 </mapper>

+ 25 - 5
railway-business/src/main/resources/mapper/bi/ShowGsdMapper.xml

@@ -316,23 +316,43 @@
   </select>
 
   <select id="countByywc" resultType="java.lang.Integer">
-    select count(*) from show_gsd where plan_month = #{month} and completion_date is not null and completion_date != '';
+    select count(*)
+    from show_gsd
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
+      and plan_month = #{month} and completion_date is not null and completion_date != '';
   </select>
 
   <select id="countBywwc" resultType="java.lang.Integer">
-    select count(*) from show_gsd where plan_month = #{month} and (completion_date is null or completion_date = '')
+    select count(*)
+    from show_gsd
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
+      and plan_month = #{month} and (completion_date is null or completion_date = '')
   </select>
 
   <select id="countXyjhwc" resultType="java.lang.Integer">
-    select count(*) from show_gsd where plan_month = #{month}
+    select count(*)
+    from show_gsd
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
+      and plan_month = #{month}
   </select>
 
   <select id="countNdsys" resultType="java.lang.Integer">
-    select count(*) from show_gsd where completion_date is null or completion_date = ''
+    select count(*)
+    from show_gsd
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
+      and completion_date is null or completion_date = ''
   </select>
 
   <select id="listWwcmx" resultType="java.lang.String">
-    select substation_name from show_gsd where plan_month = #{month} and (completion_date is null or completion_date = '')
+    select substation_name
+    from show_gsd
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
+      and plan_month = #{month} and (completion_date is null or completion_date = '')
   </select>
 
 </mapper>

+ 25 - 5
railway-business/src/main/resources/mapper/bi/ShowGsyMapper.xml

@@ -274,23 +274,43 @@
   </select>
 
   <select id="countByywc" resultType="java.lang.Integer">
-    select count(*) from show_gsy where MONTH(test_plan1) = #{month} and completion_date1 is not null and completion_date1 != '';
+    select count(*)
+    from show_gsd
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
+      and MONTH(test_plan1) = #{month} and completion_date1 is not null and completion_date1 != '';
   </select>
 
   <select id="countBywwc" resultType="java.lang.Integer">
-    select count(*) from show_gsy where MONTH(test_plan1) = #{month} and (completion_date1 is null or completion_date1 = '')
+    select count(*)
+    from show_gsd
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
+      and MONTH(test_plan1) = #{month} and (completion_date1 is null or completion_date1 = '')
   </select>
 
   <select id="countXyjhwc" resultType="java.lang.Integer">
-    select count(*) from show_gsy where MONTH(test_plan1) = #{month}
+    select count(*)
+    from show_gsd
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
+      and MONTH(test_plan1) = #{month}
   </select>
 
   <select id="countNdsys" resultType="java.lang.Integer">
-    select count(*) from show_gsy where completion_date1 is null or completion_date1 = ''
+    select count(*)
+    from show_gsd
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
+      and completion_date1 is null or completion_date1 = ''
   </select>
 
   <select id="listWwcmx" resultType="java.lang.String">
-    select substation_name from show_gsy where MONTH(test_plan1) = #{month} and (completion_date1 is null or completion_date1 = '')
+    select substation_name
+    from show_gsd
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
+      and MONTH(test_plan1) = #{month} and (completion_date1 is null or completion_date1 = '')
   </select>
 
 </mapper>

+ 25 - 5
railway-business/src/main/resources/mapper/bi/ShowYdtsMapper.xml

@@ -299,23 +299,43 @@
   </select>
 
   <select id="countByywc" resultType="java.lang.Integer">
-    select count(*) from show_ydts where plan_month = #{month} and completion_date is not null and completion_date != '';
+    select count(*)
+    from show_gsd
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
+      and plan_month = #{month} and completion_date is not null and completion_date != '';
   </select>
 
   <select id="countBywwc" resultType="java.lang.Integer">
-    select count(*) from show_ydts where plan_month = #{month} and (completion_date is null or completion_date = '')
+    select count(*)
+    from show_gsd
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
+      and plan_month = #{month} and (completion_date is null or completion_date = '')
   </select>
 
   <select id="countXyjhwc" resultType="java.lang.Integer">
-    select count(*) from show_ydts where plan_month = #{month}
+    select count(*)
+    from show_gsd
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
+      and plan_month = #{month}
   </select>
 
   <select id="countNdsys" resultType="java.lang.Integer">
-    select count(*) from show_ydts where completion_date is null or completion_date = ''
+    select count(*)
+    from show_gsd
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
+      and completion_date is null or completion_date = ''
   </select>
 
   <select id="listWwcmx" resultType="java.lang.String">
-    select substation_name from show_ydts where plan_month = #{month} and (completion_date is null or completion_date = '')
+    select substation_name
+    from show_gsd
+    where del_flag='0'
+      and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
+      and plan_month = #{month} and (completion_date is null or completion_date = '')
   </select>
 
 </mapper>