Bladeren bron

隧道台起始里程拆分

wuhonghao 4 jaren geleden
bovenliggende
commit
6499cb076f

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

@@ -6,6 +6,9 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.hibernate.validator.constraints.Length;
+
+import java.math.BigDecimal;
+
 /**
  * 智能查询-隧道台账
  * @author wuhonghao 2021-10-26
@@ -16,7 +19,7 @@ import org.hibernate.validator.constraints.Length;
 public class BusSdtz extends BaseEntity{
 
     @ApiModelProperty(value = "主键", hidden = true)
-    private String id;
+    private Long id;
 
     @ApiModelProperty(value = "车间ID")
     private Long deptId;
@@ -44,6 +47,15 @@ public class BusSdtz extends BaseEntity{
     @Length(min = 1, max = 200, message = "【两侧杆号】长度必须介于 {min} 和 {max} 之间")
     private String lcgh;
 
+    @ApiModelProperty(value = "隧道起始公里标")
+    private BigDecimal startMarker;
+
+    @ApiModelProperty(value = "隧道结束公里标")
+    private BigDecimal endMarker;
+
+    @ApiModelProperty(value = "隧道中心公里标")
+    private BigDecimal centerMarker;
+
     @ApiModelProperty(value = "起止里程/中心里程")
     @Length(min = 1, max = 100, message = "【起止里程/中心里程】长度必须介于 {min} 和 {max} 之间")
     private String qzlcZxlc;

+ 36 - 29
railway-business/src/main/resources/mapper/baseinfo/BusSdtzMapper.xml

@@ -13,7 +13,9 @@
     <result column="station_name" property="stationName"/>
     <result column="sdmc" property="sdmc"/>
     <result column="lcgh" property="lcgh"/>
-    <result column="qzlc_zxlc" property="qzlcZxlc"/>
+    <result column="start_marker" property="startMarker"/>
+    <result column="end_marker" property="endMarker"/>
+    <result column="center_marker" property="centerMarker"/>
     <result column="sdcd" property="sdcd"/>
     <result column="del_flag" property="delFlag"/>
     <result column="create_by" property="createBy"/>
@@ -32,7 +34,9 @@
     v.station_id,
     t.sdmc,
     t.lcgh,
-    t.qzlc_zxlc,
+    t.start_marker,
+    t.end_marker,
+    t.center_marker,
     t.sdcd,
     t.del_flag,
     t.create_by,
@@ -56,8 +60,14 @@
       <if test='null != lcgh'>
         lcgh,
       </if>
-      <if test='null != qzlcZxlc'>
-        qzlc_zxlc,
+      <if test='null != startMarker'>
+        start_marker,
+      </if>
+      <if test='null != endMarker'>
+        end_marker,
+      </if>
+      <if test='null != centerMarker'>
+        center_marker,
       </if>
       <if test='null != sdcd'>
         sdcd,
@@ -88,8 +98,14 @@
       <if test='null != lcgh'>
         #{lcgh},
       </if>
-      <if test='null != qzlcZxlc'>
-        #{qzlcZxlc},
+      <if test='null != startMarker'>
+        #{startMarker},
+      </if>
+      <if test='null != endMarker'>
+        #{endMarker},
+      </if>
+      <if test='null != centerMarker'>
+        #{centerMarker},
       </if>
       <if test='null != sdcd'>
         #{sdcd},
@@ -124,7 +140,9 @@
       <if test='null != stationId'>station_id = #{stationId},</if>
       <if test='null != sdmc'>sdmc = #{sdmc},</if>
       <if test='null != lcgh'>lcgh = #{lcgh},</if>
-      <if test='null != qzlcZxlc'>qzlc_zxlc = #{qzlcZxlc},</if>
+      <if test='null != startMarker'>start_marker = #{startMarker},</if>
+      <if test='null != endMarker'>end_marker = #{endMarker},</if>
+      <if test='null != centerMarker'>center_marker = #{centerMarker},</if>
       <if test='null != sdcd'>sdcd = #{sdcd},</if>
       <if test='null != delFlag'>del_flag = #{delFlag},</if>
       <if test='null != updateBy'>update_by = #{updateBy},</if>
@@ -165,8 +183,14 @@
       <if test="lcgh!=null and lcgh!=''">
         and t.lcgh=#{lcgh}
       </if>
-      <if test="qzlcZxlc!=null and qzlcZxlc!=''">
-        and t.qzlc_zxlc=#{qzlcZxlc}
+      <if test="startMarker!=null and startMarker!=''">
+        and t.start_marker=#{startMarker}
+      </if>
+      <if test="endMarker!=null and endMarker!=''">
+        and t.end_marker=#{endMarker}
+      </if>
+      <if test="centerMarker!=null and centerMarker!=''">
+        and t.center_marker=#{centerMarker}
       </if>
       <if test="sdcd!=null and sdcd!=''">
         and t.sdcd=#{sdcd}
@@ -193,22 +217,7 @@
   <select id="smartQuery" resultMap="BaseResultMap">
     SELECT
     <include refid="Base_Column_List"/>
-    FROM (
-      select id,
-      station_id,
-      sdmc,
-      lcgh,
-      qzlc_zxlc,
-      sdcd,
-      del_flag,
-      create_by,
-      create_time,
-      update_by,
-      update_time,
-      replace(replace(right(qzlc_zxlc, length(qzlc_zxlc)- LOCATE('/',qzlc_zxlc)),'km',''),'m','')-(sdcd/2) beginMarker,
-      replace(replace(right(qzlc_zxlc, length(qzlc_zxlc)- LOCATE('/',qzlc_zxlc)),'km',''),'m','')+(sdcd/2) endMarker
-      from base_sdtz
-    ) t
+    FROM from base_sdtz t
     LEFT JOIN v_station v on t.station_id = v.dept_station_id
     <where>
       t.del_flag='0'
@@ -224,11 +233,9 @@
 
       <if test="marker!=null and marker!=''">
         AND (
-        (t.beginMarker + 0.0) BETWEEN (#{marker} + 0.0) - (#{pillarArea} + 0.0) AND (#{marker} + 0.0) +
-        (#{pillarArea} + 0.0)
+        (#{marker} + 0.0) - (#{pillarArea} + 0.0) BETWEEN (t.startMarker + 0.0) and (t.endMarker + 0.0)
         or
-        (t.endMarker + 0.0) BETWEEN (#{marker} + 0.0) - (#{pillarArea} + 0.0) AND (#{marker} + 0.0) +
-        (#{pillarArea} + 0.0)
+        (#{marker} + 0.0) + (#{pillarArea} + 0.0) BETWEEN (t.startMarker + 0.0) and (t.endMarker + 0.0)
         )
       </if>