Bläddra i källkod

【CHG】修改检查表查询条件

ZhaoMn 3 år sedan
förälder
incheckning
d44add9cdc

+ 34 - 70
railway-business/src/main/resources/mapper/catenary/BusJcbBlqMapper.xml

@@ -358,9 +358,39 @@
     LEFT JOIN sys_user u on t.confirm_user = u.user_name
     LEFT JOIN (select DISTINCT pillar_code,sccj,dept_station_id from base_blq) base on (t.pillar_code = base.pillar_code and t.dept_station_id = base.dept_station_id)
     WHERE t.del_flag='0' and t.id = #{id}
-
   </select>
 
+  <sql id="queryParam">
+    t.del_flag='0'
+    <if test="deptId!=null and deptId!=''">
+      and v.dept_id=#{deptId}
+    </if>
+    <if test="deptIds!=null and deptIds.size() > 0">
+      and v.dept_id in
+      <foreach collection="deptIds" item="deptId" index="i" open="(" separator="," close=")">
+        #{deptId}
+      </foreach>
+    </if>
+    <if test="stationId!=null and stationId!=''">
+      and v.station_id=#{stationId}
+    </if>
+    <if test="stationIds!=null and stationIds.size() > 0">
+      and v.station_id in
+      <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
+        #{stationId}
+      </foreach>
+    </if>
+    <if test="submitState!=null and submitState!=''">
+      and t.submit_state <![CDATA[ >= ]]> #{submitState}
+    </if>
+    <if test="pillarCode!=null and pillarCode!=''">
+      and t.pillar_code=#{pillarCode}
+    </if>
+    <if test="createBy!=null and createBy!=''">
+      and t.create_by=#{createBy}
+    </if>
+  </sql>
+
   <select id="getList" resultMap="BaseResultMap">
     SELECT
     <include refid="Base_Column_List"/>,u.real_name confirm_user_real_name,base.sccj
@@ -369,31 +399,10 @@
     LEFT JOIN sys_user u on t.confirm_user = u.user_name
     LEFT JOIN (select DISTINCT pillar_code,sccj,dept_station_id from base_blq) base on (t.pillar_code = base.pillar_code and t.dept_station_id = base.dept_station_id)
     <where>
-      t.del_flag='0'
+      <include refid="queryParam"/>
       <if test="blqId!=null and blqId!=''">
         and t.blq_id=#{blqId}
       </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="deptIds!=null and deptIds.size() > 0">
-        and v.dept_id in
-        <foreach collection="deptIds" item="deptId" index="i" open="(" separator="," close=")">
-          #{deptId}
-        </foreach>
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="stationIds!=null and stationIds.size() > 0">
-        and v.station_id in
-        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
-          #{stationId}
-        </foreach>
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
       <if test="temperature!=null and temperature!=''">
         and t.temperature=#{temperature}
       </if>
@@ -469,21 +478,12 @@
       <if test="czwt!=null and czwt!=''">
         and t.czwt=#{czwt}
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="createTime!=null">
         and DATE_FORMAT(t.create_time, '%Y-%m-%d') = #{createTime}
       </if>
-      <if test="updateBy!=null and updateBy!=''">
-        and t.update_by=#{updateBy}
-      </if>
       <if test="updateTime!=null">
         and DATE_FORMAT(t.update_time, '%Y-%m-%d') = #{updateTime}
       </if>
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
     </where>
     <if test="orderBy!=null and orderBy!=''">
       order by t.${orderBy}
