Kaynağa Gözat

【CHG】改进检查表-隔离开关查询。

fenghao 4 yıl önce
ebeveyn
işleme
a0703aef0a

+ 90 - 97
railway-business/src/main/resources/mapper/catenary/BusJcbGlkgMapper.xml

@@ -656,272 +656,265 @@
   <select id="getInfo" resultMap="BaseResultMap">
     SELECT
     distinct
-    s.station_name,
-    a.*, dict.dict_label as xingbie_text
+    <include refid="Base_Column_List"></include>
     FROM
-    bus_jcb_glkg a
-    LEFT JOIN base_station s ON a.station_id = s.station_id
-    LEFT JOIN sys_dict_data dict ON (a.xingbie = dict.dict_value AND dict.dict_type = 'xingbie')
+    bus_jcb_glkg t
+    LEFT JOIN  v_station v ON t.station_id = v.dept_station_id
     WHERE
-    a.del_flag = '0'
-    AND s.del_flag = '0'
-    AND a.id = #{id}
+    t.del_flag = '0'
+    AND t.id = #{id}
   </select>
 
   <select id="getList" resultMap="BaseResultMap">
     SELECT
-    s.station_name,
-    a.*, dict.dict_label as xingbie_text
+    <include refid="Base_Column_List"></include>
     FROM
-    bus_jcb_glkg a
-    LEFT JOIN base_station s ON a.station_id = s.station_id
-    LEFT JOIN sys_dict_data dict ON (a.xingbie = dict.dict_value AND dict.dict_type = 'xingbie')
+    bus_jcb_glkg t
+    LEFT JOIN  v_station v ON t.station_id = v.dept_station_id
     <where>
-      a.del_flag = '0'
-      AND s.del_flag = '0'
+      t.del_flag = '0'
       <if test="deptId!=null and deptId!=''">
-        and a.dept_id=#{deptId}
+        and t.dept_id=#{deptId}
       </if>
       <if test="deptName!=null and deptName!=''">
-        and a.dept_name=#{deptName}
+        and t.dept_name=#{deptName}
       </if>
       <if test="lineId!=null and lineId!=''">
-        and a.line_id=#{lineId}
+        and t.line_id=#{lineId}
       </if>
       <if test="lineName!=null and lineName!=''">
-        and a.line_name=#{lineName}
+        and t.line_name=#{lineName}
       </if>
       <if test="stationId!=null and stationId!=''">
-        and a.station_id=#{stationId}
+        and t.station_id=#{stationId}
       </if>
       <if test="stationName!=null and stationName!=''">
-        and a.station_name=#{stationName}
+        and t.station_name=#{stationName}
       </if>
       <if test="xingbie!=null and xingbie!=''">
-        and a.xingbie=#{xingbie}
+        and t.xingbie=#{xingbie}
       </if>
       <if test="pillarCode!=null and pillarCode!=''">
-        and a.pillar_code=#{pillarCode}
+        and t.pillar_code=#{pillarCode}
       </if>
       <if test="kgh!=null and kgh!=''">
-        and a.kgh=#{kgh}
+        and t.kgh=#{kgh}
       </if>
       <if test="temperature!=null and temperature!=''">
-        and a.temperature=#{temperature}
+        and t.temperature=#{temperature}
       </if>
       <if test="checkDate!=null and checkDate!=''">
-        and a.check_date=#{checkDate}
+        and t.check_date=#{checkDate}
       </if>
       <if test="jgxA!=null and jgxA!=''">
-        and a.jgx_a=#{jgxA}
+        and t.jgx_a=#{jgxA}
       </if>
       <if test="jgxADesc!=null and jgxADesc!=''">
-        and a.jgx_a_desc=#{jgxADesc}
+        and t.jgx_a_desc=#{jgxADesc}
       </if>
       <if test="jgxB!=null and jgxB!=''">
-        and a.jgx_b=#{jgxB}
+        and t.jgx_b=#{jgxB}
       </if>
       <if test="jgxBDesc!=null and jgxBDesc!=''">
-        and a.jgx_b_desc=#{jgxBDesc}
+        and t.jgx_b_desc=#{jgxBDesc}
       </if>
       <if test="jgxC!=null and jgxC!=''">
