Bladeren bron

【CHG】修改查询字段

zhaomn 2 jaren geleden
bovenliggende
commit
a844c45bc6

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

@@ -158,7 +158,7 @@
         and substation_name like concat('%', #{substationName}, '%')
       </if>
       <if test="jhMonth!=null and jhMonth!=''">
-        and jh_month like concat('%', #{jhMonth})
+        and LPAD(jh_month, 2, 0) = LPAD(#{month}, 2, 0)
       </if>
     </where>
   </select>
@@ -170,7 +170,7 @@
       and file_id = (select max(id) from show_file where data_type='bdsjxjh' and imp_result = '1')
       and (completion_state != '1' || completion_state = '0' or completion_state is null)
       <if test="jhMonth!=null and jhMonth!=''">
-        and jh_month like concat('%', #{jhMonth})
+        and LPAD(jh_month, 2, 0) = LPAD(#{month}, 2, 0)
       </if>
     </where>
   </select>
@@ -182,7 +182,7 @@
       and file_id = (select max(id) from show_file where data_type='bdsjxjh' and imp_result = '1')
       and completion_state = '1'
       <if test="month!=null and month!=''">
-        and LPAD(MONTH(completion_date), 2, 0) like concat('%', #{month})
+        and LPAD(MONTH(completion_date), 2, 0) = LPAD(#{month}, 2, 0)
       </if>
     </where>
   </select>
@@ -201,7 +201,7 @@
     where
       del_flag='0'
       and file_id = (select max(id) from show_file where data_type='bdsjxjh' and imp_result = '1')
-      and jh_month = #{month}
+      and LPAD(jh_month, 2, 0) = LPAD(#{month}, 2, 0)
       and (completion_state != '1' or completion_state = '')
   </select>
 

+ 11 - 11
railway-business/src/main/resources/mapper/bi/ShowSbxjMapper.xml

@@ -625,17 +625,17 @@
       del_flag='0'
       and file_id = (select max(id) from show_file where data_type = 'xjdx' and imp_result = '1')
       <if test="month==1">and plan1 is not null and plan1 != '' and (actual1 is null or actual1 = '')</if>
-      <if test="month==1">and plan2 is not null and plan2 != '' and (actual2 is null or actual2 = '')</if>
-      <if test="month==1">and plan3 is not null and plan3 != '' and (actual3 is null or actual3 = '')</if>
-      <if test="month==1">and plan4 is not null and plan4 != '' and (actual4 is null or actual4 = '')</if>
-      <if test="month==1">and plan5 is not null and plan5 != '' and (actual5 is null or actual5 = '')</if>
-      <if test="month==1">and plan6 is not null and plan6 != '' and (actual6 is null or actual6 = '')</if>
-      <if test="month==1">and plan7 is not null and plan7 != '' and (actual7 is null or actual7 = '')</if>
-      <if test="month==1">and plan8 is not null and plan8 != '' and (actual8 is null or actual8 = '')</if>
-      <if test="month==1">and plan9 is not null and plan9 != '' and (actual9 is null or actual9 = '')</if>
-      <if test="month==1">and plan10 is not null and plan10 != '' and (actual10 is null or actual10 = '')</if>
-      <if test="month==1">and plan11 is not null and plan11 != '' and (actual11 is null or actual11 = '')</if>
-      <if test="month==1">and plan12 is not null and plan12 != '' and (actual12 is null or actual12 = '')</if>
+      <if test="month==2">and plan2 is not null and plan2 != '' and (actual2 is null or actual2 = '')</if>
+      <if test="month==3">and plan3 is not null and plan3 != '' and (actual3 is null or actual3 = '')</if>
+      <if test="month==4">and plan4 is not null and plan4 != '' and (actual4 is null or actual4 = '')</if>
+      <if test="month==5">and plan5 is not null and plan5 != '' and (actual5 is null or actual5 = '')</if>
+      <if test="month==6">and plan6 is not null and plan6 != '' and (actual6 is null or actual6 = '')</if>
+      <if test="month==7">and plan7 is not null and plan7 != '' and (actual7 is null or actual7 = '')</if>
+      <if test="month==8">and plan8 is not null and plan8 != '' and (actual8 is null or actual8 = '')</if>
+      <if test="month==9">and plan9 is not null and plan9 != '' and (actual9 is null or actual9 = '')</if>
+      <if test="month==10">and plan10 is not null and plan10 != '' and (actual10 is null or actual10 = '')</if>
+      <if test="month==11">and plan11 is not null and plan11 != '' and (actual11 is null or actual11 = '')</if>
+      <if test="month==12">and plan12 is not null and plan12 != '' and (actual12 is null or actual12 = '')</if>
     </where>
   </select>