@@ -534,31 +534,10 @@
     LEFT JOIN (select DISTINCT pillar_code,sccj,dept_station_id from base_blq) base on (t.pillar_code = base.pillar_code and t.dept_station_id = base.dept_station_id)
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      t.del_flag='0'
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="stationIds!=null and stationIds.length > 0">
-        and v.station_id in
-        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
-          #{stationId}
-        </foreach>
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="operator!=null and operator!=''">
         and t.check_user like concat('%', #{operator}, '%')
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="operationDate!=null">
         and t.check_date=#{operationDate}
       </if>
@@ -620,25 +599,10 @@
     FROM bus_jcb_blq t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      t.del_flag='0'
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="operator!=null and operator!=''">
         and t.check_user like concat('%', #{operator}, '%')
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="operationDate!=null">
         and t.check_date=#{operationDate}
       </if>

+ 35 - 91
railway-business/src/main/resources/mapper/catenary/BusJcbDmcgyqMapper.xml

@@ -336,7 +336,6 @@
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     LEFT JOIN sys_dict_data dict ON (t.xingbie = dict.dict_value AND dict.dict_type = 'xingbie')
     WHERE t.del_flag='0' and t.id = #{id}
-
   </select>
 
   <select id="getJcebInfo" resultMap="BaseResultMap">
@@ -348,7 +347,6 @@
     LEFT JOIN sys_dict_data dict ON (t.xingbie = dict.dict_value AND dict.dict_type = 'xingbie')
     LEFT JOIN base_dmcgyq base ON t.gyq_id = base.id
     WHERE t.del_flag='0' and t.id = #{id}
-
   </select>
 
   <select id="getLastRecord" resultMap="BaseResultMap">
@@ -362,9 +360,39 @@
     and submit_state != '0'
     ) b
     WHERE a.update_time = b.lastTime
-
   </select>
 
+  <sql id="queryParam">
+    t.del_flag='0'
+    <if test="deptId!=null and deptId!=''">
+      and v.dept_id=#{deptId}
+    </if>
+    <if test="deptIds!=null and deptIds.size() > 0">
+      and v.dept_id in
+      <foreach collection="deptIds" item="deptId" index="i" open="(" separator="," close=")">
+        #{deptId}
+      </foreach>
+    </if>
+    <if test="stationId!=null and stationId!=''">
+      and v.station_id=#{stationId}
+    </if>
+    <if test="stationIds!=null and stationIds.size() > 0">
+      and v.station_id in
+      <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
+        #{stationId}
+      </foreach>
+    </if>
+    <if test="submitState!=null and submitState!=''">
+      and t.submit_state <![CDATA[ >= ]]> #{submitState}
+    </if>
+    <if test="pillarArea!=null and pillarArea!=''">
+      and t.pillar_area=#{pillarArea}
+    </if>
+    <if test="createBy!=null and createBy!=''">
+      and t.create_by=#{createBy}
+    </if>
+  </sql>
+
   <select id="getList" resultMap="BaseResultMap">
     SELECT
     <include refid="Base_Column_List"/>, dict.dict_label as xingbie_text
@@ -372,34 +400,13 @@
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     LEFT JOIN sys_dict_data dict ON (t.xingbie = dict.dict_value AND dict.dict_type = 'xingbie')
     <where>
-      t.del_flag='0'
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="deptIds!=null and deptIds.size() > 0">
-        and v.dept_id in
-        <foreach collection="deptIds" item="deptId" index="i" open="(" separator="," close=")">
-          #{deptId}
-        </foreach>
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="stationIds!=null and stationIds.size() > 0">
-        and v.station_id in
-        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
-          #{stationId}
-        </foreach>
-      </if>
+      <include refid="queryParam"/>
       <if test="fenxiang!=null and fenxiang!=''">
         and t.fenxiang=#{fenxiang}
       </if>
       <if test="xingbie!=null and xingbie!=''">
         and t.xingbie=#{xingbie}
       </if>
-      <if test="pillarArea!=null and pillarArea!=''">
-        and t.pillar_area=#{pillarArea}
-      </if>
       <if test="tianqi!=null and tianqi!=''">
         and t.tianqi=#{tianqi}
       </if>
@@ -460,12 +467,6 @@
       <if test="czwt!=null and czwt!=''">
         and t.czwt=#{czwt}
       </if>
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="createTime!=null">
         and DATE_FORMAT(t.create_time, '%Y-%m-%d') = #{createTime}
       </if>
@@ -501,31 +502,10 @@
     LEFT JOIN sys_dict_data dict ON (t.xingbie = dict.dict_value AND dict.dict_type = 'xingbie')
     LEFT JOIN base_dmcgyq base ON t.gyq_id = base.id
     <where>
-      t.del_flag='0' and t.submit_state = '9'
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="stationIds!=null and stationIds.length > 0">
-        and v.station_id in
-        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
-          #{stationId}
-        </foreach>
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_area=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="operator!=null and operator!=''">
         and t.check_user like concat('%', #{operator}, '%')
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="operationDate!=null">
         and t.check_date=#{operationDate}
       </if>
@@ -546,31 +526,10 @@
     FROM bus_jcb_dmcgyq t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      t.del_flag='0'
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="stationIds!=null and stationIds.length > 0">
-        and v.station_id in
-        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
-          #{stationId}
-        </foreach>
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="operator!=null and operator!=''">
         and t.check_user like concat('%', #{operator}, '%')
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="operationDate!=null">
         and t.check_date=#{operationDate}
       </if>
@@ -587,25 +546,10 @@
     FROM bus_jcb_dmcgyq t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      t.del_flag='0'
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="operator!=null and operator!=''">
         and t.check_user like concat('%', #{operator}, '%')
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="operationDate!=null">
         and t.check_date=#{operationDate}
       </if>

+ 36 - 88
railway-business/src/main/resources/mapper/catenary/BusJcbFdfxjyqMapper.xml

@@ -505,6 +505,37 @@
 
   </select>
 
+  <sql id="queryParam">
+    t.del_flag='0'
+    <if test="deptId!=null and deptId!=''">
+      and v.dept_id=#{deptId}
+    </if>
+    <if test="deptIds!=null and deptIds.size() > 0">
+      and v.dept_id in
+      <foreach collection="deptIds" item="deptId" index="i" open="(" separator="," close=")">
+        #{deptId}
+      </foreach>
+    </if>
+    <if test="stationId!=null and stationId!=''">
+      and v.station_id=#{stationId}
+    </if>
+    <if test="stationIds!=null and stationIds.size() > 0">
+      and v.station_id in
+      <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
+        #{stationId}
+      </foreach>
+    </if>
+    <if test="submitState!=null and submitState!=''">
+      and t.submit_state <![CDATA[ >= ]]> #{submitState}
+    </if>
+    <if test="pillarCode!=null and pillarCode!=''">
+      and t.pillar_code=#{pillarCode}
+    </if>
+    <if test="createBy!=null and createBy!=''">
+      and t.create_by=#{createBy}
+    </if>
+  </sql>
+
   <select id="getList" resultMap="BaseResultMap">
     SELECT
     <include refid="Base_Column_List"/>
@@ -513,31 +544,11 @@
     left join base_fdfxjyq b on t.fdfxjyq_id = b.id
     LEFT JOIN v_station v on b.dept_station_id = v.dept_station_id
     <where>
-      and t.del_flag='0' and b.del_flag='0'
+      <include refid="queryParam"/>
+      and b.del_flag='0'
       <if test="fdfxjyqId!=null and fdfxjyqId!=''">
         and t.fdfxjyq_id=#{fdfxjyqId}
       </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="deptIds!=null and deptIds.size() > 0">
-        and v.dept_id in
-        <foreach collection="deptIds" item="deptId" index="i" open="(" separator="," close=")">
-          #{deptId}
-        </foreach>
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="stationIds!=null and stationIds.size() > 0">
-        and v.station_id in
-        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
-          #{stationId}
-        </foreach>
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
       <if test="fdh!=null and fdh!=''">
         and t.fdh=#{fdh}
       </if>
@@ -643,9 +654,6 @@
       <if test="czwt!=null and czwt!=''">
         and t.czwt=#{czwt}
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="createTime!=null">
         and DATE_FORMAT(t.create_time, '%Y-%m-%d') = #{createTime}
       </if>
@@ -655,9 +663,6 @@
       <if test="updateTime!=null">
         and DATE_FORMAT(t.update_time, '%Y-%m-%d') = #{updateTime}
       </if>
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
       <if test="delFlag!=null and delFlag!=''">
         and t.del_flag=#{delFlag}
       </if>
@@ -728,31 +733,10 @@
     left join base_fdfxjyq b on t.fdfxjyq_id = b.id
     LEFT JOIN v_station v on b.dept_station_id = v.dept_station_id
     <where>
-      t.del_flag='0'
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="stationIds!=null and stationIds.length > 0">
-        and v.station_id in
-        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
-          #{stationId}
-        </foreach>
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="operator!=null and operator!=''">
         and t.check_user like concat('%', #{operator}, '%')
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="operationDate!=null">
         and t.check_date=#{operationDate}
       </if>
@@ -773,25 +757,10 @@
     FROM bus_jcb_fdfxjyq t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      t.del_flag='0'
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="operator!=null and operator!=''">
         and t.check_user like concat('%', #{operator}, '%')
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="operationDate!=null">
         and t.check_date=#{operationDate}
       </if>
@@ -808,31 +777,10 @@
     FROM bus_jcb_fdfxjyq t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      t.del_flag='0'
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="stationIds!=null and stationIds.length > 0">
-        and v.station_id in
-        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
-          #{stationId}
-        </foreach>
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="operator!=null and operator!=''">
         and t.check_user like concat('%', #{operator}, '%')
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="operationDate!=null">
         and t.check_date=#{operationDate}
       </if>

+ 35 - 88
railway-business/src/main/resources/mapper/catenary/BusJcbGlkgMapper.xml

@@ -713,6 +713,37 @@
     AND t.id = #{id}
   </select>
 
+  <sql id="queryParam">
+    t.del_flag='0'
+    <if test="deptId!=null and deptId!=''">
+      and v.dept_id=#{deptId}
+    </if>
+    <if test="deptIds!=null and deptIds.size() > 0">
+      and v.dept_id in
+      <foreach collection="deptIds" item="deptId" index="i" open="(" separator="," close=")">
+        #{deptId}
+      </foreach>
+    </if>
+    <if test="stationId!=null and stationId!=''">
+      and v.station_id=#{stationId}
+    </if>
+    <if test="stationIds!=null and stationIds.size() > 0">
+      and v.station_id in
+      <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
+        #{stationId}
+      </foreach>
+    </if>
+    <if test="submitState!=null and submitState!=''">
+      and t.submit_state <![CDATA[ >= ]]> #{submitState}
+    </if>
+    <if test="pillarCode!=null and pillarCode!=''">
+      and t.pillar_code=#{pillarCode}
+    </if>
+    <if test="createBy!=null and createBy!=''">
+      and t.create_by=#{createBy}
+    </if>
+  </sql>
+
   <select id="getList" resultMap="BaseResultMap">
     SELECT
     <include refid="Base_Column_List"/>
@@ -720,31 +751,10 @@
     bus_jcb_glkg t
     LEFT JOIN  v_station v ON t.dept_station_id = v.dept_station_id
     <where>
-      t.del_flag = '0'
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="deptIds!=null and deptIds.size() > 0">
-        and v.dept_id in
-        <foreach collection="deptIds" item="deptId" index="i" open="(" separator="," close=")">
-          #{deptId}
-        </foreach>
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="stationIds!=null and stationIds.size() > 0">
-        and v.station_id in
-        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
-          #{stationId}
-        </foreach>
-      </if>
+      <include refid="queryParam"/>
       <if test="xingbie!=null and xingbie!=''">
         and t.xingbie=#{xingbie}
       </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
       <if test="kgbh!=null and kgbh!=''">
         and t.kgbh=#{kgbh}
       </if>
@@ -934,9 +944,6 @@
       <if test="czwt!=null and czwt!=''">
         and t.czwt=#{czwt}
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="createTime!=null">
         and DATE_FORMAT(t.create_time, '%Y-%m-%d') = #{createTime}
       </if>
@@ -946,9 +953,6 @@
       <if test="updateTime!=null">
         and DATE_FORMAT(t.update_time, '%Y-%m-%d') = #{updateTime}
       </if>
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
       <if test="delFlag!=null and delFlag!=''">
         and t.del_flag=#{delFlag}
       </if>
@@ -997,31 +1001,10 @@
     LEFT JOIN  v_station v ON t.dept_station_id = v.dept_station_id
     LEFT JOIN  base_glkg bg ON (t.dept_station_id = bg.dept_station_id and t.kgbh = bg.kgbh)
     <where>
-      t.del_flag='0'
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="stationIds!=null and stationIds.length > 0">
-        and v.station_id in
-        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
-          #{stationId}
-        </foreach>
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="operator!=null and operator!=''">
         and t.check_user like concat('%', #{operator}, '%')
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="operationDate!=null">
         and t.check_date=#{operationDate}
       </if>
@@ -1042,31 +1025,10 @@
     FROM bus_jcb_glkg t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      t.del_flag='0'
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="stationIds!=null and stationIds.length > 0">
-        and v.station_id in
-        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
-          #{stationId}
-        </foreach>
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="operator!=null and operator!=''">
         and t.check_user like concat('%', #{operator}, '%')
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="operationDate!=null">
         and t.check_date=#{operationDate}
       </if>
@@ -1083,25 +1045,10 @@
     FROM bus_jcb_glkg t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      t.del_flag='0'
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="operator!=null and operator!=''">
         and t.check_user like concat('%', #{operator}, '%')
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="operationDate!=null">
         and t.check_date=#{operationDate}
       </if>

+ 35 - 88
railway-business/src/main/resources/mapper/catenary/BusJcbJcxcMapper.xml

@@ -490,34 +490,44 @@
 
   </select>
 
+  <sql id="queryParam">
+    t.del_flag='0'
+    <if test="deptId!=null and deptId!=''">
+      and v.dept_id=#{deptId}
+    </if>
+    <if test="deptIds!=null and deptIds.size() > 0">
+      and v.dept_id in
+      <foreach collection="deptIds" item="deptId" index="i" open="(" separator="," close=")">
+        #{deptId}
+      </foreach>
+    </if>
+    <if test="stationId!=null and stationId!=''">
+      and v.station_id=#{stationId}
+    </if>
+    <if test="stationIds!=null and stationIds.size() > 0">
+      and v.station_id in
+      <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
+        #{stationId}
+      </foreach>
+    </if>
+    <if test="submitState!=null and submitState!=''">
+      and t.submit_state <![CDATA[ >= ]]> #{submitState}
+    </if>
+    <if test="pillarCode!=null and pillarCode!=''">
+      and t.pillar_code=#{pillarCode}
+    </if>
+    <if test="createBy!=null and createBy!=''">
+      and t.create_by=#{createBy}
+    </if>
+  </sql>
+
   <select id="getList" resultMap="BaseResultMap">
     SELECT
     <include refid="Base_Column_List"/>
     FROM bus_jcb_jcxc t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      t.del_flag='0'
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="deptIds!=null and deptIds.size() > 0">
-        and v.dept_id in
-        <foreach collection="deptIds" item="deptId" index="i" open="(" separator="," close=")">
-          #{deptId}
-        </foreach>
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="stationIds!=null and stationIds.size() > 0">
-        and v.station_id in
-        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
-          #{stationId}
-        </foreach>
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="xch!=null and xch!=''">
         and t.xch=#{xch}
       </if>
@@ -632,12 +642,6 @@
       <if test="czwt!=null and czwt!=''">
         and t.czwt=#{czwt}
       </if>
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="createTime!=null">
         and DATE_FORMAT(t.create_time, '%Y-%m-%d') = #{createTime}
       </if>
@@ -670,31 +674,10 @@
     FROM bus_jcb_jcxc t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      t.del_flag='0'
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="stationIds!=null and stationIds.length > 0">
-        and v.station_id in
-        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
-          #{stationId}
-        </foreach>
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="operator!=null and operator!=''">
         and t.check_user like concat('%', #{operator}, '%')
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="operationDate!=null">
         and t.check_date=#{operationDate}
       </if>
@@ -715,31 +698,10 @@
     FROM bus_jcb_jcxc t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      t.del_flag='0'
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="stationIds!=null and stationIds.length > 0">
-        and v.station_id in
-        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
-          #{stationId}
-        </foreach>
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="operator!=null and operator!=''">
         and t.check_user like concat('%', #{operator}, '%')
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="operationDate!=null">
         and t.check_date=#{operationDate}
       </if>
@@ -756,25 +718,10 @@
     FROM bus_jcb_jcxc t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      t.del_flag='0'
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="operator!=null and operator!=''">
         and t.check_user like concat('%', #{operator}, '%')
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="operationDate!=null">
         and t.check_date=#{operationDate}
       </if>

+ 35 - 88
railway-business/src/main/resources/mapper/catenary/BusJcbWjcxcMapper.xml

@@ -473,34 +473,44 @@
 
   </select>
 
+  <sql id="queryParam">
+    t.del_flag='0'
+    <if test="deptId!=null and deptId!=''">
+      and v.dept_id=#{deptId}
+    </if>
+    <if test="deptIds!=null and deptIds.size() > 0">
+      and v.dept_id in
+      <foreach collection="deptIds" item="deptId" index="i" open="(" separator="," close=")">
+        #{deptId}
+      </foreach>
+    </if>
+    <if test="stationId!=null and stationId!=''">
+      and v.station_id=#{stationId}
+    </if>
+    <if test="stationIds!=null and stationIds.size() > 0">
+      and v.station_id in
+      <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
+        #{stationId}
+      </foreach>
+    </if>
+    <if test="submitState!=null and submitState!=''">
+      and t.submit_state <![CDATA[ >= ]]> #{submitState}
+    </if>
+    <if test="pillarCode!=null and pillarCode!=''">
+      and t.pillar_code=#{pillarCode}
+    </if>
+    <if test="createBy!=null and createBy!=''">
+      and t.create_by=#{createBy}
+    </if>
+  </sql>
+
   <select id="getList" resultMap="BaseResultMap">
     SELECT
     <include refid="Base_Column_List"/>
     FROM bus_jcb_wjcxc t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      t.del_flag='0'
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="deptIds!=null and deptIds.size() > 0">
-        and v.dept_id in
-        <foreach collection="deptIds" item="deptId" index="i" open="(" separator="," close=")">
-          #{deptId}
-        </foreach>
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="stationIds!=null and stationIds.size() > 0">
-        and v.station_id in
-        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
-          #{stationId}
-        </foreach>
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="xch!=null and xch!=''">
         and t.xch=#{xch}
       </if>
@@ -606,12 +616,6 @@
       <if test="czwt!=null and czwt!=''">
         and t.czwt=#{czwt}
       </if>
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="createTime!=null">
         and DATE_FORMAT(t.create_time, '%Y-%m-%d') = #{createTime}
       </if>
@@ -647,31 +651,10 @@
     FROM bus_jcb_wjcxc t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      t.del_flag='0'
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="stationIds!=null and stationIds.length > 0">
-        and v.station_id in
-        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
-          #{stationId}
-        </foreach>
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="operator!=null and operator!=''">
         and t.check_user like concat('%', #{operator}, '%')
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="operationDate!=null">
         and t.check_date=#{operationDate}
       </if>
@@ -692,31 +675,10 @@
     FROM bus_jcb_wjcxc t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      t.del_flag='0'
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="stationIds!=null and stationIds.length > 0">
-        and v.station_id in
-        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
-          #{stationId}
-        </foreach>
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="operator!=null and operator!=''">
         and t.check_user like concat('%', #{operator}, '%')
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="operationDate!=null">
         and t.check_date=#{operationDate}
       </if>
@@ -733,25 +695,10 @@
     FROM bus_jcb_wjcxc t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      t.del_flag='0'
-      <if test="submitState!=null and submitState!=''">
-        and t.submit_state <![CDATA[ >= ]]> #{submitState}
-      </if>
-      <if test="deptId!=null and deptId!=''">
-        and v.dept_id=#{deptId}
-      </if>
-      <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
-      </if>
-      <if test="pillarCode!=null and pillarCode!=''">
-        and t.pillar_code=#{pillarCode}
-      </if>
+      <include refid="queryParam"/>
       <if test="operator!=null and operator!=''">
         and t.check_user like concat('%', #{operator}, '%')
       </if>
-      <if test="createBy!=null and createBy!=''">
-        and t.create_by=#{createBy}
-      </if>
       <if test="operationDate!=null">
         and t.check_date=#{operationDate}
       </if>