-        and a.jgx_c=#{jgxC}
+        and t.jgx_c=#{jgxC}
       </if>
       <if test="jgxCDesc!=null and jgxCDesc!=''">
-        and a.jgx_c_desc=#{jgxCDesc}
+        and t.jgx_c_desc=#{jgxCDesc}
       </if>
       <if test="qdzzA!=null and qdzzA!=''">
-        and a.qdzz_a=#{qdzzA}
+        and t.qdzz_a=#{qdzzA}
       </if>
       <if test="qdzzADesc!=null and qdzzADesc!=''">
-        and a.qdzz_a_desc=#{qdzzADesc}
+        and t.qdzz_a_desc=#{qdzzADesc}
       </if>
       <if test="cdgA!=null and cdgA!=''">
-        and a.cdg_a=#{cdgA}
+        and t.cdg_a=#{cdgA}
       </if>
       <if test="cdgADesc!=null and cdgADesc!=''">
-        and a.cdg_a_desc=#{cdgADesc}
+        and t.cdg_a_desc=#{cdgADesc}
       </if>
       <if test="cdgB!=null and cdgB!=''">
-        and a.cdg_b=#{cdgB}
+        and t.cdg_b=#{cdgB}
       </if>
       <if test="cdgBDesc!=null and cdgBDesc!=''">
-        and a.cdg_b_desc=#{cdgBDesc}
+        and t.cdg_b_desc=#{cdgBDesc}
       </if>
       <if test="cdgC!=null and cdgC!=''">
-        and a.cdg_c=#{cdgC}
+        and t.cdg_c=#{cdgC}
       </if>
       <if test="cdgCDesc!=null and cdgCDesc!=''">
-        and a.cdg_c_desc=#{cdgCDesc}
+        and t.cdg_c_desc=#{cdgCDesc}
       </if>
       <if test="gbA!=null and gbA!=''">
-        and a.gb_a=#{gbA}
+        and t.gb_a=#{gbA}
       </if>
       <if test="gbADesc!=null and gbADesc!=''">
-        and a.gb_a_desc=#{gbADesc}
+        and t.gb_a_desc=#{gbADesc}
       </if>
       <if test="ctztA!=null and ctztA!=''">
-        and a.ctzt_a=#{ctztA}
+        and t.ctzt_a=#{ctztA}
       </if>
       <if test="ctztADesc!=null and ctztADesc!=''">
-        and a.ctzt_a_desc=#{ctztADesc}
+        and t.ctzt_a_desc=#{ctztADesc}
       </if>
       <if test="ctmtztA!=null and ctmtztA!=''">
-        and a.ctmtzt_a=#{ctmtztA}
+        and t.ctmtzt_a=#{ctmtztA}
       </if>
       <if test="ctmtztADesc!=null and ctmtztADesc!=''">
-        and a.ctmtzt_a_desc=#{ctmtztADesc}
+        and t.ctmtzt_a_desc=#{ctmtztADesc}
       </if>
       <if test="hjkztA!=null and hjkztA!=''">
-        and a.hjkzt_a=#{hjkztA}
+        and t.hjkzt_a=#{hjkztA}
       </if>
       <if test="hjkztADesc!=null and hjkztADesc!=''">
-        and a.hjkzt_a_desc=#{hjkztADesc}
+        and t.hjkzt_a_desc=#{hjkztADesc}
       </if>
       <if test="zcjyzztA!=null and zcjyzztA!=''">
-        and a.zcjyzzt_a=#{zcjyzztA}
+        and t.zcjyzzt_a=#{zcjyzztA}
       </if>
       <if test="zcjyzztADesc!=null and zcjyzztADesc!=''">
-        and a.zcjyzzt_a_desc=#{zcjyzztADesc}
+        and t.zcjyzzt_a_desc=#{zcjyzztADesc}
       </if>
       <if test="yxztA!=null and yxztA!=''">
-        and a.yxzt_a=#{yxztA}
+        and t.yxzt_a=#{yxztA}
       </if>
       <if test="yxztADesc!=null and yxztADesc!=''">
-        and a.yxzt_a_desc=#{yxztADesc}
+        and t.yxzt_a_desc=#{yxztADesc}
       </if>
       <if test="yxztB!=null and yxztB!=''">
