Просмотр исходного кода

- 添加WaterPumpStation供水泵站信息数据接口

Kazerin 1 месяц назад
Родитель
Сommit
d4d06f0491

+ 0 - 1
pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/WaterSupply/WaterPipeInfo/WaterPipeInfoController.java

@@ -26,7 +26,6 @@ import java.util.List;
 @RestController
 @RequestMapping("/api/water/pipe")
 @Api(tags = "供水管网-管网信息数据接口")
-@Anonymous
 public class WaterPipeInfoController {
 
     private static final Logger log = LoggerFactory.getLogger(WaterPipeInfoController.class);

+ 222 - 0
pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/WaterSupply/WaterPumpStation/WaterPumpStationController.java

@@ -0,0 +1,222 @@
+package com.zksy.web.controller.WaterSupply.WaterPumpStation;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zksy.WaterSupply.WaterPumpStation.domain.WaterPumpStation;
+import com.zksy.WaterSupply.WaterPumpStation.service.IWaterPumpStationService;
+import com.zksy.common.core.domain.AjaxResult;
+import com.zksy.common.utils.SecurityUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+/**
+ * 泵站信息管理接口
+ */
+@RestController
+@RequestMapping("/api/water/pumpStation")
+@Api(tags = "供水管网-泵站信息数据接口")
+public class WaterPumpStationController {
+
+    private static final Logger log = LoggerFactory.getLogger(WaterPumpStationController.class);
+
+    @Autowired
+    private IWaterPumpStationService pumpStationService;
+
+    // -------------------------- 基础CRUD接口 --------------------------
+    @GetMapping("/page")
+    @ApiOperation(value = "分页查询泵站数据", notes = "支持按泵站编号、名称、状态、负责人模糊查询")
+    @ApiResponses({
+            @ApiResponse(code = 200, message = "查询成功", response = AjaxResult.class),
+            @ApiResponse(code = 500, message = "服务器内部错误,查询失败", response = AjaxResult.class)
+    })
+    public AjaxResult queryPage(
+            @ApiParam(value = "页码", defaultValue = "1") @RequestParam(defaultValue = "1") Integer pageNum,
+            @ApiParam(value = "每页大小", defaultValue = "10") @RequestParam(defaultValue = "10") Integer pageSize,
+            @ApiParam(value = "泵站编号") @RequestParam(required = false) String stationCode,
+            @ApiParam(value = "泵站名称") @RequestParam(required = false) String stationName,
+            @ApiParam(value = "运行状态(0正常 1故障 2检修)") @RequestParam(required = false) String status,
+            @ApiParam(value = "负责人") @RequestParam(required = false) String principal) {
+        try {
+            Page<WaterPumpStation> page = new Page<>(pageNum, pageSize);
+            IPage<WaterPumpStation> resultPage = pumpStationService.queryPage(page, stationCode, stationName, status, principal);
+            return AjaxResult.success("查询成功", resultPage);
+        } catch (Exception e) {
+            log.error("分页查询泵站数据异常", e);
+            return AjaxResult.error("查询失败:" + e.getMessage());
+        }
+    }
+
+    @GetMapping("/{id}")
+    @ApiOperation(value = "根据ID查询泵站详情", notes = "传入泵站ID获取完整信息")
+    @ApiResponses({
+            @ApiResponse(code = 200, message = "查询成功", response = AjaxResult.class),
+            @ApiResponse(code = 404, message = "未找到指定ID的泵站信息", response = AjaxResult.class),
+            @ApiResponse(code = 500, message = "服务器内部错误,查询失败", response = AjaxResult.class)
+    })
+    public AjaxResult getById(
+            @ApiParam(value = "泵站ID", required = true, example = "1") @PathVariable Long id) {
+        try {
+            WaterPumpStation data = pumpStationService.getById(id);
+            return data == null ? AjaxResult.warn("未找到该泵站信息") : AjaxResult.success("查询成功", data);
+        } catch (Exception e) {
+            log.error("查询泵站详情异常", e);
+            return AjaxResult.error("查询失败:" + e.getMessage());
+        }
+    }
+
+    @PostMapping
+    @ApiOperation(value = "新增泵站信息", notes = "传入泵站实体对象进行新增")
+    @ApiResponses({
+            @ApiResponse(code = 200, message = "新增成功", response = AjaxResult.class),
+            @ApiResponse(code = 400, message = "请求参数错误", response = AjaxResult.class),
+            @ApiResponse(code = 500, message = "服务器内部错误,新增失败", response = AjaxResult.class)
+    })
+    public AjaxResult add(@RequestBody WaterPumpStation pumpStation) {
+        try {
+            pumpStation.setDelFlag("0");
+            try {
+                pumpStation.setCreateBy(SecurityUtils.getUsername());
+            } catch (Exception e) {
+                pumpStation.setCreateBy("system");
+            }
+            pumpStation.setCreateTime(LocalDateTime.now());
+            boolean result = pumpStationService.save(pumpStation);
+            return result ? AjaxResult.success("新增成功") : AjaxResult.error("新增失败");
+        } catch (Exception e) {
+            log.error("新增泵站信息异常", e);
+            return AjaxResult.error("新增失败:" + e.getMessage());
+        }
+    }
+
+    @PutMapping
+    @ApiOperation(value = "修改泵站信息", notes = "传入泵站实体对象进行修改,仅更新非空字段")
+    @ApiResponses({
+            @ApiResponse(code = 200, message = "修改成功", response = AjaxResult.class),
+            @ApiResponse(code = 400, message = "请求参数错误", response = AjaxResult.class),
+            @ApiResponse(code = 500, message = "服务器内部错误,修改失败", response = AjaxResult.class)
+    })
+    public AjaxResult update(@RequestBody WaterPumpStation pumpStation) {
+        try {
+            // 禁止修改关键字段
+            pumpStation.setDelFlag(null);
+            pumpStation.setCreateBy(null);
+            pumpStation.setCreateTime(null);
+
+            try {
+                pumpStation.setUpdateBy(SecurityUtils.getUsername());
+            } catch (Exception e) {
+                pumpStation.setUpdateBy("system");
+            }
+            pumpStation.setUpdateTime(LocalDateTime.now());
+
+            boolean result = pumpStationService.updateById(pumpStation);
+            return result ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
+        } catch (Exception e) {
+            log.error("修改泵站信息异常", e);
+            return AjaxResult.error("修改失败:" + e.getMessage());
+        }
+    }
+
+    @DeleteMapping("/{ids}")
+    @ApiOperation(value = "批量逻辑删除泵站信息", notes = "多个ID用逗号分隔,逻辑删除(移入回收站),不物理删除数据")
+    @ApiResponses({
+            @ApiResponse(code = 200, message = "修改成功", response = AjaxResult.class),
+            @ApiResponse(code = 400, message = "请求参数错误", response = AjaxResult.class),
+            @ApiResponse(code = 500, message = "服务器内部错误,修改失败", response = AjaxResult.class)
+    })
+    public AjaxResult remove(
+            @ApiParam(value = "泵站ID数组,多个用逗号分隔", required = true, example = "1,2,3") @PathVariable Long[] ids) {
+        try {
+            log.info("开始删除泵站数据,ids: {}", (Object) ids);
+            boolean result = pumpStationService.removeByIds(List.of(ids));
+            return result
+                    ? AjaxResult.success("删除成功,已移入回收站,共删除 " + ids.length + " 条数据")
+                    : AjaxResult.error("删除失败");
+        } catch (Exception e) {
+            log.error("删除泵站数据异常", e);
+            return AjaxResult.error("删除失败:" + e.getMessage());
+        }
+    }
+
+    // -------------------------- 回收站接口 --------------------------
+    @GetMapping("/recycle/list")
+    @ApiOperation(value = "查询回收站数据", notes = "分页查询已删除的泵站数据,支持筛选")
+    @ApiResponses({
+            @ApiResponse(code = 200, message = "查询成功", response = AjaxResult.class),
+            @ApiResponse(code = 500, message = "服务器内部错误,查询失败", response = AjaxResult.class)
+    })
+    public AjaxResult recycleList(
+            @ApiParam(value = "页码", defaultValue = "1") @RequestParam(defaultValue = "1") Integer pageNum,
+            @ApiParam(value = "每页大小", defaultValue = "10") @RequestParam(defaultValue = "10") Integer pageSize,
+            @ApiParam(value = "泵站编号") @RequestParam(required = false) String stationCode,
+            @ApiParam(value = "泵站名称") @RequestParam(required = false) String stationName,
+            @ApiParam(value = "运行状态(0正常 1故障 2检修)") @RequestParam(required = false) String status) {
+        try {
+            Page<WaterPumpStation> page = new Page<>(pageNum, pageSize);
+            IPage<WaterPumpStation> resultPage = pumpStationService.queryDeletedPage(page, stationCode, stationName, status);
+            return AjaxResult.success("查询成功", resultPage);
+        } catch (Exception e) {
+            log.error("查询回收站数据异常", e);
+            return AjaxResult.error("查询失败:" + e.getMessage());
+        }
+    }
+
+    @PostMapping("/recycle/restore/{ids}")
+    @ApiOperation(value = "批量恢复已删除数据", notes = "多个ID用逗号分隔,将数据从回收站恢复为正常状态")
+    @ApiResponses({
+            @ApiResponse(code = 200, message = "恢复成功", response = AjaxResult.class),
+            @ApiResponse(code = 400, message = "请选择要恢复的数据", response = AjaxResult.class),
+            @ApiResponse(code = 500, message = "服务器内部错误,恢复失败", response = AjaxResult.class)
+    })
+    public AjaxResult restore(
+            @ApiParam(value = "泵站ID数组,多个用逗号分隔", required = true, example = "3,4") @PathVariable Long[] ids) {
+        try {
+            log.info("开始恢复泵站数据,ids: {}", (Object) ids);
+            String updateBy = "system";
+            try {
+                updateBy = SecurityUtils.getUsername();
+            } catch (Exception e) {
+                log.warn("未获取到登录用户,使用默认值system");
+            }
+
+            boolean result = pumpStationService.restoreByIds(List.of(ids), updateBy);
+            return result
+                    ? AjaxResult.success("恢复成功,共恢复 " + ids.length + " 条数据")
+                    : AjaxResult.error("恢复失败");
+        } catch (Exception e) {
+            log.error("恢复数据异常", e);
+            return AjaxResult.error("恢复失败:" + e.getMessage());
+        }
+    }
+
+    @DeleteMapping("/recycle/delete/{ids}")
+    @ApiOperation(value = "批量彻底删除数据(不可恢复)", notes = "多个ID用逗号分隔,物理删除数据库中的数据,谨慎使用")
+    @ApiResponses({
+            @ApiResponse(code = 200, message = "恢复成功", response = AjaxResult.class),
+            @ApiResponse(code = 400, message = "请选择要恢复的数据", response = AjaxResult.class),
+            @ApiResponse(code = 500, message = "服务器内部错误,恢复失败", response = AjaxResult.class)
+    })
+    public AjaxResult deletePhysically(
+            @ApiParam(value = "泵站ID数组,多个用逗号分隔", required = true, example = "5") @PathVariable Long[] ids) {
+        try {
+            log.info("开始彻底删除泵站数据,ids: {}", (Object) ids);
+            boolean result = pumpStationService.deleteByIdsPhysically(List.of(ids));
+            return result
+                    ? AjaxResult.success("彻底删除成功,共删除 " + ids.length + " 条数据")
+                    : AjaxResult.error("彻底删除失败");
+        } catch (Exception e) {
+            log.error("彻底删除数据异常", e);
+            return AjaxResult.error("彻底删除失败:" + e.getMessage());
+        }
+    }
+}

+ 1 - 1
pipe-network-service/zksy-system/src/main/java/com/zksy/WaterSupply/WaterPipeInfo/domain/WaterPipeInfo.java

@@ -21,7 +21,7 @@ import java.time.LocalDateTime;
 @ApiModel(value = "WaterPipeInfo", description = "管网信息对象")
 public class WaterPipeInfo {
 
-    @ApiModelProperty(value = "主键ID", example = "1", position = 1)
+    @ApiModelProperty(value = "主键ID", example = "0", position = 1)
     @TableId(type = IdType.AUTO)
     private Long id;
 

+ 189 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/WaterSupply/WaterPumpStation/domain/WaterPumpStation.java

@@ -0,0 +1,189 @@
+package com.zksy.WaterSupply.WaterPumpStation.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * 泵站信息实体
+ */
+@Data
+@TableName("water_pump_station")
+@ApiModel(
+        value = "WaterPumpStation",
+        description = "泵站信息对象,包含供水泵站的所有基础属性"
+)
+public class WaterPumpStation {
+
+    @ApiModelProperty(
+            value = "主键ID",
+            example = "0",
+            position = 1,
+            notes = "数据库自增主键,新增时不需要传入"
+    )
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    @ApiModelProperty(
+            value = "泵站编号",
+            example = "PS001",
+            required = true,
+            position = 2,
+            notes = "泵站唯一标识,系统内唯一"
+    )
+    private String stationCode;
+
+    @ApiModelProperty(
+            value = "泵站名称",
+            example = "xx加压泵站1",
+            required = true,
+            position = 3,
+            notes = "泵站的中文名称,用于显示"
+    )
+    private String stationName;
+
+    @ApiModelProperty(
+            value = "泵站地址",
+            example = "xx大道123号",
+            position = 4,
+            notes = "泵站的详细地理位置"
+    )
+    private String location;
+
+    @ApiModelProperty(
+            value = "水泵数量",
+            example = "4",
+            position = 5,
+            notes = "泵站内安装的水泵总台数"
+    )
+    private Integer pumpCount;
+
+    @ApiModelProperty(
+            value = "设计流量",
+            example = "500.00",
+            position = 6,
+            notes = "泵站设计最大供水流量,单位:立方米/小时(m³/h)"
+    )
+    private BigDecimal designFlow;
+
+    @ApiModelProperty(
+            value = "设计扬程",
+            example = "60.00",
+            position = 7,
+            notes = "泵站设计最大供水扬程,单位:米(m)"
+    )
+    private BigDecimal designHead;
+
+    @ApiModelProperty(
+            value = "装机容量",
+            example = "200.00",
+            position = 8,
+            notes = "泵站所有水泵总装机功率,单位:千瓦(kW)"
+    )
+    private BigDecimal powerCapacity;
+
+    @ApiModelProperty(
+            value = "投运日期",
+            example = "2026-05-18",
+            position = 9,
+            notes = "泵站正式投入运行的日期"
+    )
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate commissionDate;
+
+    @ApiModelProperty(
+            value = "运行状态",
+            example = "0",
+            allowableValues = "0,1,2",
+            position = 10,
+            notes = "0-正常运行,1-故障停运,2-检修中"
+    )
+    private String status;
+
+    @ApiModelProperty(
+            value = "负责人",
+            example = "张三",
+            position = 11,
+            notes = "泵站日常运维负责人姓名"
+    )
+    private String principal;
+
+    @ApiModelProperty(
+            value = "联系电话",
+            example = "13800138000",
+            position = 12,
+            notes = "负责人联系电话"
+    )
+    private String contactPhone;
+
+    @ApiModelProperty(
+            value = "备注",
+            example = "片区主要加压泵站",
+            position = 13,
+            notes = "其他补充说明信息"
+    )
+    private String remark;
+
+    @ApiModelProperty(
+            value = "删除标志",
+            example = "0",
+            allowableValues = "0,2",
+            hidden = true,
+            position = 14,
+            notes = "0-正常存在,2-已删除(逻辑删除)"
+    )
+    @TableLogic
+    private String delFlag;
+
+    @ApiModelProperty(
+            value = "创建者",
+            example = "admin",
+            hidden = true,
+            position = 15,
+            notes = "创建该记录的用户账号"
+    )
+    @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT)
+    private String createBy;
+
+    @ApiModelProperty(
+            value = "创建时间",
+            example = "2026-05-18 10:00:00",
+            hidden = true,
+            position = 16,
+            notes = "记录创建的时间"
+    )
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT)
+    private LocalDateTime createTime;
+
+    @ApiModelProperty(
+            value = "更新者",
+            example = "admin",
+            hidden = true,
+            position = 17,
+            notes = "最后修改该记录的用户账号"
+    )
+    @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.UPDATE)
+    private String updateBy;
+
+    @ApiModelProperty(
+            value = "更新时间",
+            example = "2026-05-18 14:00:00",
+            hidden = true,
+            position = 18,
+            notes = "记录最后修改的时间"
+    )
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.UPDATE)
+    private LocalDateTime updateTime;
+}

