Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
18个文件已修改
17个文件已添加
2个文件已删除
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | |
| | | int updateByPrimaryKey(IrGroupClient record); |
| | | |
| | | /** |
| | | * 根据农户编号获取轮灌组列表 |
| | | * @param clientId |
| | | * 根据农户编号获取轮灌组数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoGroupSimple> getGroupsByClientId(Long clientId); |
| | | Long getGroupCountByClientId(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据农户编号获取轮灌组列表 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoGroupSimple> getGroupsByClientId(Map<?, ?> params); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigateGroup; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigateUnit; |
| | | import com.dy.pipIrrGlobal.voIr.VoGroup; |
| | | import com.dy.pipIrrGlobal.voIr.VoGroupOne; |
| | | import com.dy.pipIrrGlobal.voIr.VoUnit; |
| | | import com.dy.pipIrrGlobal.voIr.VoUnitOne; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | |
| | | * @return |
| | | */ |
| | | List<VoGroup> getIrrigateGroups(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据轮灌组编号获取取水口列表 |
| | | * @param groupId |
| | | * @return |
| | | */ |
| | | List<Long> getIntakesByGroupId(Long groupId); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoIr; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigatePlan; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-02-20 15:33 |
| | | * @LastEditTime 2025-02-20 15:33 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface IrIrrigatePlanMapper extends BaseMapper<IrIrrigatePlan> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(IrIrrigatePlan record); |
| | | |
| | | int insertSelective(IrIrrigatePlan record); |
| | | |
| | | IrIrrigatePlan selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(IrIrrigatePlan record); |
| | | |
| | | int updateByPrimaryKey(IrIrrigatePlan record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoIr; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigateSchedule; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-02-20 15:35 |
| | | * @LastEditTime 2025-02-20 15:35 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface IrIrrigateScheduleMapper extends BaseMapper<IrIrrigateSchedule> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(IrIrrigateSchedule record); |
| | | |
| | | int insertSelective(IrIrrigateSchedule record); |
| | | |
| | | IrIrrigateSchedule selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(IrIrrigateSchedule record); |
| | | |
| | | int updateByPrimaryKey(IrIrrigateSchedule record); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigateUnit; |
| | | import com.dy.pipIrrGlobal.voIr.VoProject; |
| | | import com.dy.pipIrrGlobal.voIr.VoProjectOne; |
| | | import com.dy.pipIrrGlobal.voIr.VoUnit; |
| | | import com.dy.pipIrrGlobal.voIr.VoUnitOne; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | * @return |
| | | */ |
| | | List<VoUnit> getUnits(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据灌溉单元ID获取取水口ID |
| | | * @param unitId |
| | | * @return |
| | | */ |
| | | Long getIntakeIdByUnitId(Long unitId); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoIr; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrOpeningSchedule; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-02-20 15:35 |
| | | * @LastEditTime 2025-02-20 15:35 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface IrOpeningScheduleMapper extends BaseMapper<IrOpeningSchedule> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(IrOpeningSchedule record); |
| | | |
| | | int insertSelective(IrOpeningSchedule record); |
| | | |
| | | IrOpeningSchedule selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(IrOpeningSchedule record); |
| | | |
| | | int updateByPrimaryKey(IrOpeningSchedule record); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrUnitClient; |
| | | import com.dy.pipIrrGlobal.voIr.VoUnitSimple; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | |
| | | |
| | | int updateByPrimaryKey(IrUnitClient record); |
| | | |
| | | /** |
| | | * 根据农户编号获取灌溉单元数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getUnitCountByClientId(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据农户编号获取灌溉单元列表 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoUnitSimple> getUnitsByClientId(Map<?, ?> params); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoIr; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-02-20 15:33 |
| | | * @LastEditTime 2025-02-20 15:33 |
| | | * @Description 灌溉计划实体类 |
| | | */ |
| | | |
| | | @TableName(value="ir_irrigate_plan", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class IrIrrigatePlan implements BaseEntity { |
| | | public static final long serialVersionUID = 202502201543001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 项目ID |
| | | */ |
| | | private Long projectId; |
| | | |
| | | /** |
| | | * 计划名称 |
| | | */ |
| | | @NotBlank(message = "计划名称不能为空") |
| | | private String planName; |
| | | |
| | | /** |
| | | * 计划启动模式;1-手动启动,2-自动启动 |
| | | */ |
| | | @NotNull(message = "计划启动模式不能为空") |
| | | private Byte startupMode; |
| | | |
| | | /** |
| | | * 灌溉开始时间;精确到分 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date planStartTime; |
| | | |
| | | /** |
| | | * 灌溉结束时间;精确到分 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date planStopTime; |
| | | |
| | | /** |
| | | * 计划状态;1-草稿,2-已发布 |
| | | */ |
| | | private Byte planState; |
| | | |
| | | /** |
| | | * 执行状态;1-未执行,2-执行中,3-已暂停,4-已终止,5-已完成 |
| | | */ |
| | | private Byte executingState; |
| | | |
| | | /** |
| | | * 逻辑删除标识;未删除为0,已删除为删除时间 |
| | | */ |
| | | private Long deleted; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoIr; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-02-20 15:35 |
| | | * @LastEditTime 2025-02-20 15:35 |
| | | * @Description 灌溉次序实体类 |
| | | */ |
| | | |
| | | @TableName(value="ir_irrigate_schedule", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class IrIrrigateSchedule implements BaseEntity { |
| | | public static final long serialVersionUID = 202502201601001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 灌溉计划ID |
| | | */ |
| | | @NotNull(message = "灌溉计划ID不能为空") |
| | | private Long planId; |
| | | |
| | | /** |
| | | * 轮灌组ID |
| | | */ |
| | | private Long groupId; |
| | | |
| | | /** |
| | | * 灌溉单元ID |
| | | */ |
| | | private Long unitId; |
| | | |
| | | /** |
| | | * 灌溉开始时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @NotNull(message = "灌溉开始时间不能为空") |
| | | private Date startTime; |
| | | |
| | | /** |
| | | * 灌溉结束时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @NotNull(message ="灌溉结束时间不能为空") |
| | | private Date stopTime; |
| | | |
| | | /** |
| | | * 取水口ID列表 |
| | | */ |
| | | private String intakeIds; |
| | | |
| | | /** |
| | | * 当前状态;1-正常,2-暂停,3-终止 |
| | | */ |
| | | private Byte currentState; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoIr; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-02-20 15:35 |
| | | * @LastEditTime 2025-02-20 15:35 |
| | | * @Description 开阀计划实体类 |
| | | */ |
| | | |
| | | @TableName(value="ir_opening_schedule", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class IrOpeningSchedule implements BaseEntity { |
| | | public static final long serialVersionUID = 202502201600001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 灌溉次序ID |
| | | */ |
| | | @NotNull(message = "灌溉次序ID不能为空") |
| | | private Long scheduleId; |
| | | |
| | | /** |
| | | * 开阀时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @NotNull(message = "开阀时间不能为空") |
| | | private Date startTime; |
| | | |
| | | /** |
| | | * 灌溉时长;分钟 |
| | | */ |
| | | @NotNull(message = "灌溉时长不能为空") |
| | | private Integer duration; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voIr; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-02-20 11:01 |
| | | * @LastEditTime 2025-02-20 11:01 |
| | | * @Description 灌溉单元简单视图对象 |
| | | */ |
| | | |
| | | @Data |
| | | @JsonPropertyOrder({"unitId", "intakeNo", "remarks"}) |
| | | public class VoUnitSimple implements BaseEntity { |
| | | public static final long serialVersionUID = 202502201102001L; |
| | | |
| | | /** |
| | | * 灌溉单元ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long unitId; |
| | | |
| | | /** |
| | | * 取水口编码 |
| | | */ |
| | | private String intakeNo; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remarks; |
| | | } |
| | |
| | | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serial; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | */ |
| | | |
| | | @Data |
| | | @JsonPropertyOrder({ "intakeId", "rtuAddr", "intakeNum", "isOnLine"}) |
| | | @JsonPropertyOrder({ "intakeId", "rtuAddr", "intakeNum", "isOnLine", "isBinded", "alarm" ,"instantAmount", "totalAmount"}) |
| | | public class VoOnLineIntake implements BaseEntity { |
| | | private static final long serialVersionUID = 202405271703001L; |
| | | |
| | |
| | | private Double lat; |
| | | |
| | | /** |
| | | * 瞬时流量 |
| | | */ |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double instantAmount; |
| | | |
| | | /** |
| | | * 累计流量 |
| | | */ |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | |
| | | #name: ym |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://192.168.40.166:3306/pipIrr_mj?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | # url: jdbc:mysql://192.168.40.166:3306/pipIrr_mj?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | # url: jdbc:mysql://8.130.130.233:3306/pipIrr_mj?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | # url: jdbc:mysql://127.0.0.1:3306/pipIrr_mj?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | url: jdbc:mysql://127.0.0.1:3306/pipIrr_mj?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | username: root |
| | | password: dysql,;.abc!@# |
| | | druid: |
| | |
| | | #name: ym |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://192.168.40.166:3306/pipIrr_mq?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | # url: jdbc:mysql://192.168.40.166:3306/pipIrr_mq?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | # url: jdbc:mysql://8.130.130.233:3306/pipIrr_mq?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | # url: jdbc:mysql://127.0.0.1:3306/pipIrr_mq?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | url: jdbc:mysql://127.0.0.1:3306/pipIrr_mq?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | username: root |
| | | password: dysql,;.abc!@# |
| | | druid: |
| | |
| | | #name: sp |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://192.168.40.166:3306/pipIrr_sp?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | # url: jdbc:mysql://192.168.40.166:3306/pipIrr_sp?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | # url: jdbc:mysql://8.130.130.233:3306/pipIrr_sp?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | # url: jdbc:mysql://127.0.0.1:3306/pipIrr_sp?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | url: jdbc:mysql://127.0.0.1:3306/pipIrr_sp?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | username: root |
| | | password: dysql,;.abc!@# |
| | | druid: |
| | |
| | | #name: test |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://192.168.40.166:3306/pipIrr_test?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | # url: jdbc:mysql://192.168.40.166:3306/pipIrr_test?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | # url: jdbc:mysql://8.130.130.233:3306/pipIrr_test?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | # url: jdbc:mysql://127.0.0.1:3306/pipIrr_test?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | url: jdbc:mysql://127.0.0.1:3306/pipIrr_test?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | username: root |
| | | password: dysql,;.abc!@# |
| | | druid: |
| | |
| | | #name: ym |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://192.168.40.166:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | # url: jdbc:mysql://192.168.40.166:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | # url: jdbc:mysql://8.130.130.233:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | # url: jdbc:mysql://127.0.0.1:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | url: jdbc:mysql://127.0.0.1:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull |
| | | username: root |
| | | password: dysql,;.abc!@# |
| | | druid: |
| | |
| | | <?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.dy.pipIrrGlobal.daoIr.IrGroupClientMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoIr.IrGroupClient"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table ir_group_client--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="group_id" jdbcType="BIGINT" property="groupId" /> |
| | | <result column="client_id" jdbcType="BIGINT" property="clientId" /> |
| | | <result column="operator" jdbcType="BIGINT" property="operator" /> |
| | | <result column="operate_time" jdbcType="TIMESTAMP" property="operateTime" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, group_id, client_id, `operator`, operate_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from ir_group_client |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from ir_group_client |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoIr.IrGroupClient"> |
| | | <!--@mbg.generated--> |
| | | insert into ir_group_client (id, group_id, client_id, |
| | | `operator`, operate_time) |
| | | values (#{id,jdbcType=BIGINT}, #{groupId,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT}, |
| | | #{operator,jdbcType=BIGINT}, #{operateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrGroupClient"> |
| | | <!--@mbg.generated--> |
| | | insert into ir_group_client |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoIr.IrGroupClient"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table ir_group_client--> |
| | | <id column="id" jdbcType="BIGINT" property="id"/> |
| | | <result column="group_id" jdbcType="BIGINT" property="groupId"/> |
| | | <result column="client_id" jdbcType="BIGINT" property="clientId"/> |
| | | <result column="operator" jdbcType="BIGINT" property="operator"/> |
| | | <result column="operate_time" jdbcType="TIMESTAMP" property="operateTime"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, |
| | | </if> |
| | | <if test="groupId != null"> |
| | | group_id, |
| | | </if> |
| | | <if test="clientId != null"> |
| | | client_id, |
| | | </if> |
| | | <if test="operator != null"> |
| | | `operator`, |
| | | </if> |
| | | <if test="operateTime != null"> |
| | | operate_time, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="groupId != null"> |
| | | #{groupId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientId != null"> |
| | | #{clientId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operator != null"> |
| | | #{operator,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operateTime != null"> |
| | | #{operateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrGroupClient"> |
| | | <!--@mbg.generated--> |
| | | update ir_group_client |
| | | <set> |
| | | <if test="groupId != null"> |
| | | group_id = #{groupId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientId != null"> |
| | | client_id = #{clientId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operator != null"> |
| | | `operator` = #{operator,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operateTime != null"> |
| | | operate_time = #{operateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoIr.IrGroupClient"> |
| | | <!--@mbg.generated--> |
| | | update ir_group_client |
| | | set group_id = #{groupId,jdbcType=BIGINT}, |
| | | client_id = #{clientId,jdbcType=BIGINT}, |
| | | `operator` = #{operator,jdbcType=BIGINT}, |
| | | operate_time = #{operateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | operate_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from ir_group_client |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete |
| | | from ir_group_client |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoIr.IrGroupClient"> |
| | | <!--@mbg.generated--> |
| | | insert into ir_group_client (id, group_id, client_id, |
| | | `operator`, operate_time) |
| | | values (#{id,jdbcType=BIGINT}, #{groupId,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT}, |
| | | #{operator,jdbcType=BIGINT}, #{operateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrGroupClient"> |
| | | <!--@mbg.generated--> |
| | | insert into ir_group_client |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="groupId != null"> |
| | | group_id, |
| | | </if> |
| | | <if test="clientId != null"> |
| | | client_id, |
| | | </if> |
| | | <if test="operator != null"> |
| | | `operator`, |
| | | </if> |
| | | <if test="operateTime != null"> |
| | | operate_time, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="groupId != null"> |
| | | #{groupId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientId != null"> |
| | | #{clientId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operator != null"> |
| | | #{operator,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operateTime != null"> |
| | | #{operateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrGroupClient"> |
| | | <!--@mbg.generated--> |
| | | update ir_group_client |
| | | <set> |
| | | <if test="groupId != null"> |
| | | group_id = #{groupId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientId != null"> |
| | | client_id = #{clientId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operator != null"> |
| | | `operator` = #{operator,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operateTime != null"> |
| | | operate_time = #{operateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoIr.IrGroupClient"> |
| | | <!--@mbg.generated--> |
| | | update ir_group_client |
| | | set group_id = #{groupId,jdbcType=BIGINT}, |
| | | client_id = #{clientId,jdbcType=BIGINT}, |
| | | `operator` = #{operator,jdbcType=BIGINT}, |
| | | operate_time = #{operateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--根据农户编号获取轮灌组列表--> |
| | | <select id="getGroupsByClientId" resultType="com.dy.pipIrrGlobal.voIr.VoGroupSimple"> |
| | | SELECT |
| | | grp.id AS groupId, |
| | | grp.group_code AS groupCode |
| | | FROM ir_group_client gc |
| | | INNER JOIN ir_irrigate_group grp ON grp.id = gc.group_id |
| | | WHERE grp.deleted = 0 AND client_id = #{clientId} |
| | | ORDER BY grp.group_code |
| | | </select> |
| | | <!--根据农户编号获取轮灌组数量--> |
| | | <select id="getGroupCountByClientId" resultType="java.lang.Long"> |
| | | SELECT |
| | | count(*) |
| | | FROM ir_irrigate_group grp |
| | | INNER JOIN ir_group_client gc ON gc.group_id = grp.id |
| | | WHERE grp.deleted = 0 AND gc.client_id = #{clientId} |
| | | </select> |
| | | |
| | | <!--根据农户编号获取轮灌组列表--> |
| | | <select id="getGroupsByClientId" resultType="com.dy.pipIrrGlobal.voIr.VoGroupSimple"> |
| | | SELECT |
| | | grp.id AS groupId, |
| | | grp.group_code AS groupCode |
| | | FROM ir_irrigate_group grp |
| | | INNER JOIN ir_group_client gc ON gc.group_id = grp.id |
| | | WHERE grp.deleted = 0 AND gc.client_id = #{clientId} |
| | | ORDER BY grp.group_code |
| | | <trim prefix="limit "> |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | </mapper> |
| | |
| | | GROUP BY gro.id |
| | | ) a |
| | | </select> |
| | | |
| | | <!--根据轮灌组编号获取取水口列表--> |
| | | <select id="getIntakesByGroupId" resultType="java.lang.Long"> |
| | | SELECT |
| | | uni.intake_id AS intakeId |
| | | FROM ir_irrigate_group grp |
| | | INNER JOIN ir_group_unit gu ON gu.group_id = grp.id |
| | | INNER JOIN ir_irrigate_unit uni ON uni.id = gu.unit_id |
| | | WHERE grp.deleted = 0 AND grp.id = #{groupId} |
| | | |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?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.dy.pipIrrGlobal.daoIr.IrIrrigatePlanMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoIr.IrIrrigatePlan"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table ir_irrigate_plan--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="project_id" jdbcType="BIGINT" property="projectId" /> |
| | | <result column="plan_name" jdbcType="VARCHAR" property="planName" /> |
| | | <result column="startup_mode" jdbcType="TINYINT" property="startupMode" /> |
| | | <result column="plan_start_time" jdbcType="TIMESTAMP" property="planStartTime" /> |
| | | <result column="plan_stop_time" jdbcType="TIMESTAMP" property="planStopTime" /> |
| | | <result column="plan_state" jdbcType="TINYINT" property="planState" /> |
| | | <result column="executing_state" jdbcType="TINYINT" property="executingState" /> |
| | | <result column="deleted" jdbcType="BIGINT" property="deleted" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, project_id, plan_name, startup_mode, plan_start_time, plan_stop_time, plan_state, |
| | | executing_state, deleted |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from ir_irrigate_plan |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from ir_irrigate_plan |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIrrigatePlan"> |
| | | <!--@mbg.generated--> |
| | | insert into ir_irrigate_plan (id, project_id, plan_name, |
| | | startup_mode, plan_start_time, plan_stop_time, |
| | | plan_state, executing_state, deleted |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, #{planName,jdbcType=VARCHAR}, |
| | | #{startupMode,jdbcType=TINYINT}, #{planStartTime,jdbcType=TIMESTAMP}, #{planStopTime,jdbcType=TIMESTAMP}, |
| | | #{planState,jdbcType=TINYINT}, #{executingState,jdbcType=TINYINT}, #{deleted,jdbcType=BIGINT} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIrrigatePlan"> |
| | | <!--@mbg.generated--> |
| | | insert into ir_irrigate_plan |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="projectId != null"> |
| | | project_id, |
| | | </if> |
| | | <if test="planName != null"> |
| | | plan_name, |
| | | </if> |
| | | <if test="startupMode != null"> |
| | | startup_mode, |
| | | </if> |
| | | <if test="planStartTime != null"> |
| | | plan_start_time, |
| | | </if> |
| | | <if test="planStopTime != null"> |
| | | plan_stop_time, |
| | | </if> |
| | | <if test="planState != null"> |
| | | plan_state, |
| | | </if> |
| | | <if test="executingState != null"> |
| | | executing_state, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="projectId != null"> |
| | | #{projectId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="planName != null"> |
| | | #{planName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="startupMode != null"> |
| | | #{startupMode,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="planStartTime != null"> |
| | | #{planStartTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="planStopTime != null"> |
| | | #{planStopTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="planState != null"> |
| | | #{planState,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="executingState != null"> |
| | | #{executingState,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | #{deleted,jdbcType=BIGINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIrrigatePlan"> |
| | | <!--@mbg.generated--> |
| | | update ir_irrigate_plan |
| | | <set> |
| | | <if test="projectId != null"> |
| | | project_id = #{projectId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="planName != null"> |
| | | plan_name = #{planName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="startupMode != null"> |
| | | startup_mode = #{startupMode,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="planStartTime != null"> |
| | | plan_start_time = #{planStartTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="planStopTime != null"> |
| | | plan_stop_time = #{planStopTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="planState != null"> |
| | | plan_state = #{planState,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="executingState != null"> |
| | | executing_state = #{executingState,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=BIGINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIrrigatePlan"> |
| | | <!--@mbg.generated--> |
| | | update ir_irrigate_plan |
| | | set project_id = #{projectId,jdbcType=BIGINT}, |
| | | plan_name = #{planName,jdbcType=VARCHAR}, |
| | | startup_mode = #{startupMode,jdbcType=TINYINT}, |
| | | plan_start_time = #{planStartTime,jdbcType=TIMESTAMP}, |
| | | plan_stop_time = #{planStopTime,jdbcType=TIMESTAMP}, |
| | | plan_state = #{planState,jdbcType=TINYINT}, |
| | | executing_state = #{executingState,jdbcType=TINYINT}, |
| | | deleted = #{deleted,jdbcType=BIGINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | <?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.dy.pipIrrGlobal.daoIr.IrIrrigateScheduleMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoIr.IrIrrigateSchedule"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table ir_irrigate_schedule--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="plan_id" jdbcType="BIGINT" property="planId" /> |
| | | <result column="group_id" jdbcType="BIGINT" property="groupId" /> |
| | | <result column="unit_id" jdbcType="BIGINT" property="unitId" /> |
| | | <result column="start_time" jdbcType="TIMESTAMP" property="startTime" /> |
| | | <result column="stop_time" jdbcType="TIMESTAMP" property="stopTime" /> |
| | | <result column="intake_ids" jdbcType="VARCHAR" property="intakeIds" /> |
| | | <result column="current_state" jdbcType="TINYINT" property="currentState" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, plan_id, group_id, unit_id, start_time, stop_time, intake_ids, current_state |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from ir_irrigate_schedule |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from ir_irrigate_schedule |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIrrigateSchedule"> |
| | | <!--@mbg.generated--> |
| | | insert into ir_irrigate_schedule (id, plan_id, group_id, |
| | | unit_id, start_time, stop_time, |
| | | intake_ids, current_state) |
| | | values (#{id,jdbcType=BIGINT}, #{planId,jdbcType=BIGINT}, #{groupId,jdbcType=BIGINT}, |
| | | #{unitId,jdbcType=BIGINT}, #{startTime,jdbcType=TIMESTAMP}, #{stopTime,jdbcType=TIMESTAMP}, |
| | | #{intakeIds,jdbcType=VARCHAR}, #{currentState,jdbcType=TINYINT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIrrigateSchedule"> |
| | | <!--@mbg.generated--> |
| | | insert into ir_irrigate_schedule |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="planId != null"> |
| | | plan_id, |
| | | </if> |
| | | <if test="groupId != null"> |
| | | group_id, |
| | | </if> |
| | | <if test="unitId != null"> |
| | | unit_id, |
| | | </if> |
| | | <if test="startTime != null"> |
| | | start_time, |
| | | </if> |
| | | <if test="stopTime != null"> |
| | | stop_time, |
| | | </if> |
| | | <if test="intakeIds != null"> |
| | | intake_ids, |
| | | </if> |
| | | <if test="currentState != null"> |
| | | current_state, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="planId != null"> |
| | | #{planId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="groupId != null"> |
| | | #{groupId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="unitId != null"> |
| | | #{unitId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="startTime != null"> |
| | | #{startTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="stopTime != null"> |
| | | #{stopTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="intakeIds != null"> |
| | | #{intakeIds,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="currentState != null"> |
| | | #{currentState,jdbcType=TINYINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIrrigateSchedule"> |
| | | <!--@mbg.generated--> |
| | | update ir_irrigate_schedule |
| | | <set> |
| | | <if test="planId != null"> |
| | | plan_id = #{planId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="groupId != null"> |
| | | group_id = #{groupId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="unitId != null"> |
| | | unit_id = #{unitId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="startTime != null"> |
| | | start_time = #{startTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="stopTime != null"> |
| | | stop_time = #{stopTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="intakeIds != null"> |
| | | intake_ids = #{intakeIds,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="currentState != null"> |
| | | current_state = #{currentState,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIrrigateSchedule"> |
| | | <!--@mbg.generated--> |
| | | update ir_irrigate_schedule |
| | | set plan_id = #{planId,jdbcType=BIGINT}, |
| | | group_id = #{groupId,jdbcType=BIGINT}, |
| | | unit_id = #{unitId,jdbcType=BIGINT}, |
| | | start_time = #{startTime,jdbcType=TIMESTAMP}, |
| | | stop_time = #{stopTime,jdbcType=TIMESTAMP}, |
| | | intake_ids = #{intakeIds,jdbcType=VARCHAR}, |
| | | current_state = #{currentState,jdbcType=TINYINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据灌溉单元ID获取取水口ID--> |
| | | <select id="getIntakeIdByUnitId" resultType="java.lang.Long"> |
| | | SELECT |
| | | intake_id AS intakeId |
| | | FROM ir_irrigate_unit |
| | | WHERE deleted = 0 AND id = #{unitId} |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?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.dy.pipIrrGlobal.daoIr.IrOpeningScheduleMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoIr.IrOpeningSchedule"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table ir_opening_schedule--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="schedule_id" jdbcType="BIGINT" property="scheduleId" /> |
| | | <result column="start_time" jdbcType="TIMESTAMP" property="startTime" /> |
| | | <result column="duration" jdbcType="INTEGER" property="duration" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, schedule_id, start_time, duration |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from ir_opening_schedule |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from ir_opening_schedule |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoIr.IrOpeningSchedule"> |
| | | <!--@mbg.generated--> |
| | | insert into ir_opening_schedule (id, schedule_id, start_time, |
| | | duration) |
| | | values (#{id,jdbcType=BIGINT}, #{scheduleId,jdbcType=BIGINT}, #{startTime,jdbcType=TIMESTAMP}, |
| | | #{duration,jdbcType=INTEGER}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrOpeningSchedule"> |
| | | <!--@mbg.generated--> |
| | | insert into ir_opening_schedule |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="scheduleId != null"> |
| | | schedule_id, |
| | | </if> |
| | | <if test="startTime != null"> |
| | | start_time, |
| | | </if> |
| | | <if test="duration != null"> |
| | | duration, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="scheduleId != null"> |
| | | #{scheduleId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="startTime != null"> |
| | | #{startTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="duration != null"> |
| | | #{duration,jdbcType=INTEGER}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrOpeningSchedule"> |
| | | <!--@mbg.generated--> |
| | | update ir_opening_schedule |
| | | <set> |
| | | <if test="scheduleId != null"> |
| | | schedule_id = #{scheduleId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="startTime != null"> |
| | | start_time = #{startTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="duration != null"> |
| | | duration = #{duration,jdbcType=INTEGER}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoIr.IrOpeningSchedule"> |
| | | <!--@mbg.generated--> |
| | | update ir_opening_schedule |
| | | set schedule_id = #{scheduleId,jdbcType=BIGINT}, |
| | | start_time = #{startTime,jdbcType=TIMESTAMP}, |
| | | duration = #{duration,jdbcType=INTEGER} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | operate_time = #{operateTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--根据农户编号获取灌溉单元数量--> |
| | | <select id="getUnitCountByClientId" resultType="java.lang.Long"> |
| | | SELECT |
| | | count(*) |
| | | FROM ir_irrigate_unit uni |
| | | INNER JOIN pr_intake inta ON inta.id = uni.intake_id |
| | | INNER JOIN ir_unit_client uc ON uc.unit_id = uni.id |
| | | WHERE uni.deleted = 0 AND uc.client_id = #{clientId} |
| | | </select> |
| | | |
| | | <!--根据农户编号获取灌溉单元列表--> |
| | | <select id="getUnitsByClientId" resultType="com.dy.pipIrrGlobal.voIr.VoUnitSimple"> |
| | | SELECT |
| | | uni.id AS unitId, |
| | | inta.`name` AS intakeNo, |
| | | uni.remarks |
| | | FROM ir_irrigate_unit uni |
| | | INNER JOIN pr_intake inta ON inta.id = uni.intake_id |
| | | INNER JOIN ir_unit_client uc ON uc.unit_id = uni.id |
| | | WHERE uni.deleted = 0 AND uc.client_id = #{clientId} |
| | | ORDER BY uni.id |
| | | <trim prefix="limit "> |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | </mapper> |
| | |
| | | ba_user.`name` AS inspectorName, |
| | | oi.id AS inspectId, |
| | | oi.start_time AS startTime, |
| | | oi.stop_time AS stopTime |
| | | oi.stop_time AS stopTime, |
| | | oi.inspect_distance AS inspectDistance |
| | | FROM `ope_inspect` oi |
| | | INNER JOIN `ba_user` ON oi.inspector_id = ba_user.id |
| | | <where> |
| | |
| | | inta.name AS intakeNum, |
| | | inta.lng, |
| | | inta.lat, |
| | | IFNULL(hou.instant_amount, 0) AS instantAmount, |
| | | IFNULL(hou.total_amount, 0) AS totalAmount, |
| | | <if test="onLineMap != null and onLineMap !='' and isOnLine != null"> |
| | | rtus.isOnLine, |
| | |
| | | //完善查询充值记录的起止时间 |
| | | String timeStart = queryVo.getTimeStart(); |
| | | String timeStop = queryVo.getTimeStop(); |
| | | if (timeStart != null && timeStart != "") { |
| | | |
| | | if (timeStart == null || timeStart == "" || timeStop == null || timeStop == "") { |
| | | queryVo.setTimeStart(null); |
| | | queryVo.setTimeStop(null); |
| | | } else { |
| | | timeStart = timeStart + " 00:00:00"; |
| | | queryVo.setTimeStart(timeStart); |
| | | } |
| | | if (timeStop != null && timeStop != "") { |
| | | timeStop = timeStop + " 23:59:59"; |
| | | queryVo.setTimeStop(timeStop); |
| | | } |
| | |
| | | }) |
| | | } |
| | | ) |
| | | @MapperScan(basePackages={"com.dy.pipIrrGlobal.daoRm", "com.dy.pipIrrGlobal.daoPr", "com.dy.pipIrrGlobal.daoSe", "com.dy.pipIrrGlobal.daoBa","com.dy.pipIrrGlobal.daoFi"}) |
| | | @MapperScan(basePackages={"com.dy.pipIrrGlobal.daoRm", "com.dy.pipIrrGlobal.daoPr", "com.dy.pipIrrGlobal.daoSe", "com.dy.pipIrrGlobal.daoBa","com.dy.pipIrrGlobal.daoFi", "com.dy.pipIrrGlobal.daoIr"}) |
| | | public class PipIrrWechatApplication { |
| | | |
| | | public static void main(String[] args) { |
New file |
| | |
| | | package com.dy.pipIrrWechat.irrigatePlan; |
| | | |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigatePlan; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigateSchedule; |
| | | import com.dy.pipIrrWechat.irrigatePlan.dto.IrrigatePlan; |
| | | import com.dy.pipIrrWechat.irrigatePlan.dto.IrrigateSchedule; |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-02-20 15:27 |
| | | * @LastEditTime 2025-02-20 15:27 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping(path = "plan") |
| | | @RequiredArgsConstructor |
| | | public class IrrigatePlanCtrl { |
| | | private final IrrigatePlanSv irrigatePlanSv; |
| | | |
| | | @PostMapping(path = "createPlan", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public BaseResponse<Boolean> createPlan(@RequestBody @Valid IrrigatePlan planAndSchedule, BindingResult bindingResult){ |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | IrIrrigatePlan plan = new IrIrrigatePlan(); |
| | | plan.setProjectId(planAndSchedule.getProjectId()); |
| | | plan.setPlanName(planAndSchedule.getPlanName()); |
| | | plan.setStartupMode(planAndSchedule.getStartupMode()); |
| | | plan.setPlanStartTime(planAndSchedule.getPlanStartTime()); |
| | | plan.setPlanStopTime(planAndSchedule.getPlanStopTime()); |
| | | plan.setPlanState((byte)1); |
| | | plan.setExecutingState((byte)1); |
| | | plan.setDeleted(0L); |
| | | |
| | | Long planId = irrigatePlanSv.addIrrigatePlan(plan); |
| | | if(planId != null){ |
| | | for(IrrigateSchedule schedule : planAndSchedule.getSchedules()){ |
| | | IrIrrigateSchedule po = new IrIrrigateSchedule(); |
| | | po.setPlanId(planId); |
| | | |
| | | if(planAndSchedule.getIrrigateType() == 1) { |
| | | po.setGroupId(schedule.getIrrigateId()); |
| | | List<Long> intakesData = irrigatePlanSv.getIntakesByGroupId(schedule.getIrrigateId()); |
| | | if(intakesData != null && intakesData.size() > 0){ |
| | | String intakeIds = ""; |
| | | for(Long intakeId : intakesData){ |
| | | intakeIds += intakeId + ","; |
| | | } |
| | | po.setIntakeIds(intakeIds.substring(0, intakeIds.length() - 1)); |
| | | } |
| | | }else { |
| | | po.setUnitId(schedule.getIrrigateId()); |
| | | Long intakeId = irrigatePlanSv.getIntakeIdByUnitId(schedule.getIrrigateId()); |
| | | if(intakeId != null){ |
| | | po.setIntakeIds(intakeId.toString()); |
| | | } |
| | | } |
| | | |
| | | po.setStartTime(schedule.getStartTime()); |
| | | po.setStopTime(schedule.getStopTime()); |
| | | //po.setIntakeIds(schedule.getIntakeIds()); |
| | | po.setCurrentState((byte)1); |
| | | Long scheduleId = irrigatePlanSv.addIrrigateSchedule(po); |
| | | } |
| | | } |
| | | |
| | | |
| | | return BaseResponseUtils.buildSuccess(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrWechat.irrigatePlan; |
| | | |
| | | import com.dy.pipIrrGlobal.daoIr.IrIrrigateGroupMapper; |
| | | import com.dy.pipIrrGlobal.daoIr.IrIrrigatePlanMapper; |
| | | import com.dy.pipIrrGlobal.daoIr.IrIrrigateScheduleMapper; |
| | | import com.dy.pipIrrGlobal.daoIr.IrIrrigateUnitMapper; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigatePlan; |
| | | import com.dy.pipIrrGlobal.pojoIr.IrIrrigateSchedule; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-02-20 15:27 |
| | | * @LastEditTime 2025-02-20 15:27 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class IrrigatePlanSv { |
| | | @Autowired |
| | | private IrIrrigatePlanMapper irrigatePlanMapper; |
| | | |
| | | @Autowired |
| | | private IrIrrigateScheduleMapper irIrrigateScheduleMapper; |
| | | |
| | | @Autowired |
| | | private IrIrrigateGroupMapper irIrrigateGroupMapper; |
| | | |
| | | @Autowired |
| | | private IrIrrigateUnitMapper irIrrigateUnitMapper; |
| | | |
| | | /** |
| | | * 添加灌溉计划记录 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Long addIrrigatePlan(IrIrrigatePlan po) { |
| | | irrigatePlanMapper.insert(po); |
| | | return po.getId(); |
| | | } |
| | | |
| | | /** |
| | | * 添加灌溉次序记录 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Long addIrrigateSchedule(IrIrrigateSchedule po) { |
| | | irIrrigateScheduleMapper.insert(po); |
| | | return po.getId(); |
| | | } |
| | | |
| | | /** |
| | | * 根据轮灌组ID获取取水口ID列表 |
| | | * @param groupId |
| | | * @return |
| | | */ |
| | | public List<Long> getIntakesByGroupId(Long groupId) { |
| | | return irIrrigateGroupMapper.getIntakesByGroupId(groupId); |
| | | } |
| | | |
| | | /** |
| | | * 根据灌溉单元ID获取取水口ID |
| | | * @param unitId |
| | | * @return |
| | | */ |
| | | public Long getIntakeIdByUnitId(Long unitId) { |
| | | return irIrrigateUnitMapper.getIntakeIdByUnitId(unitId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrWechat.irrigatePlan.dto; |
| | | |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-02-20 14:48 |
| | | * @LastEditTime 2025-02-20 14:48 |
| | | * @Description 灌溉计划对象 |
| | | */ |
| | | |
| | | @Data |
| | | public class IrrigatePlan { |
| | | public static final long serialVersionUID = 202502201511001L; |
| | | |
| | | /** |
| | | * 项目ID |
| | | */ |
| | | private Long projectId; |
| | | |
| | | /** |
| | | * 计划名称 |
| | | */ |
| | | @NotBlank(message = "计划名称不能为空") |
| | | private String planName; |
| | | |
| | | /** |
| | | * 计划启动模式;1-手工启动,2-自动启动 |
| | | */ |
| | | @NotNull(message = "计划启动模式不能为空") |
| | | private Byte startupMode; |
| | | |
| | | /** |
| | | * 计划启动时间 |
| | | */ |
| | | private Date planStartTime; |
| | | |
| | | /** |
| | | * 计划停止时间 |
| | | */ |
| | | private Date planStopTime; |
| | | |
| | | /** |
| | | * 灌溉类型;1-轮灌组,2-灌溉单元 |
| | | */ |
| | | @NotNull(message = "灌溉类型不能为空") |
| | | private Byte irrigateType; |
| | | |
| | | /** |
| | | * 灌溉次序 |
| | | */ |
| | | @NotEmpty(message = "巡检轨迹不能为空") |
| | | private List<IrrigateSchedule> schedules; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrWechat.irrigatePlan.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-02-20 15:17 |
| | | * @LastEditTime 2025-02-20 15:17 |
| | | * @Description 灌溉次序对象表 |
| | | */ |
| | | |
| | | @Data |
| | | public class IrrigateSchedule { |
| | | public static final long serialVersionUID = 202502201519001L; |
| | | |
| | | private Long irrigateId; |
| | | |
| | | private Date startTime; |
| | | |
| | | private Date stopTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrWechat.irrigation; |
| | | |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.voIr.VoGroupSimple; |
| | | import com.dy.pipIrrGlobal.voIr.VoUnitSimple; |
| | | import com.dy.pipIrrWechat.irrigation.qo.QoClient; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-02-20 8:59 |
| | | * @LastEditTime 2025-02-20 8:59 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping(path = "irrigation") |
| | | @RequiredArgsConstructor |
| | | public class IrrigationCtrl { |
| | | private final IrrigationSv irrigationSv; |
| | | |
| | | /** |
| | | * 根据农户编号获取轮灌组列表 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getGroups") |
| | | public BaseResponse<QueryResultVo<List<VoGroupSimple>>> getGroups(QoClient vo) { |
| | | try { |
| | | QueryResultVo<List<VoGroupSimple>> res = irrigationSv.getGroupsByClientId(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取轮灌组记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据农户编号获取灌溉单元列表 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getUnits") |
| | | public BaseResponse<QueryResultVo<List<VoUnitSimple>>> getUnits(QoClient vo) { |
| | | try { |
| | | QueryResultVo<List<VoUnitSimple>> res = irrigationSv.getUnitsByClientId(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取灌溉单元记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrWechat.irrigation; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoIr.IrGroupClientMapper; |
| | | import com.dy.pipIrrGlobal.daoIr.IrUnitClientMapper; |
| | | import com.dy.pipIrrGlobal.voIr.VoGroupSimple; |
| | | import com.dy.pipIrrGlobal.voIr.VoUnitSimple; |
| | | import com.dy.pipIrrWechat.irrigation.qo.QoClient; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-02-20 8:59 |
| | | * @LastEditTime 2025-02-20 8:59 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class IrrigationSv { |
| | | @Autowired |
| | | private IrGroupClientMapper irGroupClientMapper; |
| | | |
| | | @Autowired |
| | | private IrUnitClientMapper irUnitClientMapper; |
| | | |
| | | /** |
| | | * 根据农户编号获取轮灌组列表 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoGroupSimple>> getGroupsByClientId(QoClient queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | |
| | | Long itemTotal = irGroupClientMapper.getGroupCountByClientId(params); |
| | | |
| | | QueryResultVo<List<VoGroupSimple>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = queryVo.pageSize; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = irGroupClientMapper.getGroupsByClientId(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | /** |
| | | * 根据农户编号获取灌溉单元列表 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoUnitSimple>> getUnitsByClientId(QoClient queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | |
| | | Long itemTotal = irUnitClientMapper.getUnitCountByClientId(params); |
| | | |
| | | QueryResultVo<List<VoUnitSimple>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = queryVo.pageSize; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = irUnitClientMapper.getUnitsByClientId(params); |
| | | return rsVo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrWechat.irrigation.qo; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2025-02-20 9:40 |
| | | * @LastEditTime 2025-02-20 9:40 |
| | | * @Description 轮灌组、灌溉单元查询对象 |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class QoClient extends QueryConditionVo { |
| | | /** |
| | | * 农户编号 |
| | | */ |
| | | private Long clientId; |
| | | } |