Bladeren bron

阀井巡查:时间排序倒序;
调压箱、阀井、庭院管网名称搜索;

JX.Li 1 jaar geleden
bovenliggende
commit
055114facc

+ 2 - 1
ruoyi-gas/src/main/java/com/ruoyi/gas/controller/GValveWellInspectionController.java

@@ -12,6 +12,7 @@ import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.gas.domain.bo.GValveWellInspectionBo;
 import com.ruoyi.gas.domain.vo.GValveWellInspectionVo;
+import com.ruoyi.gas.domain.vo.GValveWellInspectionVos;
 import com.ruoyi.gas.service.IGValveWellInspectionService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -48,7 +49,7 @@ public class GValveWellInspectionController extends BaseController {
     @ApiOperation("查询阀井巡查列表")
     @PreAuthorize("@ss.hasPermi('gas:valveWellInspection:list')")
     @GetMapping("/list")
-    public TableDataInfo<GValveWellInspectionVo> list(@Validated(QueryGroup.class) GValveWellInspectionBo bo) {
+    public TableDataInfo<GValveWellInspectionVos> list(@Validated(QueryGroup.class) GValveWellInspectionBo bo) {
         return iGValveWellInspectionService.queryPageList(bo);
     }
 

+ 1 - 0
ruoyi-gas/src/main/java/com/ruoyi/gas/domain/bo/GCourtyardNetworkManagementBo.java

@@ -26,6 +26,7 @@ public class GCourtyardNetworkManagementBo extends BaseEntity {
     private String processStatus;
     private String processComments;
     private String ranks;
+    private String areaName;
     /**
      * 主键id
      */

+ 1 - 0
ruoyi-gas/src/main/java/com/ruoyi/gas/domain/bo/GValveWellInspectionBo.java

@@ -40,6 +40,7 @@ public class GValveWellInspectionBo extends BaseEntity {
     @ApiModelProperty(value = "位置id", required = true)
     @NotNull(message = "位置id不能为空", groups = { AddGroup.class, EditGroup.class })
     private Long positionId;
+    private String valveWellName;
 
     /**
      * 发现问题

+ 30 - 0
ruoyi-gas/src/main/java/com/ruoyi/gas/domain/vo/GValveWellInspectionVos.java

@@ -0,0 +1,30 @@
+package com.ruoyi.gas.domain.vo;
+
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * 阀井巡查视图对象 g_valve_well_inspection
+ *
+ * @author ruoyi
+ * @date 2024-03-18
+ */
+@Data
+public class GValveWellInspectionVos{
+
+	private static final long serialVersionUID = 1L;
+
+	private List<String> photoList;
+	private Long id;
+	private String valveWellName;
+	private String createByName;
+	private String discoverProblems;
+	private String remark;
+	private String positionName;
+	private Long positionId;
+	private Date createTime;
+	private String createBy;
+}

+ 6 - 1
ruoyi-gas/src/main/java/com/ruoyi/gas/mapper/GValveWellInspectionMapper.java

@@ -1,7 +1,11 @@
 package com.ruoyi.gas.mapper;
 
-import com.ruoyi.gas.domain.GValveWellInspection;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
+import com.ruoyi.gas.domain.GValveWellInspection;
+import com.ruoyi.gas.domain.bo.GValveWellInspectionBo;
+import com.ruoyi.gas.domain.vo.GValveWellInspectionVos;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -14,4 +18,5 @@ import java.util.List;
 public interface GValveWellInspectionMapper extends BaseMapperPlus<GValveWellInspection> {
     List<String> getPhoto(Long id);
     String getName(String id);
+    Page<GValveWellInspectionVos> getList(@Param("p") GValveWellInspectionBo bo, Page<?> page);
 }

+ 5 - 4
ruoyi-gas/src/main/java/com/ruoyi/gas/service/IGValveWellInspectionService.java

@@ -1,10 +1,11 @@
 package com.ruoyi.gas.service;
 
-import com.ruoyi.gas.domain.GValveWellInspection;
-import com.ruoyi.gas.domain.vo.GValveWellInspectionVo;
-import com.ruoyi.gas.domain.bo.GValveWellInspectionBo;
 import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
 import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.gas.domain.GValveWellInspection;
+import com.ruoyi.gas.domain.bo.GValveWellInspectionBo;
+import com.ruoyi.gas.domain.vo.GValveWellInspectionVo;
+import com.ruoyi.gas.domain.vo.GValveWellInspectionVos;
 
 import java.util.Collection;
 import java.util.List;
@@ -25,7 +26,7 @@ public interface IGValveWellInspectionService extends IServicePlus<GValveWellIns
 	/**
 	 * 查询列表
 	 */
-    TableDataInfo<GValveWellInspectionVo> queryPageList(GValveWellInspectionBo bo);
+    TableDataInfo<GValveWellInspectionVos> queryPageList(GValveWellInspectionBo bo);
 
 	/**
 	 * 查询列表

+ 9 - 10
ruoyi-gas/src/main/java/com/ruoyi/gas/service/impl/GValveWellInspectionServiceImpl.java

@@ -3,8 +3,8 @@ package com.ruoyi.gas.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
-import com.ruoyi.common.core.page.PagePlus;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.utils.PageUtils;
 import com.ruoyi.common.utils.StringUtils;
@@ -12,6 +12,7 @@ import com.ruoyi.gas.domain.GValveWellInspection;
 import com.ruoyi.gas.domain.bo.GValveWellInspectionBo;
 import com.ruoyi.gas.domain.bo.GValveWellInspectionPhotoBo;
 import com.ruoyi.gas.domain.vo.GValveWellInspectionVo;
+import com.ruoyi.gas.domain.vo.GValveWellInspectionVos;
 import com.ruoyi.gas.mapper.GValveWellInspectionMapper;
 import com.ruoyi.gas.mapper.GValveWellPositionMapper;
 import com.ruoyi.gas.service.IGValveWellInspectionPhotoService;
@@ -46,15 +47,12 @@ public class GValveWellInspectionServiceImpl extends ServicePlusImpl<GValveWellI
     }
 
     @Override
-    public TableDataInfo<GValveWellInspectionVo> queryPageList(GValveWellInspectionBo bo) {
-        PagePlus<GValveWellInspection, GValveWellInspectionVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo));
-        TableDataInfo<GValveWellInspectionVo> tableDataInfo = PageUtils.buildDataInfo(result);
-        tableDataInfo.getRows().forEach(item -> {
-            item.setCreateByName(baseMapper.getName(item.getCreateBy()));
-            item.setPhotoList(baseMapper.getPhoto(item.getId()));
-            item.setPosition(positionMapper.selectById(item.getPositionId()));
-        });
-        return tableDataInfo;
+    public TableDataInfo<GValveWellInspectionVos> queryPageList(GValveWellInspectionBo bo) {
+        Page<GValveWellInspectionVos> page = new Page<>(bo.getPageNum(), bo.getPageSize());
+        Page<GValveWellInspectionVos> list = baseMapper.getList(bo, page);
+        list.getRecords().forEach(item -> item.setPhotoList(baseMapper.getPhoto(item.getId())));
+        return PageUtils.buildDataInfo(list);
+
     }
 
     @Override
@@ -66,6 +64,7 @@ public class GValveWellInspectionServiceImpl extends ServicePlusImpl<GValveWellI
         Map<String, Object> params = bo.getParams();
         LambdaQueryWrapper<GValveWellInspection> lqw = Wrappers.lambdaQuery();
         lqw.eq(bo.getPositionId() != null, GValveWellInspection::getPositionId, bo.getPositionId());
+        lqw.eq(bo.getValveWellName() != null, GValveWellInspection::getPositionId, bo.getValveWellName());
         lqw.eq(StringUtils.isNotBlank(bo.getDiscoverProblems()), GValveWellInspection::getDiscoverProblems, bo.getDiscoverProblems());
         lqw.eq(bo.getDiscoverTime() != null, GValveWellInspection::getDiscoverTime, bo.getDiscoverTime());
         return lqw;

+ 3 - 0
ruoyi-gas/src/main/resources/mapper/GCourtyardNetworkManagementMapper.xml

@@ -39,6 +39,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="p.findProblem != null  and p.findProblem != ''">
                 and a.find_problem = #{p.findProblem}
             </if>
+            <if test="p.areaName != null  and p.areaName != ''">
+                and d.name LIKE concat('%', #{p.areaName}, '%')
+            </if>
             <if test="p.createBy != null  and p.createBy != ''">
                 and a.create_by = #{p.createBy}
             </if>

+ 3 - 0
ruoyi-gas/src/main/resources/mapper/GRegulatorBoxMapper.xml

@@ -82,6 +82,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="p.ranks != null and p.ranks != ''">
                 and u.ranks = #{p.ranks}
             </if>
+            <if test="p.name != null and p.name != ''">
+                and a.name LIKE concat('%', #{p.name}, '%')
+            </if>
         </where>
         ORDER BY a.create_time DESC
     </select>

+ 27 - 1
ruoyi-gas/src/main/resources/mapper/GValveWellInspectionMapper.xml

@@ -16,7 +16,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateBy" column="update_by"/>
         <result property="updateTime" column="update_time"/>
     </resultMap>
-
+    <select id="getList" resultType="com.ruoyi.gas.domain.vo.GValveWellInspectionVos">
+        SELECT
+        vwi.id,
+        vwp.valve_well_name,
+        vwp.position AS positionName,
+        u.name AS createByName,
+        vwi.discover_problems,
+        vwi.remark,
+        vwi.create_time
+        FROM
+        g_valve_well_inspection vwi
+        LEFT JOIN g_valve_well_position vwp ON vwp.id = vwi.position_id
+        LEFT JOIN g_user u ON u.id = vwi.create_by
+        WHERE
+        vwi.del_flag = '0'
+        <if test="p.valveWellName != null and p.valveWellName != ''">
+            AND vwp.valve_well_name LIKE concat('%', #{p.valveWellName}, '%')
+        </if>
+        <if test="p.positionId != null and p.positionId != ''">
+            AND vwi.position_id = #{p.positionId}
+        </if>
+        <if test="p.discoverProblems != null and p.discoverProblems != ''">
+            AND vwi.discover_problems = #{p.discoverProblems}
+        </if>
+        ORDER BY
+        vwi.create_time DESC
+    </select>
     <select id="getPhoto" resultType="java.lang.String">
         select pic_url AS picUrl
         from g_valve_well_inspection_photo