+ 38 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/WaterSupply/WaterPumpStation/mapper/WaterPumpStationMapper.java

@@ -0,0 +1,38 @@
+package com.zksy.WaterSupply.WaterPumpStation.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zksy.WaterSupply.WaterPumpStation.domain.WaterPumpStation;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Update;
+
+import java.util.List;
+
+public interface WaterPumpStationMapper extends BaseMapper<WaterPumpStation> {
+
+    /**
+     * 条件查询泵站列表
+     */
+    List<WaterPumpStation> selectStationList(
+            @Param("stationCode") String stationCode,
+            @Param("stationName") String stationName,
+            @Param("status") String status,
+            @Param("principal") String principal);
+
+    /**
+     * 查询已删除的泵站数据
+     */
+    List<WaterPumpStation> selectDeletedList(
+            @Param("stationCode") String stationCode,
+            @Param("stationName") String stationName,
+            @Param("status") String status);
+
+    /**
+     * 批量恢复已删除数据
+     */
+    int restoreByIds(@Param("ids") List<Long> ids, @Param("updateBy") String updateBy);
+
+    /**
+     * 批量彻底物理删除数据
+     */
+    int deleteByIdsPhysically(@Param("ids") List<Long> ids);
+}

+ 38 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/WaterSupply/WaterPumpStation/service/IWaterPumpStationService.java

