فهرست منبع

【CHG】修改线岔反查SQL

ZhaoMn 4 سال پیش
والد
کامیت
d14d5df04d

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

@@ -45,6 +45,9 @@ public class BusJcbJcxc extends BaseEntity{
     @Length(min = 1, max = 50, message = "【支柱号】长度必须介于 {min} 和 {max} 之间")
     private String pillarCode;
 
+    @ApiModelProperty(value = "线岔ID")
+    private Long xcId;
+
     @ApiModelProperty(value = "线岔号")
     private String xch;
 

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

@@ -45,6 +45,9 @@ public class BusJcbWjcxc extends BaseEntity{
     @Length(min = 1, max = 50, message = "【支柱号】长度必须介于 {min} 和 {max} 之间")
     private String pillarCode;
 
+    @ApiModelProperty(value = "线岔ID")
+    private Long xcId;
+
     @ApiModelProperty(value = "线岔号")
     private String xch;
 

+ 11 - 4
railway-business/src/main/resources/mapper/catenary/BusJcbJcxcMapper.xml

@@ -5,6 +5,7 @@
 
   <resultMap id="BaseResultMap" type="com.railway.business.catenary.domain.BusJcbJcxc">
     <result column="id" property="id"/>
+    <result column="xc_id" property="xcId"/>
     <result column="dept_id" property="deptId"/>
     <result column="dept_name" property="deptName"/>
     <result column="station_id" property="stationId"/>
@@ -59,6 +60,7 @@
 
   <sql id="Base_Column_List">
     t.id,
+    t.xc_id,
     v.dept_id,
     v.dept_name,
     v.station_name,
@@ -114,6 +116,9 @@
   <insert id="insert" parameterType="com.railway.business.catenary.domain.BusJcbJcxc">
     INSERT INTO bus_jcb_jcxc
     <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test='null != xcId'>
+        xc_id,
+      </if>
       <if test='null != xch'>
         xch,
       </if>
@@ -245,6 +250,9 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test='null != xcId'>
+        #{xcId},
+      </if>
       <if test='null != xch'>
         #{xch},
       </if>
@@ -386,8 +394,7 @@
   <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>
       <if test='null != checkDate'>check_date = #{checkDate},</if>
@@ -438,7 +445,7 @@
     SELECT
     <include refid="Base_Column_List"/>
     FROM bus_jcb_jcxc t
-    LEFT JOIN base_jcxc t1 on t.xch = t1.id
+    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
     WHERE t.del_flag='0' and t.id = #{id}
 
@@ -462,7 +469,7 @@
     SELECT
     <include refid="Base_Column_List"/>
     FROM bus_jcb_jcxc t
-    LEFT JOIN base_jcxc t1 on t.xch = t1.id
+    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
     <where>
       t.del_flag='0'

+ 11 - 2
railway-business/src/main/resources/mapper/catenary/BusJcbWjcxcMapper.xml

@@ -5,6 +5,7 @@
 
   <resultMap id="BaseResultMap" type="com.railway.business.catenary.domain.BusJcbWjcxc">
     <result column="id" property="id"/>
+    <result column="xc_id" property="xcId"/>
     <result column="dept_id" property="deptId"/>
     <result column="dept_name" property="deptName"/>
     <result column="station_id" property="stationId"/>
@@ -53,6 +54,7 @@
 
   <sql id="Base_Column_List">
     t.id,
+    t.xc_id,
     v.dept_id,
     v.dept_name,
     v.station_name,
@@ -102,6 +104,9 @@
   <insert id="insert" parameterType="com.railway.business.catenary.domain.BusJcbWjcxc">
     INSERT INTO bus_jcb_wjcxc
     <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test='null != xcId'>
+        xc_id,
+      </if>
       <if test='null != xch'>
         xch,
       </if>
@@ -215,6 +220,9 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test='null != xcId'>
+        #{xcId},
+      </if>
       <if test='null != xch'>
         #{xch},
       </if>
@@ -338,6 +346,7 @@
   <update id="update" parameterType="com.railway.business.catenary.domain.BusJcbWjcxc">
     UPDATE bus_jcb_wjcxc
     <set>
+      <if test='null != xch'>xc_id = #{xcId},</if>
       <if test='null != xch'>xch = #{xch},</if>
       <if test='null != temperature'>temperature = #{temperature},</if>
       <if test='null != checkDate'>check_date = #{checkDate},</if>
@@ -382,7 +391,7 @@
     SELECT
     <include refid="Base_Column_List"/>
     FROM bus_jcb_wjcxc t
-    LEFT JOIN base_jcxc t1 on t.xch = t1.id
+    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
     WHERE t.del_flag='0' and t.id = #{id}
 
@@ -407,7 +416,7 @@
     SELECT
     <include refid="Base_Column_List"/>
     FROM bus_jcb_wjcxc t
-    LEFT JOIN base_jcxc t1 on t.xch = t1.id
+    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
     <where>
       t.del_flag='0'