浏览代码

九防台账智能查询完善

wuhonghao 4 年之前
父节点
当前提交
df8b868372

+ 11 - 7
railway-admin/src/main/java/com/railway/web/controller/business/baseinfo/BusPreventController.java

@@ -5,6 +5,7 @@ import com.github.pagehelper.Page;
 import com.railway.business.baseinfo.domain.BusPrevent;
 import com.railway.business.baseinfo.domain.BusSdtz;
 import com.railway.business.baseinfo.domain.BusZzdzxx;
+import com.railway.business.baseinfo.domain.vo.BusPreventQueryVo;
 import com.railway.business.baseinfo.service.IBusLineService;
 import com.railway.business.baseinfo.service.IBusPreventService;
 import com.railway.business.baseinfo.service.IBusZzdzxxService;
@@ -38,23 +39,26 @@ public class BusPreventController extends BaseController {
 
     @ApiOperation(value = "智能查询")
     @GetMapping(value = "smartQuery")
-    public TableDataInfo smartQuery(BusPrevent busPrevent) {
+    public TableDataInfo smartQuery(BusPreventQueryVo busPreventQueryVo) {
         //如果传入查询条件为支柱号则将支柱号转化为公里标
-        if(busPrevent.getPillarCode()!=null){
+        if(busPreventQueryVo.getPillarCode()!=null){
             BusZzdzxx busZzdzxx = new BusZzdzxx();
-            busZzdzxx.setPillarCode(busPrevent.getPillarCode());
-            busZzdzxx.setXingbie(busPrevent.getXingbie());
-            busZzdzxx.setStationId(busPrevent.getStationId());
+            busZzdzxx.setPillarCode(busPreventQueryVo.getPillarCode());
+            busZzdzxx.setXingbie(busPreventQueryVo.getXingbie());
+            busZzdzxx.setStationId(busPreventQueryVo.getStationId());
             List<BusZzdzxx> list = busZzdzxxService.getList(busZzdzxx);
             if(list!=null&&list.size()==1){
-                busPrevent.setMarker(list.get(0).getMarker());
+                busPreventQueryVo.setMarker(list.get(0).getMarker());
             }else{
                 return null;
             }
         }
+        if(busPreventQueryVo.getPillarArea()==null||busPreventQueryVo.getPillarArea().equals("")){
+            busPreventQueryVo.setPillarArea("500");
+        }
 
         startPage();
-        List<BusPrevent> list = busPreventService.smartQuery(busPrevent);
+        List<BusPrevent> list = busPreventService.smartQuery(busPreventQueryVo);
         return getDataTable(list);
     }
 

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

@@ -22,7 +22,6 @@ public class BasePreventBird extends BaseEntity{
     private String id;
 
     @ApiModelProperty(value = "段别")
-    @Length(min = 1, max = 100, message = "【段别】长度必须介于 {min} 和 {max} 之间")
     private String piecewise;
 
     @ApiModelProperty(value = "段别")

+ 8 - 28
railway-business/src/main/java/com/railway/business/baseinfo/domain/BusPrevent.java

@@ -18,28 +18,30 @@ import java.util.Date;
 @EqualsAndHashCode(callSuper = true)
 public class BusPrevent extends BaseEntity {
     @ApiModelProperty(value = "主键", hidden = true)
-    private String id;
+    private String preventId;
+
+    @ApiModelProperty(value = "台账类型")
+    private String preventType;
 
     @ApiModelProperty(value = "段别")
-    @Length(min = 1, max = 100, message = "【段别】长度必须介于 {min} 和 {max} 之间")
     private String piecewise;
 
+    @ApiModelProperty(value = "段别")
+    private String piecewiseText;
+
     @ApiModelProperty(value = "车间id")
     private String deptId;
 
     @ApiModelProperty(value = "车间名称(冗余)")
-    @Length(min = 1, max = 30, message = "【车间名称(冗余)】长度必须介于 {min} 和 {max} 之间")
     private String deptName;
 
     @ApiModelProperty(value = "线路id")
     private String lineId;
 
     @ApiModelProperty(value = "线路名称(冗余)")
-    @Length(min = 1, max = 30, message = "【线路名称(冗余)】长度必须介于 {min} 和 {max} 之间")
     private String lineName;
 
     @ApiModelProperty(value = "行别")
-    @Length(min = 1, max = 4, message = "【行别】长度必须介于 {min} 和 {max} 之间")
     private String xingbie;
 
     @ApiModelProperty(value = "行别")
@@ -49,97 +51,75 @@ public class BusPrevent extends BaseEntity {
     private String stationId;
 
     @ApiModelProperty(value = "区间站场名称")
-    @Length(min = 1, max = 64, message = "【区间站场名称】长度必须介于 {min} 和 {max} 之间")
     private String stationName;
 
     @ApiModelProperty(value = "支柱号")
-    @Length(min = 1, max = 10, message = "【支柱号】长度必须介于 {min} 和 {max} 之间")
     private String pillarCode;
 
     @ApiModelProperty(value = "公里标(m)")
-    @Length(min = 1, max = 20, message = "【公里标(m)】长度必须介于 {min} 和 {max} 之间")
     private String marker;
 
     @ApiModelProperty(value = "风险源(易搭窝部位)")
-    @Length(min = 1, max = 100, message = "【风险源(易搭窝部位)】长度必须介于 {min} 和 {max} 之间")
     private String riskSource;
 
     @ApiModelProperty(value = "采取措施")
-    @Length(min = 1, max = 255, message = "【采取措施】长度必须介于 {min} 和 {max} 之间")
     private String measures;
 
     @ApiModelProperty(value = "备注")
-    @Length(min = 1, max = 255, message = "【备注】长度必须介于 {min} 和 {max} 之间")
     private String remark;
 
     @ApiModelProperty(value = "填写日期")
-    private Date fillDate;
+    private String fillDate;
 
     @ApiModelProperty(value = "填写人")
-    @Length(min = 1, max = 50, message = "【填写人】长度必须介于 {min} 和 {max} 之间")
     private String fillUser;
 
     @ApiModelProperty(value = "杆号范围")
-    @Length(min = 1, max = 10, message = "【杆号范围】长度必须介于 {min} 和 {max} 之间")
     private String pillarArea;
 
     @ApiModelProperty(value = "共计数量")
     private Integer pillarCount;
 
     @ApiModelProperty(value = "线路性质")
-    @Length(min = 1, max = 50, message = "【线路性质】长度必须介于 {min} 和 {max} 之间")
     private String lineType;
 
     @ApiModelProperty(value = "锈蚀部位")
-    @Length(min = 1, max = 255, message = "【锈蚀部位】长度必须介于 {min} 和 {max} 之间")
     private String rustPosition;
 
     @ApiModelProperty(value = "支柱类型")
-    @Length(min = 1, max = 50, message = "【支柱类型】长度必须介于 {min} 和 {max} 之间")
     private String pillarType;
 
     @ApiModelProperty(value = "地形")
-    @Length(min = 1, max = 100, message = "【地形】长度必须介于 {min} 和 {max} 之间")
     private String terrain;
 
     @ApiModelProperty(value = "是否改造地段")
-    @Length(min = 1, max = 255, message = "【是否改造地段】长度必须介于 {min} 和 {max} 之间")
     private String iftransform;
 
     @ApiModelProperty(value = "规格型号")
-    @Length(min = 1, max = 100, message = "【规格型号】长度必须介于 {min} 和 {max} 之间")
     private String specification;
 
     @ApiModelProperty(value = "示数")
-    @Length(min = 1, max = 100, message = "【示数】长度必须介于 {min} 和 {max} 之间")
     private String displayNum;
 
     @ApiModelProperty(value = "数量")
-    @Length(min = 1, max = 100, message = "【数量】长度必须介于 {min} 和 {max} 之间")
     private String count;
 
     @ApiModelProperty(value = "距导线距离(米)_水平")
-    @Length(min = 1, max = 10, message = "【距导线距离(米)_水平】长度必须介于 {min} 和 {max} 之间")
     private String distanceHorizontal;
 
     @ApiModelProperty(value = "距导线距离(米)_垂直")
-    @Length(min = 1, max = 10, message = "【距导线距离(米)_垂直】长度必须介于 {min} 和 {max} 之间")
     private String distanceVertical;
 
     @ApiModelProperty(value = "树种")
-    @Length(min = 1, max = 100, message = "【树种】长度必须介于 {min} 和 {max} 之间")
     private String kind;
 
     @ApiModelProperty(value = "严重程度")
-    @Length(min = 1, max = 50, message = "【严重程度】长度必须介于 {min} 和 {max} 之间")
     private String severity;
 
     @ApiModelProperty(value = "产权(林场、个人)")
-    @Length(min = 1, max = 50, message = "【产权(林场、个人)】长度必须介于 {min} 和 {max} 之间")
     private String propertyRights;
 
     @ApiModelProperty(value = "调查人")
-    @Length(min = 1, max = 50, message = "【调查人】长度必须介于 {min} 和 {max} 之间")
     private String inquirer;
 
 }

+ 36 - 0
railway-business/src/main/java/com/railway/business/baseinfo/domain/vo/BusPreventQueryVo.java

@@ -0,0 +1,36 @@
+package com.railway.business.baseinfo.domain.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author wuhonghao
+ */
+@Data
+@ApiModel("九防台账")
+public class BusPreventQueryVo  {
+
+
+    @ApiModelProperty(value = "部门ID")
+    private String deptId;
+
+    @ApiModelProperty(value = "线别ID")
+    private String lineId;
+
+    @ApiModelProperty(value = "行别")
+    private String xingbie;
+
+    @ApiModelProperty(value = "场站ID")
+    private String stationId;
+
+    @ApiModelProperty(value = "支柱号")
+    private String pillarCode;
+
+    @ApiModelProperty(value = "支柱范围")
+    private String pillarArea;
+
+    @ApiModelProperty(value = "公里标")
+    private String marker;
+
+}

+ 2 - 1
railway-business/src/main/java/com/railway/business/baseinfo/mapper/BusPreventMapper.java

@@ -2,6 +2,7 @@ package com.railway.business.baseinfo.mapper;
 
 import com.github.pagehelper.Page;
 import com.railway.business.baseinfo.domain.BusPrevent;
+import com.railway.business.baseinfo.domain.vo.BusPreventQueryVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.springframework.stereotype.Repository;
 
@@ -17,6 +18,6 @@ public interface BusPreventMapper {
     /**
     * 智能查询
     */
-    Page<BusPrevent> smartQuery(BusPrevent busPrevent);
+    Page<BusPrevent> smartQuery(BusPreventQueryVo busPreventQueryVo);
 
 }

+ 2 - 1
railway-business/src/main/java/com/railway/business/baseinfo/service/IBusPreventService.java

@@ -3,6 +3,7 @@ package com.railway.business.baseinfo.service;
 import com.github.pagehelper.Page;
 import com.railway.business.baseinfo.domain.BusBlq;
 import com.railway.business.baseinfo.domain.BusPrevent;
+import com.railway.business.baseinfo.domain.vo.BusPreventQueryVo;
 
 import java.util.List;
 
@@ -17,6 +18,6 @@ public interface IBusPreventService {
     /**
     * 智能查询
     */
-    List<BusPrevent> smartQuery(BusPrevent busPrevent);
+    List<BusPrevent> smartQuery(BusPreventQueryVo busPreventQueryVo);
 
 }

+ 3 - 2
railway-business/src/main/java/com/railway/business/baseinfo/service/impl/BusPreventServiceImpl.java

@@ -4,6 +4,7 @@ import com.github.pagehelper.Page;
 import com.railway.business.baseinfo.domain.BusBlq;
 import com.railway.business.baseinfo.domain.BusPrevent;
 import com.railway.business.baseinfo.domain.BusZzdzxx;
+import com.railway.business.baseinfo.domain.vo.BusPreventQueryVo;
 import com.railway.business.baseinfo.mapper.BusBlqMapper;
 import com.railway.business.baseinfo.mapper.BusPreventMapper;
 import com.railway.business.baseinfo.mapper.BusZzdzxxMapper;
@@ -33,7 +34,7 @@ public class BusPreventServiceImpl implements IBusPreventService {
    * 查询列表
    */
   @Override
-  public List<BusPrevent> smartQuery(BusPrevent busPrevent) {
-    return busPreventMapper.smartQuery(busPrevent);
+  public List<BusPrevent> smartQuery(BusPreventQueryVo busPreventQueryVo) {
+    return busPreventMapper.smartQuery(busPreventQueryVo);
   }
 }

+ 98 - 22
railway-business/src/main/resources/mapper/baseinfo/BusPreventMapper.xml

@@ -5,57 +5,133 @@
 
   <resultMap id="BaseResultMap" type="com.railway.business.baseinfo.domain.BusPrevent">
     <result column="prevent_id" property="preventId"/>
+    <result column="prevent_type" property="preventType"/>
+    <result column="dept_id" property="deptId"/>
+    <result column="dept_name" property="deptName"/>
     <result column="line_id" property="lineId"/>
+    <result column="line_name" property="lineName"/>
     <result column="xingbie" property="xingbie"/>
+    <result column="xingbie_text" property="xingbieText"/>
     <result column="station_id" property="stationId"/>
+    <result column="station_name" property="stationName"/>
     <result column="pillar_code" property="pillarCode"/>
-    <result column="record_type" property="recordType"/>
     <result column="marker" property="marker"/>
     <result column="risk_source" property="riskSource"/>
     <result column="measures" property="measures"/>
+    <result column="remark" property="remark"/>
+    <result column="fill_date" property="fillDate"/>
+    <result column="fill_user" property="fillUser"/>
+    <result column="pillar_area" property="pillarArea"/>
+    <result column="pillar_count" property="pillarCount"/>
+    <result column="line_type" property="lineType"/>
+    <result column="rust_position" property="rustPosition"/>
+    <result column="pillar_type" property="pillarType"/>
+    <result column="terrain" property="terrain"/>
+    <result column="iftransform" property="iftransform"/>
+    <result column="specification" property="specification"/>
+    <result column="display_num" property="displayNum"/>
+    <result column="count" property="count"/>
+    <result column="distance_horizontal" property="distanceHorizontal"/>
+    <result column="distance_vertical" property="distanceVertical"/>
+    <result column="kind" property="kind"/>
+    <result column="severity" property="severity"/>
+    <result column="property_rights" property="propertyRights"/>
+    <result column="inquirer" property="inquirer"/>
   </resultMap>
 
-  <sql id="Base_Column_List">
+<!--  <sql id="Base_Column_List">
     prevent_id,
+    prevent_type,
+    dept_id,
+    dept_name,
     line_id,
+    line_name
     xingbie,
     station_id,
+    station_name,
     pillar_code,
-    record_type,
     marker,
     risk_source,
-    measures
-  </sql>
+    measures,
+    remark,
+    fill_date,
+    fill_user,
+    pillar_area,
+    pillar_count,
+    line_type,
+    rust_position,
+    pillar_type,
+    terrain,
+    iftransform,
+    specification,
+    display_num,
+    count,
+    distance_horizontal,
+    distance_vertical,
+    kind,
+    severity,
+    property_rights.
+    inquirer
+  </sql>-->
 
 
   <select id="smartQuery" resultMap="BaseResultMap">
-  SELECT
-    prevent_id,
-    line_id,
-    xingbie,
-    station_id,
-    pillar_code,
-    record_type,
-    marker,
-    risk_source,
-    measures
-  FROM
-  v_prevent v
+    SELECT
+    v.prevent_id,
+    v.prevent_type,
+    v1.dept_id,
+    v1.dept_name,
+    v1.line_id,
+    v1.line_name,
+    v.xingbie,
+    dict.dict_label xingbie_text,
+    v1.station_id,
+    v1.station_name,
+    v.pillar_code,
+    v.marker,
+    v.risk_source,
+    v.measures,
+    v.remark,
+    v.fill_date,
+    v.fill_user,
+    v.pillar_area,
+    v.pillar_count,
+    v.line_type,
+    v.rust_position,
+    v.pillar_type,
+    v.terrain,
+    v.iftransform,
+    v.specification,
+    v.display_num,
+    v.count,
+    v.distance_horizontal,
+    v.distance_vertical,
+    v.kind,
+    v.severity,
+    v.property_rights,
+    v.inquirer
+    FROM
+    v_prevent v
+    left join v_station v1 on v.station_id = v1.station_id
+    LEFT JOIN sys_dict_data dict ON (v.xingbie = dict.dict_value AND dict.dict_type = 'xingbie')
     <where>
+      <if test="deptId!=null and deptId!=''">
+        and v1.dept_id=#{deptId}
+      </if>
       <if test="lineId!=null and lineId!=''">
-        and v.line_id=#{lineId}
+        and v1.line_id=#{lineId}
       </if>
       <if test="xingbie!=null and xingbie!=''">
         and v.xingbie=#{xingbie}
       </if>
       <if test="stationId!=null and stationId!=''">
-        and v.station_id=#{stationId}
+        and v1.station_id=#{stationId}
       </if>
-      <if test="pillarCode!=null and pillarCode!=''">
+<!--      <if test="pillarCode!=null and pillarCode!=''">
         and v.pillar_code=#{pillarCode}
-      </if>
+      </if>-->
       <if test="marker != null and marker != ''">
-        AND (marker + 0.0) BETWEEN (#{marker} + 0.0) - (#{pillarArea} + 0.0) AND (#{marker} + 0.0) +
+        AND (v.marker + 0.0) BETWEEN (#{marker} + 0.0) - (#{pillarArea} + 0.0) AND (#{marker} + 0.0) +
         (#{pillarArea} + 0.0)
       </if>
     </where>