@@ -0,0 +1,38 @@
+package com.zksy.WaterSupply.WaterPumpStation.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zksy.WaterSupply.WaterPumpStation.domain.WaterPumpStation;
+
+import java.util.List;
+
+public interface IWaterPumpStationService extends IService<WaterPumpStation> {
+
+    /**
+     * 分页查询泵站数据
+     */
+    IPage<WaterPumpStation> queryPage(Page<WaterPumpStation> page,
+                                      String stationCode,
+                                      String stationName,
+                                      String status,
+                                      String principal);
+
+    /**
+     * 分页查询回收站数据
+     */
+    IPage<WaterPumpStation> queryDeletedPage(Page<WaterPumpStation> page,
+                                             String stationCode,
+                                             String stationName,
+                                             String status);
+
+    /**
+     * 批量恢复已删除数据
+     */
+    boolean restoreByIds(List<Long> ids, String updateBy);
+
+    /**
+     * 批量彻底物理删除数据
+     */
+    boolean deleteByIdsPhysically(List<Long> ids);
+}

+ 55 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/WaterSupply/WaterPumpStation/service/impl/WaterPumpStationServiceImpl.java

@@ -0,0 +1,55 @@
+package com.zksy.WaterSupply.WaterPumpStation.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zksy.WaterSupply.WaterPumpStation.domain.WaterPumpStation;
+import com.zksy.WaterSupply.WaterPumpStation.mapper.WaterPumpStationMapper;
+import com.zksy.WaterSupply.WaterPumpStation.service.IWaterPumpStationService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class WaterPumpStationServiceImpl extends ServiceImpl<WaterPumpStationMapper, WaterPumpStation>
+        implements IWaterPumpStationService {
+
+    @Override
+    public IPage<WaterPumpStation> queryPage(Page<WaterPumpStation> page,
+                                             String stationCode,
+                                             String stationName,
+                                             String status,
+                                             String principal) {
+        List<WaterPumpStation> list = baseMapper.selectStationList(stationCode, stationName, status, principal);
+        page.setRecords(list);
+        page.setTotal(list.size());
+        return page;
+    }
+
+    @Override
+    public IPage<WaterPumpStation> queryDeletedPage(Page<WaterPumpStation> page,
+                                                    String stationCode,
+                                                    String stationName,
+                                                    String status) {
+        List<WaterPumpStation> list = baseMapper.selectDeletedList(stationCode, stationName, status);
+        page.setRecords(list);
+        page.setTotal(list.size());
+        return page;
+    }
+
+    @Override
+    public boolean restoreByIds(List<Long> ids, String updateBy) {
+        if (ids == null || ids.isEmpty()) {
+            return false;
+        }
+        return baseMapper.restoreByIds(ids, updateBy) > 0;
+    }
+
+    @Override
+    public boolean deleteByIdsPhysically(List<Long> ids) {
+        if (ids == null || ids.isEmpty()) {
+            return false;
+        }
+        return baseMapper.deleteByIdsPhysically(ids) > 0;
+    }
+}