-        and a.yxzt_b=#{yxztB}
+        and t.yxzt_b=#{yxztB}
       </if>
       <if test="yxztBDesc!=null and yxztBDesc!=''">
-        and a.yxzt_b_desc=#{yxztBDesc}
+        and t.yxzt_b_desc=#{yxztBDesc}
       </if>
       <if test="yxztC!=null and yxztC!=''">
-        and a.yxzt_c=#{yxztC}
+        and t.yxzt_c=#{yxztC}
       </if>
       <if test="yxztCDesc!=null and yxztCDesc!=''">
-        and a.yxzt_c_desc=#{yxztCDesc}
+        and t.yxzt_c_desc=#{yxztCDesc}
       </if>
       <if test="swyx1Lcz!=null and swyx1Lcz!=''">
-        and a.swyx_1_lcz=#{swyx1Lcz}
+        and t.swyx_1_lcz=#{swyx1Lcz}
       </if>
       <if test="swyx1Dg!=null and swyx1Dg!=''">
-        and a.swyx_1_dg=#{swyx1Dg}
+        and t.swyx_1_dg=#{swyx1Dg}
       </if>
       <if test="swyx2Lcz!=null and swyx2Lcz!=''">
-        and a.swyx_2_lcz=#{swyx2Lcz}
+        and t.swyx_2_lcz=#{swyx2Lcz}
       </if>
       <if test="swyx2Dg!=null and swyx2Dg!=''">
-        and a.swyx_2_dg=#{swyx2Dg}
+        and t.swyx_2_dg=#{swyx2Dg}
       </if>
       <if test="zxjl!=null and zxjl!=''">
         and zxjl=#{zxjl}
       </if>
       <if test="xjztA!=null and xjztA!=''">
-        and a.xjzt_a=#{xjztA}
+        and t.xjzt_a=#{xjztA}
       </if>
       <if test="xjztADesc!=null and xjztADesc!=''">
-        and a.xjzt_a_desc=#{xjztADesc}
+        and t.xjzt_a_desc=#{xjztADesc}
       </if>
       <if test="xjztB!=null and xjztB!=''">
-        and a.xjzt_b=#{xjztB}
+        and t.xjzt_b=#{xjztB}
       </if>
       <if test="xjztBDesc!=null and xjztBDesc!=''">
-        and a.xjzt_b_desc=#{xjztBDesc}
+        and t.xjzt_b_desc=#{xjztBDesc}
       </if>
       <if test="sdfhsyA!=null and sdfhsyA!=''">
-        and a.sdfhsy_a=#{sdfhsyA}
+        and t.sdfhsy_a=#{sdfhsyA}
       </if>
       <if test="sdfhsyADesc!=null and sdfhsyADesc!=''">
-        and a.sdfhsy_a_desc=#{sdfhsyADesc}
+        and t.sdfhsy_a_desc=#{sdfhsyADesc}
       </if>
       <if test="ddfhsyA!=null and ddfhsyA!=''">
-        and a.ddfhsy_a=#{ddfhsyA}
+        and t.ddfhsy_a=#{ddfhsyA}
       </if>
       <if test="ddfhsyADesc!=null and ddfhsyADesc!=''">
-        and a.ddfhsy_a_desc=#{ddfhsyADesc}
+        and t.ddfhsy_a_desc=#{ddfhsyADesc}
       </if>
       <if test="ydfhsyA!=null and ydfhsyA!=''">
-        and a.ydfhsy_a=#{ydfhsyA}
+        and t.ydfhsy_a=#{ydfhsyA}
       </if>
       <if test="ydfhsyADesc!=null and ydfhsyADesc!=''">
-        and a.ydfhsy_a_desc=#{ydfhsyADesc}
+        and t.ydfhsy_a_desc=#{ydfhsyADesc}
       </if>
       <if test="kgztjdztA!=null and kgztjdztA!=''">
-        and a.kgztjdzt_a=#{kgztjdztA}
+        and t.kgztjdzt_a=#{kgztjdztA}
       </if>
       <if test="kgztjdztADesc!=null and kgztjdztADesc!=''">
