Ver código fonte

【CHG】修改地面感应器反查SQL

ZhaoMn 4 anos atrás
pai
commit
a1250eeba7

+ 1 - 1
railway-business/src/main/java/com/railway/business/baseinfo/domain/BusJcxc.java

@@ -48,7 +48,7 @@ public class BusJcxc extends BaseEntity{
 
     @ApiModelProperty(value = "支柱范围")
     @Length(min = 1, max = 50, message = "【支柱号】长度必须介于 {min} 和 {max} 之间")
-    private String pillarArea;
+    private String pillarCode;
 
     @ApiModelProperty(value = "股道")
     @Length( max = 100, message = "【股道】长度必须介于 {min} 和 {max} 之间")

+ 3 - 0
railway-business/src/main/java/com/railway/business/catenary/domain/BusJcbDmcgyq.java

@@ -41,6 +41,9 @@ public class BusJcbDmcgyq extends BaseEntity{
     @ApiModelProperty(value = "车间-区间站场关联id")
     private Long deptStationId;
 
+    @ApiModelProperty(value = "感应器id")
+    private Long gyqId;
+
     @ApiModelProperty(value = "分相")
     @Length(min = 1, max = 100, message = "【分相】长度必须介于 {min} 和 {max} 之间")
     private String fenxiang;

+ 9 - 9
railway-business/src/main/resources/mapper/baseinfo/BusJcxcMapper.xml

@@ -15,7 +15,7 @@
     <result column="xingbie" property="xingbie"/>
     <result column="xingbie_text" property="xingbieText"/>
     <result column="xclx_text" property="xclxText"/>
-    <result column="pillar_area" property="pillarArea"/>
+    <result column="pillar_code" property="pillarCode"/>
     <result column="marker" property="marker"/>
     <result column="station_track" property="stationTrack"/>
     <result column="gxms" property="gxms"/>
@@ -42,7 +42,7 @@
     v.station_id,
     t.dept_station_id,
     t.xingbie,
-    t.pillar_area,
+    t.pillar_code,
     t.marker,
     t.station_track,
     t.gxms,
@@ -71,8 +71,8 @@
       <if test='null != xingbie'>
         xingbie,
       </if>
-      <if test='null != pillarArea'>
-        pillar_area,
+      <if test='null != pillarCode'>
+        pillar_code,
       </if>
       <if test='null != stationTrack'>
         station_track,
@@ -118,8 +118,8 @@
       <if test='null != xingbie'>
         #{xingbie},
       </if>
-      <if test='null != pillarArea'>
-        #{pillarArea},
+      <if test='null != pillarCode'>
+        #{pillarCode},
       </if>
       <if test='null != stationTrack'>
         #{stationTrack},
@@ -171,7 +171,7 @@
     <set>
       <if test='null != deptStationId'>dept_station_id = #{deptStationId},</if>
       <if test='null != xingbie'>xingbie = #{xingbie},</if>
-      <if test='null != pillarArea'>pillar_area = #{pillarArea},</if>
+      <if test='null != pillarCode'>pillar_code = #{pillarCode},</if>
       <if test='null != marker'>marker = #{marker},</if>
       <if test='null != stationTrack'>station_track = #{stationTrack},</if>
       <if test='null != gxms'>gxms = #{gxms},</if>
@@ -223,8 +223,8 @@
       <if test="xingbie!=null and xingbie!=''">
         and t.xingbie=#{xingbie}
       </if>
-      <if test="pillarArea!=null and pillarArea!=''">
-        and t.pillar_area=#{pillarArea}
+      <if test="pillarCode!=null and pillarCode!=''">
+        and t.pillar_code=#{pillarCode}
       </if>
       <if test="marker!=null and marker!=''">
         and t.marker=#{marker}

+ 10 - 1
railway-business/src/main/resources/mapper/catenary/BusJcbDmcgyqMapper.xml

@@ -5,6 +5,7 @@
 
   <resultMap id="BaseResultMap" type="com.railway.business.catenary.domain.BusJcbDmcgyq">
     <result column="id" property="id"/>
+    <result column="gyq_id" property="gyqId"/>
     <result column="dept_id" property="deptId"/>
     <result column="dept_name" property="deptName"/>
     <result column="station_id" property="stationId"/>
@@ -44,7 +45,8 @@
   </resultMap>
 
   <sql id="Base_Column_List">
-    id,
+    t.id,
+    t.gyq_id,
     v.dept_id,
     v.dept_name,
     v.station_name as station_name,
@@ -85,6 +87,9 @@
   <insert id="insert" parameterType="com.railway.business.catenary.domain.BusJcbDmcgyq">
     INSERT INTO bus_jcb_dmcgyq
     <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test='null != gyqId'>
+        gyq_id,
+      </if>
       <if test='null != deptStationId'>
         dept_station_id,
       </if>
@@ -177,6 +182,9 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test='null != gyqId'>
+        #{gyqId},
+      </if>
       <if test='null != deptStationId'>
         #{deptStationId},
       </if>
@@ -279,6 +287,7 @@
   <update id="update" parameterType="com.railway.business.catenary.domain.BusJcbDmcgyq">
     UPDATE bus_jcb_dmcgyq
     <set>
+      <if test='null != gyqId'>dept_station_id = #{gyqId},</if>
       <if test='null != deptStationId'>dept_station_id = #{deptStationId},</if>
       <if test='null != fenxiang'>fenxiang = #{fenxiang},</if>
       <if test='null != xingbie'>xingbie = #{xingbie},</if>

+ 19 - 7
railway-business/src/main/resources/mapper/catenary/BusJcbJcxcMapper.xml

@@ -65,8 +65,8 @@
     v.dept_name,
     v.station_name,
     v.station_id,
-    t1.dept_station_id,
-    t1.pillar_area pillar_code,
+    t.dept_station_id,
+    t.pillar_code,
     t.xch,
     t.temperature,
     t.check_date,
@@ -116,6 +116,12 @@
   <insert id="insert" parameterType="com.railway.business.catenary.domain.BusJcbJcxc">
     INSERT INTO bus_jcb_jcxc
     <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test='null != deptStationId'>
+        dept_station_id,
+      </if>
+      <if test='null != pillarCode'>
+        pillar_code,
+      </if>
       <if test='null != xcId'>
         xc_id,
       </if>
@@ -250,6 +256,12 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test='null != deptStationId'>
+        #{deptStationId},
+      </if>
+      <if test='null != pillarCode'>
+        #{pillarCode},
+      </if>
       <if test='null != xcId'>
         #{xcId},
       </if>
@@ -394,6 +406,8 @@
   <update id="update" parameterType="com.railway.business.catenary.domain.BusJcbJcxc">
     UPDATE bus_jcb_jcxc
     <set>
+      <if test='null != deptStationId'>dept_station_id = #{deptStationId},</if>
+      <if test='null != pillarCode'>pillar_code = #{pillarCode},</if>
       <if test='null != xch'>xc_id = #{xcId},</if>
       <if test='null != xch'>xch = #{xch},</if>
       <if test='null != temperature'>temperature = #{temperature},</if>
@@ -445,8 +459,7 @@
     SELECT
     <include refid="Base_Column_List"/>
     FROM bus_jcb_jcxc t
-    LEFT JOIN base_jcxc t1 on t.xc_id = t1.id
-    LEFT JOIN v_station v on t1.dept_station_id = v.dept_station_id
+    LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     WHERE t.del_flag='0' and t.id = #{id}
 
   </select>
@@ -469,15 +482,14 @@
     SELECT
     <include refid="Base_Column_List"/>
     FROM bus_jcb_jcxc t
-    LEFT JOIN base_jcxc t1 on t.xc_id = t1.id
-    LEFT JOIN v_station v on t1.dept_station_id = v.dept_station_id
+    LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
       t.del_flag='0'
       <if test="stationId!=null and stationId!=''">
         and v.station_id=#{stationId}
       </if>
       <if test="pillarCode!=null and pillarCode!=''">
-        and t1.pillar_code=#{pillarCode}
+        and t.pillar_code=#{pillarCode}
       </if>
       <if test="xch!=null and xch!=''">
         and t.xch=#{xch}

+ 19 - 7
railway-business/src/main/resources/mapper/catenary/BusJcbWjcxcMapper.xml

@@ -59,8 +59,8 @@
     v.dept_name,
     v.station_name,
     v.station_id,
-    t1.dept_station_id,
-    t1.pillar_area pillar_code,
+    t.dept_station_id,
+    t.pillar_code,
     t.xch,
     t.temperature,
     t.check_date,
@@ -104,6 +104,12 @@
   <insert id="insert" parameterType="com.railway.business.catenary.domain.BusJcbWjcxc">
     INSERT INTO bus_jcb_wjcxc
     <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test='null != deptStationId'>
+        dept_station_id,
+      </if>
+      <if test='null != pillarCode'>
+        pillar_code,
+      </if>
       <if test='null != xcId'>
         xc_id,
       </if>
@@ -220,6 +226,12 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test='null != deptStationId'>
+        #{deptStationId},
+      </if>
+      <if test='null != pillarCode'>
+        #{pillarCode},
+      </if>
       <if test='null != xcId'>
         #{xcId},
       </if>
@@ -346,6 +358,8 @@
   <update id="update" parameterType="com.railway.business.catenary.domain.BusJcbWjcxc">
     UPDATE bus_jcb_wjcxc
     <set>
+      <if test='null != deptStationId'>dept_station_id = #{deptStationId},</if>
+      <if test='null != pillarCode'>pillar_code = #{pillarCode},</if>
       <if test='null != xch'>xc_id = #{xcId},</if>
       <if test='null != xch'>xch = #{xch},</if>
       <if test='null != temperature'>temperature = #{temperature},</if>
@@ -391,8 +405,7 @@
     SELECT
     <include refid="Base_Column_List"/>
     FROM bus_jcb_wjcxc t
-    LEFT JOIN base_jcxc t1 on t.xc_id = t1.id
-    LEFT JOIN v_station v on t1.dept_station_id = v.dept_station_id
+    LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     WHERE t.del_flag='0' and t.id = #{id}
 
   </select>
@@ -416,15 +429,14 @@
     SELECT
     <include refid="Base_Column_List"/>
     FROM bus_jcb_wjcxc t
-    LEFT JOIN base_jcxc t1 on t.xc_id = t1.id
-    LEFT JOIN v_station v on t1.dept_station_id = v.dept_station_id
+    LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
     <where>
       t.del_flag='0'
       <if test="stationId!=null and stationId!=''">
         and v.station_id=#{stationId}
       </if>
       <if test="pillarCode!=null and pillarCode!=''">
-        and t1.pillar_code=#{pillarCode}
+        and t.pillar_code=#{pillarCode}
       </if>
       <if test="xch!=null and xch!=''">
         and t.xch=#{xch}