+ 87 - 0
pipe-network-service/zksy-system/src/main/resources/mapper/WaterSupply/WaterPumpStation/WaterPumpStationMapper.xml

@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zksy.WaterSupply.WaterPumpStation.mapper.WaterPumpStationMapper">
+
+    <resultMap id="BaseResultMap" type="com.zksy.WaterSupply.WaterPumpStation.domain.WaterPumpStation">
+        <id column="id" property="id" />
+        <result column="station_code" property="stationCode" />
+        <result column="station_name" property="stationName" />
+        <result column="location" property="location" />
+        <result column="pump_count" property="pumpCount" />
+        <result column="design_flow" property="designFlow" />
+        <result column="design_head" property="designHead" />
+        <result column="power_capacity" property="powerCapacity" />
+        <result column="commission_date" property="commissionDate" />
+        <result column="status" property="status" />
+        <result column="principal" property="principal" />
+        <result column="contact_phone" property="contactPhone" />
+        <result column="remark" property="remark" />
+        <result column="del_flag" property="delFlag" />
+        <result column="create_by" property="createBy" />
+        <result column="create_time" property="createTime" />
+        <result column="update_by" property="updateBy" />
+        <result column="update_time" property="updateTime" />
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id, station_code, station_name, location, pump_count, design_flow, design_head,
+        power_capacity, commission_date, status, principal, contact_phone, remark,
+        del_flag, create_by, create_time, update_by, update_time
+    </sql>
+
+    <!-- 条件查询泵站列表 -->
+    <select id="selectStationList" resultMap="BaseResultMap">
+        SELECT <include refid="Base_Column_List"/>
+        FROM water_pump_station
+        WHERE del_flag = '0'
+        <if test="stationCode != null and stationCode != ''">
+            AND station_code LIKE CONCAT('%', #{stationCode}, '%')
+        </if>
+        <if test="stationName != null and stationName != ''">
+            AND station_name LIKE CONCAT('%', #{stationName}, '%')
+        </if>
+        <if test="status != null and status != ''">
+            AND status = #{status}
+        </if>
+        <if test="principal != null and principal != ''">
+            AND principal LIKE CONCAT('%', #{principal}, '%')
+        </if>
+        ORDER BY create_time DESC
+    </select>
+
+    <!-- 回收站SQL -->
+    <select id="selectDeletedList" resultMap="BaseResultMap">
+        SELECT <include refid="Base_Column_List"/>
+        FROM water_pump_station
+        WHERE del_flag = '2'
+        <if test="stationCode != null and stationCode != ''">
+            AND station_code LIKE CONCAT('%', #{stationCode}, '%')
+        </if>
+        <if test="stationName != null and stationName != ''">
+            AND station_name LIKE CONCAT('%', #{stationName}, '%')
+        </if>
+        <if test="status != null and status != ''">
+            AND status = #{status}
+        </if>
+        ORDER BY update_time DESC
+    </select>
+
+    <update id="restoreByIds">
+        UPDATE water_pump_station
+        SET del_flag = '0',
+        update_by = #{updateBy},
+        update_time = NOW()
+        WHERE id IN
+        <foreach collection="ids" item="id" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+    <delete id="deleteByIdsPhysically">
+        DELETE FROM water_pump_station WHERE id IN
+        <foreach collection="ids" item="id" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+</mapper>