-        and a.kgztjdzt_a_desc=#{kgztjdztADesc}
+        and t.kgztjdzt_a_desc=#{kgztjdztADesc}
       </if>
       <if test="kgztjdztDzz!=null and kgztjdztDzz!=''">
-        and a.kgztjdzt_dzz=#{kgztjdztDzz}
+        and t.kgztjdzt_dzz=#{kgztjdztDzz}
       </if>
       <if test="kgjgxjdztA!=null and kgjgxjdztA!=''">
-        and a.kgjgxjdzt_a=#{kgjgxjdztA}
+        and t.kgjgxjdzt_a=#{kgjgxjdztA}
       </if>
       <if test="kgjgxjdztADesc!=null and kgjgxjdztADesc!=''">
-        and a.kgjgxjdzt_a_desc=#{kgjgxjdztADesc}
+        and t.kgjgxjdzt_a_desc=#{kgjgxjdztADesc}
       </if>
       <if test="kgjgxjdztDzz!=null and kgjgxjdztDzz!=''">
-        and a.kgjgxjdzt_dzz=#{kgjgxjdztDzz}
+        and t.kgjgxjdzt_dzz=#{kgjgxjdztDzz}
       </if>
       <if test="sbzt!=null and sbzt!=''">
-        and a.sbzt=#{sbzt}
+        and t.sbzt=#{sbzt}
       </if>
       <if test="sbztDesc!=null and sbztDesc!=''">
-        and a.sbzt_desc=#{sbztDesc}
+        and t.sbzt_desc=#{sbztDesc}
       </if>
       <if test="checkUser!=null and checkUser!=''">
-        and a.check_user=#{checkUser}
+        and t.check_user=#{checkUser}
       </if>
       <if test="confirmUser!=null and confirmUser!=''">
-        and a.confirm_user=#{confirmUser}
+        and t.confirm_user=#{confirmUser}
       </if>
       <if test="czwt!=null and czwt!=''">
-        and a.czwt=#{czwt}
+        and t.czwt=#{czwt}
       </if>
       <if test="createBy!=null and createBy!=''">
-        and a.create_by=#{createBy}
+        and t.create_by=#{createBy}
       </if>
       <if test="createTime!=null and createTime!=''">
-        and a.create_time=#{createTime}
+        and t.create_time=#{createTime}
       </if>
       <if test="updateBy!=null and updateBy!=''">
-        and a.update_by=#{updateBy}
+        and t.update_by=#{updateBy}
       </if>
       <if test="updateTime!=null and updateTime!=''">
-        and a.update_time=#{updateTime}
+        and t.update_time=#{updateTime}
       </if>
       <if test="submitState!=null and submitState!=''">
-        and a.submit_state=#{submitState}
+        and t.submit_state=#{submitState}
       </if>
       <if test="delFlag!=null and delFlag!=''">
-        and a.del_flag=#{delFlag}
+        and t.del_flag=#{delFlag}
       </if>
     </where>
-    order by str_to_date(a.check_date,'%Y-%m-%d') desc
+    order by str_to_date(t.check_date,'%Y-%m-%d') desc
   </select>
 
   <select id="getLastOne" resultMap="BaseResultMap">
     SELECT
-      s.station_name,
-      a.*
+    <include refid="Base_Column_List"></include>
     FROM
-        bus_jcb_glkg a
-    LEFT JOIN base_station s ON a.station_id = s.station_id
+        bus_jcb_glkg t
+    LEFT JOIN v_station v ON t.station_id = v.dept_station_id
     WHERE
-        a.del_flag = '0' and a.submit_state in ('1','9')
+        t.del_flag = '0' and t.submit_state in ('1','9')
     <if test="stationId!=null and stationId!=''">
-      and a.station_id=#{stationId}
+      and t.station_id=#{stationId}
     </if>
     <if test="pillarCode!=null and pillarCode!=''">
-      and a.pillar_code=#{pillarCode}
+      and t.pillar_code=#{pillarCode}
     </if>
     <if test="kgh!=null and kgh!=''">
-      and a.kgh=#{kgh}
+      and t.kgh=#{kgh}
     </if>
     ORDER BY
-        a.update_time DESC
+        t.update_time DESC
     LIMIT 1
   </select>