26个文件已修改
20个文件已添加
2个文件已删除
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDayLast; |
| | | import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(RmIntakeAmountDayLast record); |
| | | |
| | | /** |
| | | * 根据指定条件获取记录总数 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoIntakeAmountDay> getIntakeAmountDayLast(Map<?, ?> params); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay; |
| | | import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeAmountStatistics; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | */ |
| | | int updateByPrimaryKey(RmIntakeAmountDay record); |
| | | |
| | | /** |
| | | * 根据指定条件获取记录总数 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 以取水口维度统计取水量 |
| | | * 根据指定条件获取记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoIntakeAmountDay> getIntakeAmountDayHistory(Map<?, ?> params); |
| | | |
| | | |
| | | /** |
| | | * 以取水口维度统计取水口取水量 |
| | | * @param statisticsStartId 统计时间段开始时间对应的ID |
| | | * @param statisticsEndId 统计时间段截止时间对应的ID |
| | | * @return |
| | | */ |
| | | List<VoIntakeAmountStatistics> statisticsByIntake(@Param("startId")Long statisticsStartId, @Param("endId")Long statisticsEndId) ; |
| | | |
| | | |
| | | } |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.voRm.VoLossDay; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmLossDayLast; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(RmLossDayLast record); |
| | | |
| | | /** |
| | | * 根据指定条件获取记录总数 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoLossDay> getLossDayLast(Map<?, ?> params); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmLossDay; |
| | | import com.dy.pipIrrGlobal.voRm.VoLossDay; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author liurunyu |
| | |
| | | RmLossDay selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * select by rtuAddr |
| | | * @param intakeId 控制器所绑取水口ID |
| | | * @return object by rtuAddr |
| | | */ |
| | | List<RmLossDay> selectByIntakeId(Long intakeId) ; |
| | | /** |
| | | /** |
| | | * select by dt |
| | | * @param date 日期(yyyy-mm-dd) |
| | | * @return object by rtuAddr |
| | |
| | | int updateByPrimaryKey(RmLossDay record); |
| | | |
| | | /** |
| | | * 根据指定条件获取记录总数 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoLossDay> getLossDayHistory(Map<?, ?> params); |
| | | |
| | | |
| | | /** |
| | | * 以取水口维度统计漏损量 |
| | | * @param statisticsStartId 统计时间段开始时间对应的ID |
| | | * @param statisticsEndId 统计时间段截止时间对应的ID |
| | | * @return |
| | | */ |
| | | List<VoIntakeLossStatistics> statisticsByIntake(@Param("startId")Long statisticsStartId, @Param("endId")Long statisticsEndId) ; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmOnHourReportHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmOnHourReportLast; |
| | | import com.dy.pipIrrGlobal.voRm.VoOnHour; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(RmOnHourReportHistory record); |
| | | |
| | | /** |
| | | * 根据指定条件获取整点报历史记录数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getOnHourReportsCount_history(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取整点报历史记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoOnHour> getOnHourReports_history(Map<?, ?> params); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoSe; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeManagerCard; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-07-24 10:36 |
| | | * @LastEditTime 2024-07-24 10:36 |
| | | * @Description |
| | | */ |
| | | |
| | | @Mapper |
| | | public interface SeManagerCardMapper extends BaseMapper<SeManagerCard> { |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(SeManagerCard record); |
| | | |
| | | int insertSelective(SeManagerCard record); |
| | | |
| | | SeManagerCard selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(SeManagerCard record); |
| | | |
| | | int updateByPrimaryKey(SeManagerCard record); |
| | | |
| | | /** |
| | | * 根据行政区划串模糊查询管理卡编号 |
| | | * @param areaCode |
| | | * @return |
| | | */ |
| | | String getManagerCardNumOfMax(@Param("areaCode") String areaCode); |
| | | } |
| | |
| | | * @param year 统计年度 |
| | | * @return |
| | | */ |
| | | List<VoIntakeAmountStatistics> statisticsByIntake(Integer year, Integer month, Long startId, Long endId) ; |
| | | /** |
| | | * 以取水口维度统计取水量 |
| | | * @param year 统计年度 |
| | | * @return |
| | | */ |
| | | List<VoIntakeAmountStatistics> statisticsByIntake(Integer year) ; |
| | | } |
| | |
| | | * @LastEditTime 2024/2/28 15:31 |
| | | * @Description 控制器日漏损水量历史数据 |
| | | */ |
| | | @TableName(value="rm_loss_day", autoResultMap = true) |
| | | @TableName(value="rm_loss_history_history", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "取水口日漏损统计") |
| | | @Schema(name = "控制器日漏损水量历史数据 ") |
| | | public class RmLossDay implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202402281620001L; |
| | |
| | | * @LastEditTime 2024/2/28 15:31 |
| | | * @Description 控制器日漏损水量最新数据 |
| | | */ |
| | | @TableName(value="rm_loss_day_last", autoResultMap = true) |
| | | @TableName(value="rm_loss_last_history", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "取水口日漏损最新数据") |
| | | @Schema(name = "控制器日漏损水量最新数据") |
| | | public class RmLossDayLast implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202402281621001L; |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoSe; |
| | | |
| | | 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 org.hibernate.validator.constraints.Length; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-07-24 10:36 |
| | | * @LastEditTime 2024-07-24 10:36 |
| | | * @Description |
| | | */ |
| | | /** |
| | | * 管理员水卡表 |
| | | */ |
| | | |
| | | @TableName(value = "se_manager_card", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class SeManagerCard implements BaseEntity { |
| | | public static final long serialVersionUID = 202407241040001L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 卡片地址 |
| | | */ |
| | | @NotBlank(message = "卡片地址不能为空") |
| | | private String cardAddr; |
| | | |
| | | /** |
| | | * 卡片编号 |
| | | */ |
| | | @NotBlank(message = "卡片编号不能为空") |
| | | private String cardNum; |
| | | |
| | | /** |
| | | * 卡片类型;2-管理科,4-开关阀卡,5清空卡 |
| | | */ |
| | | @NotNull(message = "卡片类型不能为空") |
| | | private Byte cardType; |
| | | |
| | | /** |
| | | * 开卡时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | @Length(max = 200) |
| | | private String remarks; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voRm; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/7/24 10:27 |
| | | * @LastEditTime :2024/7/24 10:27 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @Schema(title = "取水口日取水量漏损量视图对象") |
| | | public class VoIntakeAmountDay implements BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 202407241028001L; |
| | | |
| | | |
| | | @Schema(description = "取水口ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String intakeId; |
| | | |
| | | @Schema(description = "取水口名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String intakeName; |
| | | |
| | | @Schema(description = "日取水量(不包括漏损水量)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Double amount; |
| | | |
| | | @Schema(description = "统计日期(yyyy-mm-dd)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private java.sql.Date dt; |
| | | |
| | | @Schema(description = "最后计水量上报数据接收时间(yyyy-mm-dd hh:mm:ss)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private java.util.Date dtLast; |
| | | |
| | | @Schema(description = "最后计水量的控制器地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String rtuAddrLast; |
| | | |
| | | @Schema(description = "最后计水量的控制器ID(外键)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String controllerIdLast; |
| | | |
| | | @Schema(description = "最后计水量时控制器累计水量", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Double totalAmountLast; |
| | | |
| | | @Schema(description = "最后计水量时控制器时钟(yyyy-mm-dd HH:MM:SS)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private java.util.Date rtuDtLast; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voRm; |
| | | |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/7/24 15:50 |
| | | * @LastEditTime :2024/7/24 15:50 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @Schema(title = "漏损记录视图对象") |
| | | public class VoLossDay implements BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 202407241551001L; |
| | | |
| | | @Schema(description = "控制器ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String controllerId; |
| | | |
| | | @Schema(description = "取水口ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String intakeId; |
| | | |
| | | @Schema(description = "取水口名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String intakeName; |
| | | |
| | | @Schema(description = "控制器地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String rtuAddr; |
| | | |
| | | @Schema(description = "统计日期(yyyy-mm-dd)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private java.sql.Date dt; |
| | | |
| | | @Schema(description = "控制器最后上报数据日期时间(yyyy-mm-dd hh:mm:ss)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private java.util.Date dtLast; |
| | | |
| | | @Schema(description = "控制器时钟(yyyy-mm-dd HH:MM:SS)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private java.util.Date dtRtu; |
| | | |
| | | @Schema(description = "日漏损流量", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Double lossAmount; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voRm; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-07-23 17:12 |
| | | * @LastEditTime 2024-07-23 17:12 |
| | | * @Description 整点报数据视图对象 |
| | | */ |
| | | |
| | | @Data |
| | | public class VoOnHour { |
| | | private static final long serialVersionUID = 202407231713001L; |
| | | |
| | | /** |
| | | * 取水口ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long intakeId; |
| | | |
| | | /** |
| | | * 取水口编号 |
| | | */ |
| | | private String intakeNum; |
| | | |
| | | /** |
| | | * 阀控器地址 |
| | | */ |
| | | private String rtuAddr; |
| | | |
| | | /** |
| | | * 数据接收时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private String receiveTime; |
| | | |
| | | /** |
| | | * 瞬时流量 |
| | | */ |
| | | private Double instantAmount; |
| | | |
| | | /** |
| | | * 累计流量 |
| | | */ |
| | | private Double totalAmount; |
| | | |
| | | /** |
| | | * 损失流量,从当日0时到当前的漏损累计流量 |
| | | */ |
| | | private Double lossAmount; |
| | | |
| | | /** |
| | | * 水压 |
| | | */ |
| | | private Double waterPress; |
| | | |
| | | /** |
| | | * 蓄电池电压 |
| | | */ |
| | | private Double batteryVolt; |
| | | |
| | | /** |
| | | * 信号强度 |
| | | */ |
| | | private Integer signalValue; |
| | | |
| | | /** |
| | | * 水价 |
| | | */ |
| | | private Double waterPrice; |
| | | } |
| | |
| | | |
| | | pipIrr: |
| | | global: |
| | | dev: false #是否开发阶段,true或false |
| | | dev: true #是否开发阶段,true或false |
| | | dsName: ym #开发阶段,设置临时的数据库名称 |
| | | mw: |
| | | webPort: 8070 |
| | |
| | | projectNo: 10 |
| | | #控制器类型 |
| | | controllerType: 57 |
| | | #默认行政区划编码(天津-天津市-武清区-京滨工业园-大禹节水) |
| | | divisionCode: 120114403100 |
| | | |
| | | |
| | | #通讯协议 |
| | |
| | | and rash.valve_state = #{valveState,jdbcType=TINYINT} |
| | | </if> |
| | | <if test="intakeName != null"> |
| | | and pint.name = #{intakeName,jdbcType=VARCHAR} |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and rash.dt >= #{startDt,jdbcType=TIMESTAMP} |
| | |
| | | and rash.dt <= #{endDt,jdbcType=TIMESTAMP} |
| | | </if> |
| | | </where> |
| | | ORDER BY rash.dt DESC |
| | | ORDER BY rash.id DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} |
| | | </if> |
| | |
| | | and rasl.valve_state = #{valveState,jdbcType=TINYINT} |
| | | </if> |
| | | <if test="intakeName != null"> |
| | | and pint.name = #{intakeName,jdbcType=VARCHAR} |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and rasl.dt >= #{startDt,jdbcType=TIMESTAMP} |
| | |
| | | rasl.alarm_valve as alarmValve, |
| | | rasl.power_type as powerType |
| | | from rm_alarm_state_last rasl |
| | | Left join pr_intake pint on intake_id = pint.id |
| | | Left join pr_intake pint on rasl.intake_id = pint.id |
| | | <where> |
| | | <if test="alarmState == 1"> |
| | | and ( |
| | |
| | | and rasl.dt <= #{endDt,jdbcType=TIMESTAMP} |
| | | </if> |
| | | </where> |
| | | ORDER BY rasl.dt DESC |
| | | ORDER BY rasl.id DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} |
| | | </if> |
| | |
| | | Left join se_client sc on sc.id = rcadl.client_id |
| | | <where> |
| | | <if test="clientName != null"> |
| | | and sc.name = #{clientName,jdbcType=VARCHAR} |
| | | and sc.name like CONCAT('%',#{clientName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and rash.dt >= #{startDt,jdbcType=TIMESTAMP} |
| | | and rcadl.dt >= #{startDt,jdbcType=DATE} |
| | | </if> |
| | | <if test="endDt != null"> |
| | | and rash.dt <= #{endDt,jdbcType=TIMESTAMP} |
| | | and rcadl.dt <= #{endDt,jdbcType=DATE} |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | Left join se_client sc on sc.id = rcadl.client_id |
| | | <where> |
| | | <if test="clientName != null"> |
| | | and sc.name = #{clientName,jdbcType=VARCHAR} |
| | | and sc.name like CONCAT('%',#{clientName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and rash.dt >= #{startDt,jdbcType=TIMESTAMP} |
| | | and rcadl.dt >= #{startDt,jdbcType=DATE} |
| | | </if> |
| | | <if test="endDt != null"> |
| | | and rash.dt <= #{endDt,jdbcType=TIMESTAMP} |
| | | and rcadl.dt <= #{endDt,jdbcType=DATE} |
| | | </if> |
| | | </where> |
| | | ORDER BY rcadl.dt DESC |
| | | ORDER BY rcadl.id DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} |
| | | </if> |
| | |
| | | Left join se_client sc on sc.id = rcad.client_id |
| | | <where> |
| | | <if test="clientName != null"> |
| | | and sc.name = #{clientName,jdbcType=VARCHAR} |
| | | and sc.name like CONCAT('%',#{clientName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and rash.dt >= #{startDt,jdbcType=TIMESTAMP} |
| | | and rcad.dt >= #{startDt,jdbcType=DATE} |
| | | </if> |
| | | <if test="endDt != null"> |
| | | and rash.dt <= #{endDt,jdbcType=TIMESTAMP} |
| | | and rcad.dt <= #{endDt,jdbcType=DATE} |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | Left join se_client sc on sc.id = rcad.client_id |
| | | <where> |
| | | <if test="clientName != null"> |
| | | and sc.name = #{clientName,jdbcType=VARCHAR} |
| | | and sc.name like CONCAT('%',#{clientName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and rash.dt >= #{startDt,jdbcType=TIMESTAMP} |
| | | and rcad.dt >= #{startDt,jdbcType=DATE} |
| | | </if> |
| | | <if test="endDt != null"> |
| | | and rash.dt <= #{endDt,jdbcType=TIMESTAMP} |
| | | and rcad.dt <= #{endDt,jdbcType=DATE} |
| | | </if> |
| | | </where> |
| | | ORDER BY rcad.dt DESC |
| | | ORDER BY rcad.id DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} |
| | | </if> |
| | |
| | | |
| | | |
| | | <select id="statisticsByClient" resultType="com.dy.pipIrrGlobal.voSt.VoClientAmountStatistics"> |
| | | select client_id, sum(amount) as amount, sum(money) as amount |
| | | select client_id, sum(amount) as amount, sum(money) as money |
| | | from rm_client_amount_day |
| | | where id <![CDATA[>=]]> #{startId,jdbcType=BIGINT} and id <![CDATA[<]]> #{endId,jdbcType=BIGINT} |
| | | group by client_id |
| | |
| | | rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <!--根据指定条件获取记录总数--> |
| | | <select id="getRecordCount" resultType="java.lang.Long"> |
| | | select count(*) |
| | | from rm_intake_amount_day_last riadl |
| | | Left join pr_intake pint on pint.id = riadl.intake_id |
| | | <where> |
| | | <if test="intakeName != null"> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and riadl.dt >= #{startDt,jdbcType=DATE} |
| | | </if> |
| | | <if test="endDt != null"> |
| | | and riadl.dt <= #{endDt,jdbcType=DATE} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <!--根据指定条件获取记录--> |
| | | <select id="getIntakeAmountDayLast" resultType="com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay"> |
| | | select |
| | | CAST(riadl.intake_id AS char)AS intakeId, |
| | | pint.name as intakeName, |
| | | riadl.dt as dt, |
| | | riadl.amount as amount, |
| | | riadl.dt_last as dtLast, |
| | | riadl.rtu_addr_last as rtuAddrLast, |
| | | CAST(riadl.controller_id_last AS char)AS controllerIdLast, |
| | | riadl.total_amount_last as totalAmountLast, |
| | | riadl.rtu_dt_last as rtuDtLast |
| | | from rm_intake_amount_day_last riadl |
| | | Left join pr_intake pint on pint.id = riadl.intake_id |
| | | <where> |
| | | <if test="intakeName != null"> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and riadl.dt >= #{startDt,jdbcType=DATE} |
| | | </if> |
| | | <if test="endDt != null"> |
| | | and riadl.dt <= #{endDt,jdbcType=DATE} |
| | | </if> |
| | | </where> |
| | | ORDER BY riadl.id DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <!--根据指定条件获取记录总数--> |
| | | <select id="getRecordCount" resultType="java.lang.Long"> |
| | | select count(*) |
| | | from rm_intake_amount_day riad |
| | | Left join pr_intake pint on pint.id = riad.intake_id |
| | | <where> |
| | | <if test="intakeName != null"> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and riad.dt >= #{startDt,jdbcType=DATE} |
| | | </if> |
| | | <if test="endDt != null"> |
| | | and riad.dt <= #{endDt,jdbcType=DATE} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <!--根据指定条件获取记录--> |
| | | <select id="getIntakeAmountDayHistory" resultType="com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay"> |
| | | select |
| | | CAST(riad.intake_id AS char)AS intakeId, |
| | | pint.name as intakeName, |
| | | riad.dt as dt, |
| | | riad.amount as amount, |
| | | riad.dt_last as dtLast, |
| | | riad.rtu_addr_last as rtuAddrLast, |
| | | CAST(riad.controller_id_last AS char)AS controllerIdLast, |
| | | riad.total_amount_last as totalAmountLast, |
| | | riad.rtu_dt_last as rtuDtLast |
| | | from rm_intake_amount_day riad |
| | | Left join pr_intake pint on pint.id = riad.intake_id |
| | | <where> |
| | | <if test="intakeName != null"> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and riad.dt >= #{startDt,jdbcType=DATE} |
| | | </if> |
| | | <if test="endDt != null"> |
| | | and riad.dt <= #{endDt,jdbcType=DATE} |
| | | </if> |
| | | </where> |
| | | ORDER BY riad.id DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <select id="statisticsByIntake" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAmountStatistics"> |
| | | select intake_id, sum(amount) as amount |
| | | select intake_id, sum(amount) amount |
| | | from rm_intake_amount_day |
| | | where id <![CDATA[>=]]> #{startId,jdbcType=BIGINT} and id <![CDATA[<]]> #{endId,jdbcType=BIGINT} |
| | | where id <![CDATA[>=]]> #{startId, jdbcType=BIGINT} and id <![CDATA[<]]> #{endId, jdbcType=BIGINT} |
| | | group by intake_id |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_loss_day_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossDayLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_loss_day_last (id, last_history_id, controller_id, |
| | | intake_id, rtu_addr, dt, dt_last, dt_rtu, |
| | | loss_amount) |
| | | values (#{id,jdbcType=BIGINT}, #{lastHistoryId,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, |
| | | #{intakeId,jdbcType=BIGINT}, #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=DATE}, #{dtLast,jdbcType=TIMESTAMP}, #{dtRtu,jdbcType=TIMESTAMP}, |
| | | #{lossAmount,jdbcType=DOUBLE}) |
| | | insert into rm_loss_day_last (id, last_history_id, controller_id, |
| | | intake_id, rtu_addr, dt, dt_last, dt_rtu, |
| | | loss_amount) |
| | | values (#{id,jdbcType=BIGINT}, #{lastHistoryId,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, |
| | | #{intakeId,jdbcType=BIGINT}, #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=DATE}, #{dtLast,jdbcType=TIMESTAMP}, #{dtRtu,jdbcType=TIMESTAMP}, |
| | | #{lossAmount,jdbcType=DOUBLE}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossDayLast"> |
| | | <!--@mbg.generated--> |
| | |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="dtLast != null"> |
| | | dt_last = #{dtLast,jdbcType=TIMESTAMP}, |
| | | <if test="dtLast != null"> |
| | | dt_last = #{dtLast,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="dtRtu != null"> |
| | | dt_rtu = #{dtRtu,jdbcType=TIMESTAMP}, |
| | | <if test="dtRtu != null"> |
| | | dt_rtu = #{dtRtu,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="lossAmount != null"> |
| | | loss_amount = #{lossAmount,jdbcType=DOUBLE}, |
| | |
| | | <!--@mbg.generated--> |
| | | update rm_loss_day_last |
| | | set last_history_id = #{lastHistoryId,jdbcType=BIGINT}, |
| | | controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=DATE}, |
| | | dt_last = #{dtLast,jdbcType=TIMESTAMP}, |
| | | dt_rtu = #{dtRtu,jdbcType=TIMESTAMP}, |
| | | loss_amount = #{lossAmount,jdbcType=DOUBLE} |
| | | controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=DATE}, |
| | | dt_last = #{dtLast,jdbcType=TIMESTAMP}, |
| | | dt_rtu = #{dtRtu,jdbcType=TIMESTAMP}, |
| | | loss_amount = #{lossAmount,jdbcType=DOUBLE} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <!--根据指定条件获取记录总数--> |
| | | <select id="getRecordCount" resultType="java.lang.Long"> |
| | | select count(*) |
| | | from rm_loss_day_last rldl |
| | | Left join pr_intake pint on pint.id = rldl.intake_id |
| | | <where> |
| | | <if test="intakeName != null"> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and rldl.dt >= #{startDt,jdbcType=DATE} |
| | | </if> |
| | | <if test="endDt != null"> |
| | | and rldl.dt <= #{endDt,jdbcType=DATE} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <!--根据指定条件获取记录--> |
| | | <select id="getLossDayLast" resultType="com.dy.pipIrrGlobal.voRm.VoLossDay"> |
| | | select |
| | | CAST(rldl.intake_id AS char)AS intakeId, |
| | | CAST(rldl.controller_id AS char)AS controllerId, |
| | | pint.name as intakeName, |
| | | rldl.rtu_addr as rtuAddr, |
| | | rldl.dt as dt, |
| | | rldl.dt_last as dtLast, |
| | | rldl.dt_rtu as dtRtu, |
| | | rldl.loss_amount as lossAmount |
| | | from rm_loss_day_last rldl |
| | | Left join pr_intake pint on pint.id = rldl.intake_id |
| | | <where> |
| | | <if test="intakeName != null"> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and rldl.dt >= #{startDt,jdbcType=DATE} |
| | | </if> |
| | | <if test="endDt != null"> |
| | | and rldl.dt <= #{endDt,jdbcType=DATE} |
| | | </if> |
| | | </where> |
| | | ORDER BY rldl.id DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_loss_day |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="selectByIntakeId" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_loss_day |
| | | where intake_id = #{intakeId,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="selectByDate" parameterType="java.util.Date" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossDay"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_loss_day (id, controller_id, intake_id, |
| | | rtu_addr, dt, dt_last, dt_rtu, loss_amount |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, |
| | | #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=DATE}, #{dtLast,jdbcType=TIMESTAMP}, #{dtRtu,jdbcType=TIMESTAMP}, #{lossAmount,jdbcType=DOUBLE} |
| | | ) |
| | | rtu_addr, dt, dt_last, dt_rtu, loss_amount |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, |
| | | #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=DATE}, #{dtLast,jdbcType=TIMESTAMP}, #{dtRtu,jdbcType=TIMESTAMP}, #{lossAmount,jdbcType=DOUBLE} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossDay"> |
| | | <!--@mbg.generated--> |
| | |
| | | <if test="dtLast != null"> |
| | | dt_last, |
| | | </if> |
| | | <if test="dtRtu != null"> |
| | | <if test="dtRtu != null"> |
| | | dt_rtu, |
| | | </if> |
| | | <if test="lossAmount != null"> |
| | |
| | | <!--@mbg.generated--> |
| | | update rm_loss_day |
| | | set controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=DATE}, |
| | | dt_last = #{dtLast,jdbcType=TIMESTAMP}, |
| | | dt_rtu = #{dtRtu,jdbcType=TIMESTAMP}, |
| | | loss_amount = #{lossAmount,jdbcType=DOUBLE} |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | dt = #{dt,jdbcType=DATE}, |
| | | dt_last = #{dtLast,jdbcType=TIMESTAMP}, |
| | | dt_rtu = #{dtRtu,jdbcType=TIMESTAMP}, |
| | | loss_amount = #{lossAmount,jdbcType=DOUBLE} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="statisticsByIntake" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics"> |
| | | select intake_id, sum(loss_amount) as amount |
| | | from rm_loss_day |
| | | where id <![CDATA[>=]]> #{startId,jdbcType=BIGINT} and id <![CDATA[<]]> #{endId,jdbcType=BIGINT} |
| | | group by intake_id |
| | | <!--根据指定条件获取记录总数--> |
| | | <select id="getRecordCount" resultType="java.lang.Long"> |
| | | select count(*) |
| | | from rm_loss_day rld |
| | | Left join pr_intake pint on pint.id = rld.intake_id |
| | | <where> |
| | | <if test="intakeName != null"> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and rld.dt >= #{startDt,jdbcType=DATE} |
| | | </if> |
| | | <if test="endDt != null"> |
| | | and rld.dt <= #{endDt,jdbcType=DATE} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <!--根据指定条件获取记录--> |
| | | <select id="getLossDayHistory" resultType="com.dy.pipIrrGlobal.voRm.VoLossDay"> |
| | | select |
| | | CAST(rld.intake_id AS char)AS intakeId, |
| | | CAST(rld.controller_id AS char)AS controllerId, |
| | | pint.name as intakeName, |
| | | rld.rtu_addr as rtuAddr, |
| | | rld.dt as dt, |
| | | rld.dt_last as dtLast, |
| | | rld.dt_rtu as dtRtu, |
| | | rld.loss_amount as lossAmount |
| | | from rm_loss_day rld |
| | | Left join pr_intake pint on pint.id = rld.intake_id |
| | | <where> |
| | | <if test="intakeName != null"> |
| | | and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | <if test="startDt != null"> |
| | | and rld.dt >= #{startDt,jdbcType=DATE} |
| | | </if> |
| | | <if test="endDt != null"> |
| | | and rld.dt <= #{endDt,jdbcType=DATE} |
| | | </if> |
| | | </where> |
| | | ORDER BY rld.id DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="statisticsByIntake" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics"> |
| | | select intake_id, sum(loss_amount) amount |
| | | from rm_loss_day |
| | | where id <![CDATA[>=]]> #{startId, jdbcType=BIGINT} and id <![CDATA[<]]> #{endId, jdbcType=BIGINT} |
| | | group by intake_id |
| | | </select> |
| | | </mapper> |
| | |
| | | water_price = #{waterPrice,jdbcType=FLOAT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--根据指定条件获取整点报历史记录数量--> |
| | | <select id="getOnHourReportsCount_history" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM rm_on_hour_report_history oh |
| | | INNER JOIN pr_intake inta ON inta.id = oh.intake_id |
| | | <where> |
| | | <if test = "intakeName != null and intakeName !=''"> |
| | | AND inta.name LIKE CONCAT('%',#{intakeName},'%') |
| | | </if> |
| | | <if test = "rtuAddr != null and rtuAddr !=''"> |
| | | AND oh.rtu_addr LIKE CONCAT('%',#{rtuAddr},'%') |
| | | </if> |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | AND oh.dt BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据指定条件获取整点报历史记录--> |
| | | <select id="getOnHourReports_history" resultType="com.dy.pipIrrGlobal.voRm.VoOnHour"> |
| | | SELECT |
| | | oh.intake_id AS intakeId, |
| | | inta.`name` AS intakeNum, |
| | | oh.rtu_addr AS rtuAddr, |
| | | oh.dt AS receiveTime, |
| | | oh.instant_amount AS instantAmount, |
| | | oh.total_amount AS totalAmount, |
| | | oh.loss_amount AS lossAmount, |
| | | oh.water_press AS waterPress, |
| | | oh.battery_volt AS batteryVolt, |
| | | oh.signal_value AS signalValue, |
| | | oh.water_price AS waterPrice |
| | | FROM rm_on_hour_report_history oh |
| | | INNER JOIN pr_intake inta ON inta.id = oh.intake_id |
| | | <where> |
| | | <if test = "intakeNum != null and intakeNum !=''"> |
| | | AND inta.name LIKE CONCAT('%',#{intakeNum},'%') |
| | | </if> |
| | | <if test = "rtuAddr != null and rtuAddr !=''"> |
| | | AND oh.rtu_addr LIKE CONCAT('%',#{rtuAddr},'%') |
| | | </if> |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | AND oh.dt BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where> |
| | | ORDER BY oh.dt DESC |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </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.daoSe.SeManagerCardMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeManagerCard"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table se_manager_card--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="card_addr" jdbcType="VARCHAR" property="cardAddr" /> |
| | | <result column="card_num" jdbcType="VARCHAR" property="cardNum" /> |
| | | <result column="card_type" jdbcType="TINYINT" property="cardType" /> |
| | | <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
| | | <result column="remarks" jdbcType="VARCHAR" property="remarks" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, card_addr, card_num, card_type, create_time, remarks |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from se_manager_card |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from se_manager_card |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeManagerCard"> |
| | | <!--@mbg.generated--> |
| | | insert into se_manager_card (id, card_addr, card_num, |
| | | card_type, create_time, remarks |
| | | ) |
| | | values (#{id,jdbcType=BIGINT}, #{cardAddr,jdbcType=VARCHAR}, #{cardNum,jdbcType=VARCHAR}, |
| | | #{cardType,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeManagerCard"> |
| | | <!--@mbg.generated--> |
| | | insert into se_manager_card |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="cardAddr != null"> |
| | | card_addr, |
| | | </if> |
| | | <if test="cardNum != null"> |
| | | card_num, |
| | | </if> |
| | | <if test="cardType != null"> |
| | | card_type, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | remarks, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="cardAddr != null"> |
| | | #{cardAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="cardNum != null"> |
| | | #{cardNum,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="cardType != null"> |
| | | #{cardType,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeManagerCard"> |
| | | <!--@mbg.generated--> |
| | | update se_manager_card |
| | | <set> |
| | | <if test="cardAddr != null"> |
| | | card_addr = #{cardAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="cardNum != null"> |
| | | card_num = #{cardNum,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="cardType != null"> |
| | | card_type = #{cardType,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeManagerCard"> |
| | | <!--@mbg.generated--> |
| | | update se_manager_card |
| | | set card_addr = #{cardAddr,jdbcType=VARCHAR}, |
| | | card_num = #{cardNum,jdbcType=VARCHAR}, |
| | | card_type = #{cardType,jdbcType=TINYINT}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | remarks = #{remarks,jdbcType=VARCHAR} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!--根据行政区划串模糊查询管理卡编号--> |
| | | <select id="getManagerCardNumOfMax" resultType="java.lang.String"> |
| | | SELECT card_num |
| | | FROM se_manager_card |
| | | WHERE card_num LIKE CONCAT(#{areaCode},'%') |
| | | ORDER BY card_num desc |
| | | LIMIT 0,1 |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.voRm.VoClientAmountDay; |
| | | import com.dy.pipIrrGlobal.voRm.VoControllerAlarmState; |
| | | import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCard; |
| | | import com.dy.pipIrrRemote.records.clientAmountDay.ClientAmountDayQueryVo; |
| | | import com.dy.pipIrrRemote.records.controllerAlarmState.ControllerAlarmStateQueryVo; |
| | | import com.dy.pipIrrRemote.records.intakeAmountDay.IntakeAmountDayQueryVo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页控制器报警与状态数据(BaseResponse.content:QueryResultVo[{}])", |
| | | description = "返回一页农户日用水量统计数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页控制器报警与状态数据(BaseResponse.content:QueryResultVo[{}])", |
| | | description = "返回一页农户日用水量统计数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据指定条件获取取水口日取水量漏损列表(历史) |
| | | * |
| | | * @param vo 查询条件 |
| | | * @return 符合条件的取水口日取水量漏损列表(历史) |
| | | */ |
| | | @Operation(summary = "获得一页取水口日取水量漏损记录", description = "返回一页取水口日取水量漏损数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页取水口日取水量漏损数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getIntakeAmountDayHistory") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIntakeAmountDay>>> getIntakeAmountDayHistory(@RequestBody IntakeAmountDayQueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoIntakeAmountDay>> res = recordsSv.getIntakeAmountDayHistory(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取农户日用水量统计记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件获取取水口日取水量漏损列表(最新) |
| | | * |
| | | * @param vo 查询条件 |
| | | * @return 符合条件的取水口日取水量漏损列表(最新) |
| | | */ |
| | | @Operation(summary = "获得一页取水口日取水量漏损记录", description = "返回一页取水口日取水量漏损数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页取水口日取水量漏损数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getIntakeAmountDayLast") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIntakeAmountDay>>> getIntakeAmountDayLast(@RequestBody IntakeAmountDayQueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoIntakeAmountDay>> res = recordsSv.getIntakeAmountDayLast(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取农户日用水量统计记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.dy.pipIrrRemote.records; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoRm.RmAlarmStateHistoryMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmAlarmStateLastMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmClientAmountDayLastMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmClientAmountDayMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.*; |
| | | import com.dy.pipIrrGlobal.voRm.VoClientAmountDay; |
| | | import com.dy.pipIrrGlobal.voRm.VoControllerAlarmState; |
| | | import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay; |
| | | import com.dy.pipIrrRemote.records.clientAmountDay.ClientAmountDayQueryVo; |
| | | import com.dy.pipIrrRemote.records.controllerAlarmState.ControllerAlarmStateQueryVo; |
| | | import com.dy.pipIrrRemote.records.intakeAmountDay.IntakeAmountDayQueryVo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private RmAlarmStateLastMapper rmAlarmStateLastMapper; |
| | | |
| | | @Autowired |
| | | private RmClientAmountDayLastMapper rmClientAmountDayLastMapper; |
| | | @Autowired |
| | | private RmClientAmountDayMapper rmClientAmountDayMapper; |
| | | @Autowired |
| | | private RmClientAmountDayLastMapper rmClientAmountDayLastMapper; |
| | | |
| | | @Autowired |
| | | private RmIntakeAmountDayMapper rmIntakeAmountDayMapper; |
| | | @Autowired |
| | | private RmIntakeAmountDayLastMapper rmIntakeAmountDayLastMapper; |
| | | |
| | | |
| | | /** |
| | |
| | | rsVo.obj = rmClientAmountDayLastMapper.getClientAmountDayLast(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | /** |
| | | * 获得一页取水口日取水量漏损记录(历史) |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoIntakeAmountDay>> getIntakeAmountDayHistory(IntakeAmountDayQueryVo vo) { |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo); |
| | | |
| | | Long itemTotal = rmIntakeAmountDayMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoIntakeAmountDay>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = vo.pageSize; |
| | | rsVo.pageCurr = vo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmIntakeAmountDayMapper.getIntakeAmountDayHistory(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | /** |
| | | * 获得一页取水口日取水量漏损记录(最新) |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoIntakeAmountDay>> getIntakeAmountDayLast(IntakeAmountDayQueryVo vo) { |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo); |
| | | |
| | | Long itemTotal = rmIntakeAmountDayLastMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoIntakeAmountDay>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = vo.pageSize; |
| | | rsVo.pageCurr = vo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmIntakeAmountDayLastMapper.getIntakeAmountDayLast(params); |
| | | return rsVo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.records.clientAmountDay; |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.voRm.VoClientAmountDay; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCard; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponse; |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponses; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | 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; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/7/24 14:30 |
| | | * @LastEditTime :2024/7/24 14:30 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Tag(name = "农户日用水量统计查询", description = "农户日用水量统计查询") |
| | | @RestController |
| | | @RequestMapping(path = "clientAmountDay") |
| | | public class ClientAmountDayCtrl { |
| | | |
| | | @Autowired |
| | | private ClientAmountDaySv clientAmountDaySv; |
| | | |
| | | |
| | | /** |
| | | * 根据指定条件获取农户日用水量统计列表(历史) |
| | | * |
| | | * @param vo 查询条件 |
| | | * @return 符合条件的农户日用水量统计列表(历史) |
| | | */ |
| | | @Operation(summary = "获得一页农户日用水量统计记录", description = "返回一页农户日用水量统计数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页农户日用水量统计数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getClientAmountDayHistory") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoClientAmountDay>>> getClientAmountDayHistory(@RequestBody ClientAmountDayQueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoClientAmountDay>> res = clientAmountDaySv.getClientAmountDayHistory(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取农户日用水量统计记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据指定条件获取农户日用水量统计列表(最新) |
| | | * |
| | | * @param vo 查询条件 |
| | | * @return 符合条件的农户日用水量统计列表(最新) |
| | | */ |
| | | @Operation(summary = "获得一页农户日用水量统计记录", description = "返回一页农户日用水量统计数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页农户日用水量统计数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getClientAmountDayLast") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoClientAmountDay>>> getClientAmountDayLast(@RequestBody ClientAmountDayQueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoClientAmountDay>> res = clientAmountDaySv.getClientAmountDayLast(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取农户日用水量统计记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.records.clientAmountDay; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoRm.RmClientAmountDayLastMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmClientAmountDayMapper; |
| | | import com.dy.pipIrrGlobal.voRm.VoClientAmountDay; |
| | | 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 :WuZeYu |
| | | * @Date :2024/7/24 14:30 |
| | | * @LastEditTime :2024/7/24 14:30 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ClientAmountDaySv { |
| | | |
| | | @Autowired |
| | | private RmClientAmountDayMapper rmClientAmountDayMapper; |
| | | @Autowired |
| | | private RmClientAmountDayLastMapper rmClientAmountDayLastMapper; |
| | | |
| | | |
| | | /** |
| | | * 获得一页农户日用水量统计记录(历史) |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoClientAmountDay>> getClientAmountDayHistory(ClientAmountDayQueryVo vo) { |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo); |
| | | |
| | | Long itemTotal = rmClientAmountDayMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoClientAmountDay>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = vo.pageSize; |
| | | rsVo.pageCurr = vo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmClientAmountDayMapper.getClientAmountDayHistory(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获得一页农户日用水量统计记录(最新) |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoClientAmountDay>> getClientAmountDayLast(ClientAmountDayQueryVo vo) { |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo); |
| | | |
| | | Long itemTotal = rmClientAmountDayLastMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoClientAmountDay>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = vo.pageSize; |
| | | rsVo.pageCurr = vo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmClientAmountDayLastMapper.getClientAmountDayLast(params); |
| | | return rsVo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.records.controllerAlarmState; |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.voRm.VoControllerAlarmState; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCard; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponse; |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponses; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | 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; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/7/24 14:22 |
| | | * @LastEditTime :2024/7/24 14:22 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Tag(name = "控制器报警与状态查询", description = "控制器报警与状态查询") |
| | | @RestController |
| | | @RequestMapping(path = "controllerAlarmState") |
| | | public class ControllerAlarmStateCtrl { |
| | | |
| | | @Autowired |
| | | private ControllerAlarmStateSv controllerAlarmStateSv; |
| | | |
| | | |
| | | /** |
| | | * 根据指定条件获取控制器报警与状态列表(历史) |
| | | * |
| | | * @param vo 查询条件 |
| | | * @return 符合条件的控制器报警与状态列表(历史) |
| | | */ |
| | | @Operation(summary = "获得一页控制器报警与状态记录", description = "返回一页控制器报警与状态数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页控制器报警与状态数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getControllerAlarmStateHistory") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoControllerAlarmState>>> getControllerAlarmStateHistory(@RequestBody ControllerAlarmStateQueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoControllerAlarmState>> res = controllerAlarmStateSv.getControllerAlarmStateHistory(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取控制器报警与状态记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据指定条件获取控制器报警与状态列表(最新) |
| | | * |
| | | * @param vo 查询条件 |
| | | * @return 符合条件的控制器报警与状态列表(最新) |
| | | */ |
| | | @Operation(summary = "获得一页控制器报警与状态记录", description = "返回一页控制器报警与状态数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页控制器报警与状态数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getControllerAlarmStateLast") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoControllerAlarmState>>> getControllerAlarmStateLast(@RequestBody ControllerAlarmStateQueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoControllerAlarmState>> res = controllerAlarmStateSv.getControllerAlarmStateLast(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取控制器记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.records.controllerAlarmState; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoRm.RmAlarmStateHistoryMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmAlarmStateLastMapper; |
| | | import com.dy.pipIrrGlobal.voRm.VoControllerAlarmState; |
| | | 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 :WuZeYu |
| | | * @Date :2024/7/24 14:22 |
| | | * @LastEditTime :2024/7/24 14:22 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ControllerAlarmStateSv { |
| | | |
| | | @Autowired |
| | | private RmAlarmStateHistoryMapper rmAlarmStateHistoryMapper; |
| | | @Autowired |
| | | private RmAlarmStateLastMapper rmAlarmStateLastMapper; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获得一页控制器报警与状态记录(历史) |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoControllerAlarmState>> getControllerAlarmStateHistory(ControllerAlarmStateQueryVo vo) { |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo); |
| | | |
| | | Long itemTotal = rmAlarmStateHistoryMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoControllerAlarmState>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = vo.pageSize; |
| | | rsVo.pageCurr = vo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmAlarmStateHistoryMapper.getControllerAlarmStateHistory(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获得一页控制器报警与状态记录(最新) |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoControllerAlarmState>> getControllerAlarmStateLast(ControllerAlarmStateQueryVo vo) { |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo); |
| | | |
| | | Long itemTotal = rmAlarmStateLastMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoControllerAlarmState>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = vo.pageSize; |
| | | rsVo.pageCurr = vo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmAlarmStateLastMapper.getControllerAlarmStateLast(params); |
| | | return rsVo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.records.intakeAmountDay; |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCard; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponse; |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponses; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | 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; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/7/24 14:37 |
| | | * @LastEditTime :2024/7/24 14:37 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Tag(name = "取水口日取水量漏损量查询", description = "取水口日取水量漏损量查询") |
| | | @RestController |
| | | @RequestMapping(path = "intakeAmountDay") |
| | | public class IntakeAmountDayCtrl { |
| | | |
| | | @Autowired |
| | | private IntakeAmountDaySv intakeAmountDaySv; |
| | | |
| | | /** |
| | | * 根据指定条件获取取水口日取水量漏损量列表(历史) |
| | | * |
| | | * @param vo 查询条件 |
| | | * @return 符合条件的取水口日取水量漏损量列表(历史) |
| | | */ |
| | | @Operation(summary = "获得一页取水口日取水量漏损量记录", description = "返回一页取水口日取水量漏损量数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页取水口日取水量漏损数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getIntakeAmountDayHistory") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIntakeAmountDay>>> getIntakeAmountDayHistory(@RequestBody IntakeAmountDayQueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoIntakeAmountDay>> res = intakeAmountDaySv.getIntakeAmountDayHistory(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取取水口日取水量漏损量记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件获取取水口日取水量漏损量列表(最新) |
| | | * |
| | | * @param vo 查询条件 |
| | | * @return 符合条件的取水口日取水量漏损量列表(最新) |
| | | */ |
| | | @Operation(summary = "获得一页取水口日取水量漏损量记录", description = "返回一页取水口日取水量漏损量数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页取水口日取水量漏损量数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getIntakeAmountDayLast") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoIntakeAmountDay>>> getIntakeAmountDayLast(@RequestBody IntakeAmountDayQueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoIntakeAmountDay>> res = intakeAmountDaySv.getIntakeAmountDayLast(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取取水口日取水量漏损量记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.records.intakeAmountDay; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.sql.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/7/24 10:21 |
| | | * @LastEditTime :2024/7/24 10:21 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "取水口日取水量漏损查询条件") |
| | | public class IntakeAmountDayQueryVo extends QueryConditionVo { |
| | | |
| | | @Schema(description = "取水口名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String intakeName; |
| | | |
| | | @Schema(description = "统计开始日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date startDt; |
| | | |
| | | @Schema(description = "统计结束日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date endDt; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.records.intakeAmountDay; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoRm.RmIntakeAmountDayLastMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmIntakeAmountDayMapper; |
| | | import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay; |
| | | 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 :WuZeYu |
| | | * @Date :2024/7/24 14:38 |
| | | * @LastEditTime :2024/7/24 14:38 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class IntakeAmountDaySv { |
| | | |
| | | @Autowired |
| | | private RmIntakeAmountDayMapper rmIntakeAmountDayMapper; |
| | | @Autowired |
| | | private RmIntakeAmountDayLastMapper rmIntakeAmountDayLastMapper; |
| | | |
| | | |
| | | /** |
| | | * 获得一页取水口日取水量漏损记录(历史) |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoIntakeAmountDay>> getIntakeAmountDayHistory(IntakeAmountDayQueryVo vo) { |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo); |
| | | |
| | | Long itemTotal = rmIntakeAmountDayMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoIntakeAmountDay>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = vo.pageSize; |
| | | rsVo.pageCurr = vo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmIntakeAmountDayMapper.getIntakeAmountDayHistory(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获得一页取水口日取水量漏损记录(最新) |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoIntakeAmountDay>> getIntakeAmountDayLast(IntakeAmountDayQueryVo vo) { |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo); |
| | | |
| | | Long itemTotal = rmIntakeAmountDayLastMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoIntakeAmountDay>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = vo.pageSize; |
| | | rsVo.pageCurr = vo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmIntakeAmountDayLastMapper.getIntakeAmountDayLast(params); |
| | | return rsVo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.records.lossDay; |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay; |
| | | import com.dy.pipIrrGlobal.voRm.VoLossDay; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCard; |
| | | import com.dy.pipIrrRemote.records.intakeAmountDay.IntakeAmountDayQueryVo; |
| | | import com.dy.pipIrrRemote.records.intakeAmountDay.IntakeAmountDaySv; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.media.Content; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponse; |
| | | import io.swagger.v3.oas.annotations.responses.ApiResponses; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | 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; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/7/24 15:29 |
| | | * @LastEditTime :2024/7/24 15:29 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Tag(name = "漏损记录查询", description = "漏损记录查询") |
| | | @RestController |
| | | @RequestMapping(path = "lossDay") |
| | | public class LossDayCtrl { |
| | | |
| | | @Autowired |
| | | private LossDaySv lossDaySv; |
| | | |
| | | |
| | | /** |
| | | * 根据指定条件获取漏损记录列表(历史) |
| | | * |
| | | * @param vo 查询条件 |
| | | * @return 符合条件的漏损记录列表(历史) |
| | | */ |
| | | @Operation(summary = "获得一页漏损记录记录", description = "返回一页漏损记录数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页漏损记录数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getLossDayHistory") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoLossDay>>> getLossDayHistory(@RequestBody LossDayQueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoLossDay>> res = lossDaySv.getLossDayHistory(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取漏损记录记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件获取漏损记录列表(最新) |
| | | * |
| | | * @param vo 查询条件 |
| | | * @return 符合条件的漏损记录列表(最新) |
| | | */ |
| | | @Operation(summary = "获得一页漏损记录记录", description = "返回一页漏损记录数据") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页漏损记录数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/getLossDayLast") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoLossDay>>> getLossDayLast(@RequestBody LossDayQueryVo vo) { |
| | | try { |
| | | QueryResultVo<List<VoLossDay>> res = lossDaySv.getLossDayLast(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取漏损记录记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.records.lossDay; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | import java.sql.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | | * @Date :2024/7/24 15:44 |
| | | * @LastEditTime :2024/7/24 15:44 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | @Schema(name = "漏损记录查询条件") |
| | | public class LossDayQueryVo extends QueryConditionVo { |
| | | |
| | | |
| | | @Schema(description = "取水口名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private String intakeName; |
| | | |
| | | @Schema(description = "统计开始日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date startDt; |
| | | |
| | | @Schema(description = "统计结束日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | private Date endDt; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.records.lossDay; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoRm.RmLossDayMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.RmLossDayLastMapper; |
| | | import com.dy.pipIrrGlobal.voRm.VoLossDay; |
| | | 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 :WuZeYu |
| | | * @Date :2024/7/24 15:29 |
| | | * @LastEditTime :2024/7/24 15:29 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class LossDaySv { |
| | | |
| | | @Autowired |
| | | private RmLossDayMapper rmLossHistoryMapper; |
| | | @Autowired |
| | | private RmLossDayLastMapper rmLossLastMapper; |
| | | |
| | | |
| | | /** |
| | | * 获得一页漏损记录查询(历史) |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoLossDay>> getLossDayHistory(LossDayQueryVo vo) { |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo); |
| | | |
| | | Long itemTotal = rmLossHistoryMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoLossDay>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = vo.pageSize; |
| | | rsVo.pageCurr = vo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmLossHistoryMapper.getLossDayHistory(params); |
| | | return rsVo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获得一页漏损记录查询(最新) |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoLossDay>> getLossDayLast(LossDayQueryVo vo) { |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo); |
| | | |
| | | Long itemTotal = rmLossLastMapper.getRecordCount(params); |
| | | |
| | | QueryResultVo<List<VoLossDay>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = vo.pageSize; |
| | | rsVo.pageCurr = vo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmLossLastMapper.getLossDayLast(params); |
| | | return rsVo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.report; |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.voRm.VoOnHour; |
| | | import com.dy.pipIrrRemote.report.qo.ReportQO; |
| | | 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 2024-07-23 16:01 |
| | | * @LastEditTime 2024-07-23 16:01 |
| | | * @Description 各类数据报控制类 |
| | | */ |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping(path = "report") |
| | | @RequiredArgsConstructor |
| | | public class ReportCtrl { |
| | | private final ReportSv reportSv; |
| | | |
| | | /** |
| | | * 根据指定条件获取整点报历史记录 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/on_hour_report_history") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoOnHour>>> getOnHourReportHistory(ReportQO qo){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(reportSv.getOnHourReportsHistory(qo)); |
| | | } catch (Exception e) { |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.report; |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoRm.*; |
| | | import com.dy.pipIrrGlobal.voRm.VoOnHour; |
| | | import com.dy.pipIrrRemote.report.qo.ReportQO; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-07-23 16:02 |
| | | * @LastEditTime 2024-07-23 16:02 |
| | | * @Description 各类数据报服务类 |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class ReportSv { |
| | | // 阀控器整点报DAO |
| | | private final RmOnHourReportHistoryMapper rmOnHourReportHistoryMapper; |
| | | private final RmOnHourReportLastMapper rmOnHourReportLastMapper; |
| | | |
| | | // 阀控器开关阀报DAO |
| | | private final RmOpenCloseValveHistoryMapper rmOpenCloseValveHistoryMapper; |
| | | private final RmOpenCloseValveLastMapper rmOpenCloseValveLastMapper; |
| | | |
| | | // 阀控器定时报DAO |
| | | private final RmTimingReportHistoryMapper rmTimingReportHistoryMapper; |
| | | private final RmTimingReportLastMapper rmTimingReportLastMapper; |
| | | |
| | | // 工作报DAO |
| | | private final RmWorkReportHistoryMapper rmWorkReportHistoryMapper; |
| | | private final RmWorkReportLastMapper rmWorkReportLastMapper; |
| | | |
| | | /** |
| | | * 根据指定条件获取整点报历史记录 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoOnHour>> getOnHourReportsHistory(ReportQO qo) { |
| | | String timeStart = qo.getTimeStart(); |
| | | String timeStop = qo.getTimeStop(); |
| | | if(timeStart != null) { |
| | | timeStart = timeStart + " 00:00:00"; |
| | | qo.setTimeStart(timeStart); |
| | | } |
| | | if(timeStop != null) { |
| | | timeStop = timeStop + " 23:59:59"; |
| | | qo.setTimeStop(timeStop); |
| | | } |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); |
| | | Long itemTotal = rmOnHourReportHistoryMapper.getOnHourReportsCount_history(params); |
| | | |
| | | QueryResultVo<List<VoOnHour>> rsVo = new QueryResultVo<>() ; |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmOnHourReportHistoryMapper.getOnHourReports_history(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.report.qo; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-07-23 16:31 |
| | | * @LastEditTime 2024-07-23 16:31 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ToString(callSuper = true) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | public class ReportQO extends QueryConditionVo { |
| | | |
| | | /** |
| | | * 取水口编号 |
| | | */ |
| | | private String intakeNum; |
| | | |
| | | /** |
| | | * 阀控器地址 |
| | | */ |
| | | private String rtuAddr; |
| | | |
| | | /** |
| | | * 查询开始日期 |
| | | */ |
| | | private String timeStart; |
| | | |
| | | /** |
| | | * 查询结束日期 |
| | | */ |
| | | private String timeStop; |
| | | } |
| | |
| | | import com.dy.pipIrrGlobal.pojoBa.BaClient; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeCardOperate; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeManagerCard; |
| | | import com.dy.pipIrrGlobal.util.AmountToChinese; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoOperate; |
| | |
| | | import jakarta.validation.Valid; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.BindingResult; |
| | |
| | | private final CardOperateSv cardOperateSv; |
| | | private final ClientCardSv clientCardSv; |
| | | |
| | | @Value("${project.divisionCode}") |
| | | private String divisionCode; |
| | | /** |
| | | * 开卡 |
| | | * @param po 开卡传入对象 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 创建管理卡 |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "create_manager_card", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> createManagerCard(@RequestBody @Valid ManagerCard po, BindingResult bindingResult){ |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 根据行政区划串(divisionCode)在管理卡表中针对卡片编号(cardNum)进行模糊查询 |
| | | * 如果顺序号已经达到最大值,提示用户联系系统管理员 |
| | | * 如果顺序号未达到最大值,则加1 |
| | | * cardNum为新的卡号 |
| | | */ |
| | | String cardNum = Optional.ofNullable(cardOperateSv.getManagerCardNumOfMax(divisionCode)).orElse(""); |
| | | if(cardNum != null && cardNum.trim().length() > 0) { |
| | | Integer number = Integer.parseInt(cardNum.substring(12)); |
| | | number = number + 1; |
| | | if(number > 65535) { |
| | | return BaseResponseUtils.buildErrorMsg(SellResultCode.CARD_NUMBER_OVERRUN.getMessage()); |
| | | } |
| | | cardNum = cardNum.substring(0, 12) + String.format("%05d", number); |
| | | } else { |
| | | cardNum = divisionCode + "00001"; |
| | | } |
| | | |
| | | SeManagerCard seManagerCard = new SeManagerCard(); |
| | | seManagerCard.setCardAddr(po.getCardAddr()); |
| | | seManagerCard.setCardNum(cardNum); |
| | | seManagerCard.setCardType(po.getCardType()); |
| | | seManagerCard.setCreateTime(new Date()); |
| | | seManagerCard.setRemarks(po.getRemarks()); |
| | | Long managerCardId = cardOperateSv.addManagerCard(seManagerCard); |
| | | if(managerCardId == 0) { |
| | | return BaseResponseUtils.buildErrorMsg(SellResultCode.CREATE_MANAGER_CARD_ERROR.getMessage()); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(cardNum); |
| | | |
| | | //Map map = new HashMap(); |
| | | //map.put("cardNum", cardNum); |
| | | //return BaseResponseUtils.buildSuccess(map) ; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取充值记录 |
| | | * @param vo |
| | | * @return |
| | |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoBa.BaSettingsMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeCardOperateMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeGeneralMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.*; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeCardOperate; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeManagerCard; |
| | | import com.dy.pipIrrGlobal.voSe.*; |
| | | import com.dy.pipIrrSell.cardOperate.dto.DtoRecharge; |
| | | import com.dy.pipIrrSell.cardOperate.enums.OperateTypeENUM; |
| | |
| | | @Autowired |
| | | private BaSettingsMapper baSettingsMapper; |
| | | |
| | | @Autowired |
| | | private SeManagerCardMapper seManagerCardMapper; |
| | | |
| | | |
| | | /** |
| | | * 添加开卡记录 |
| | |
| | | public Long getAreaCodeById(Long clientId) { |
| | | return seClientMapper.getAreaCodeById(clientId); |
| | | } |
| | | |
| | | /** |
| | | * 根据行政区划串模块查询水卡编号,开卡使用 |
| | | * @param areaCode |
| | | * @return |
| | | */ |
| | | String getCardNumOfMax(String areaCode) { |
| | | public String getCardNumOfMax(String areaCode) { |
| | | return seClientCardMapper.getCardNumOfMax(areaCode); |
| | | } |
| | | |
| | | /** |
| | | * 根据行政区划串模糊查询管理卡编号,创建管理卡使用 |
| | | * @param areaCode |
| | | * @return |
| | | */ |
| | | public String getManagerCardNumOfMax(String areaCode) { |
| | | return seManagerCardMapper.getManagerCardNumOfMax(areaCode); |
| | | } |
| | | |
| | | /** |
| | | * 创建管理卡 |
| | | * @param po |
| | | * @return |
| | | */ |
| | | public Long addManagerCard(SeManagerCard po) { |
| | | seManagerCardMapper.insert(po); |
| | | return po.getId(); |
| | | } |
| | | |
| | | /** |
| | | * 根据农户编号获取农户ID,开卡使用 |
| | | * @param clientNum |
| | | * @return |
New file |
| | |
| | | package com.dy.pipIrrSell.cardOperate.dto; |
| | | |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-07-24 11:25 |
| | | * @LastEditTime 2024-07-24 11:25 |
| | | * @Description 管理卡传输对象 |
| | | */ |
| | | |
| | | @Data |
| | | public class ManagerCard { |
| | | public static final long serialVersionUID = 202407241125001L; |
| | | |
| | | /** |
| | | * 水卡地址,仅保存,无业务 |
| | | */ |
| | | @NotBlank(message = "水卡地址不能为空") |
| | | private String cardAddr; |
| | | |
| | | /** |
| | | * 卡片类型,2-管理科,4-开关阀卡,5-清空卡 |
| | | */ |
| | | private Byte cardType; |
| | | |
| | | |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | | private String remarks; |
| | | } |
| | |
| | | No_ActiveCards(10009, "没有符合条件的开卡数据"), |
| | | No_RECHARGES(10010, "没有符合条件的充值数据"), |
| | | No_ReissueCards(10011, "没有符合条件的补卡数据"), |
| | | No_CANCELS(10010, "没有符合条件的注销数据"), |
| | | PARAMS_ERROR(10010, "操作类型参数错误"), |
| | | |
| | | THE_CARD_NOT_EXIST(10012, "没有符合条件的水卡"), |
| | | THE_CARD_NOT_SUPPORT_THIS_OPERATION(10013, "水卡状态不支持当前操作"), |
| | | |
| | | THE_FEE_CANNOT_BE_REFUNDED(10014, "原卡挂失时已退款,补卡时不能补费用"), |
| | | No_CANCELS(10012, "没有符合条件的注销数据"), |
| | | PARAMS_ERROR(10013, "操作类型参数错误"), |
| | | CREATE_MANAGER_CARD_ERROR(10014, "创建管理卡失败"), |
| | | THE_CARD_NOT_EXIST(10015, "没有符合条件的水卡"), |
| | | THE_CARD_NOT_SUPPORT_THIS_OPERATION(10016, "水卡状态不支持当前操作"), |
| | | THE_FEE_CANNOT_BE_REFUNDED(10017, "原卡挂失时已退款,补卡时不能补费用"), |
| | | |
| | | /** |
| | | * 充值 |
| | |
| | | package com.dy.pipIrrStatistics.statistics; |
| | | |
| | | import com.dy.pipIrrGlobal.daoRm.RmClientAmountDayMapper; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import com.dy.pipIrrGlobal.daoSt.StIntakeAmountYearMapper; |
| | | import com.dy.pipIrrGlobal.pojoSt.StIntakeAmountMonth; |
| | | import com.dy.pipIrrGlobal.pojoSt.StIntakeAmountYear; |
| | | import com.dy.pipIrrGlobal.pojoSt.StLossYear; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeAmountStatistics; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext ctx) throws JobExecutionException { |
| | | |
| | | stLoss = SpringContextUtil.getBean(StLoss.class); |
| | | stIntake = SpringContextUtil.getBean(StIntake.class); |
| | | stClient = SpringContextUtil.getBean(StClient.class); |