瀏覽代碼

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

ZhaoMn 3 年之前
父節點
當前提交
2faf61d6f4

+ 2 - 0
railway-business/src/main/java/com/railway/business/catenary/domain/vo/JcebQueryVo.java

@@ -25,6 +25,8 @@ public class JcebQueryVo implements Serializable {
   @ApiModelProperty(value = "车间id")
   private Long deptId;
 
+  private Long[] deptIds;
+
   @ApiModelProperty(value = "区间站场id")
   private Long stationId;
 

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

@@ -358,38 +358,8 @@
     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>
 
   <select id="getList" resultMap="BaseResultMap">
     SELECT
@@ -399,10 +369,31 @@
     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>
-      <include refid="queryParam"/>
+      t.del_flag='0'
       <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>
@@ -478,12 +469,21 @@
       <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,10 +534,31 @@
     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>
-      <include refid="queryParam"/>
+      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>
       <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>
@@ -599,10 +620,25 @@
     FROM bus_jcb_blq t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      <include refid="queryParam"/>
+      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>
       <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>

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

@@ -336,6 +336,7 @@
     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">
@@ -347,6 +348,7 @@
     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">
@@ -360,38 +362,8 @@
     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>
 
   <select id="getList" resultMap="BaseResultMap">
     SELECT
@@ -400,13 +372,34 @@
     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>
-      <include refid="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="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>
@@ -467,6 +460,12 @@
       <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>
@@ -502,10 +501,31 @@
     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>
-      <include refid="queryParam"/>
+      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>
       <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>
@@ -526,10 +546,31 @@
     FROM bus_jcb_dmcgyq t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      <include refid="queryParam"/>
+      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>
       <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,10 +587,25 @@
     FROM bus_jcb_dmcgyq t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      <include refid="queryParam"/>
+      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>
       <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>

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

@@ -505,37 +505,6 @@
 
   </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"/>
@@ -544,11 +513,31 @@
     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>
-      <include refid="queryParam"/>
-      and b.del_flag='0'
+      and t.del_flag='0' 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>
@@ -654,6 +643,9 @@
       <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>
@@ -663,6 +655,9 @@
       <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>
@@ -733,10 +728,31 @@
     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>
-      <include refid="queryParam"/>
+      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>
       <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>
@@ -757,10 +773,25 @@
     FROM bus_jcb_fdfxjyq t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      <include refid="queryParam"/>
+      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>
       <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>
@@ -777,10 +808,31 @@
     FROM bus_jcb_fdfxjyq t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      <include refid="queryParam"/>
+      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>
       <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>

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

@@ -713,37 +713,6 @@
     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"/>
@@ -751,10 +720,31 @@
     bus_jcb_glkg t
     LEFT JOIN  v_station v ON t.dept_station_id = v.dept_station_id
     <where>
-      <include refid="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="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>
@@ -944,6 +934,9 @@
       <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>
@@ -953,6 +946,9 @@
       <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>
@@ -1001,10 +997,31 @@
     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>
-      <include refid="queryParam"/>
+      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>
       <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>
@@ -1025,10 +1042,31 @@
     FROM bus_jcb_glkg t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      <include refid="queryParam"/>
+      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>
       <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>
@@ -1045,10 +1083,25 @@
     FROM bus_jcb_glkg t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      <include refid="queryParam"/>
+      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>
       <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>

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

@@ -490,44 +490,34 @@
 
   </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>
-      <include refid="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="pillarCode!=null and pillarCode!=''">
+        and t.pillar_code=#{pillarCode}
+      </if>
       <if test="xch!=null and xch!=''">
         and t.xch=#{xch}
       </if>
@@ -642,6 +632,12 @@
       <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>
@@ -674,10 +670,31 @@
     FROM bus_jcb_jcxc t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      <include refid="queryParam"/>
+      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>
       <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>
@@ -698,10 +715,31 @@
     FROM bus_jcb_jcxc t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      <include refid="queryParam"/>
+      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>
       <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>
@@ -718,10 +756,25 @@
     FROM bus_jcb_jcxc t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      <include refid="queryParam"/>
+      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>
       <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>

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

@@ -473,44 +473,34 @@
 
   </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>
-      <include refid="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="pillarCode!=null and pillarCode!=''">
+        and t.pillar_code=#{pillarCode}
+      </if>
       <if test="xch!=null and xch!=''">
         and t.xch=#{xch}
       </if>
@@ -616,6 +606,12 @@
       <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>
@@ -651,10 +647,31 @@
     FROM bus_jcb_wjcxc t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      <include refid="queryParam"/>
+      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>
       <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>
@@ -675,10 +692,31 @@
     FROM bus_jcb_wjcxc t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      <include refid="queryParam"/>
+      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>
       <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>
@@ -695,10 +733,25 @@
     FROM bus_jcb_wjcxc t
     LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
-      <include refid="queryParam"/>
+      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>
       <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>