Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
9 文件已重命名
14个文件已修改
41个文件已添加
5个文件已删除
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmClientAmountDay; |
| | | import com.dy.pipIrrGlobal.voRm.VoClientAmountDay; |
| | | import com.dy.pipIrrGlobal.voRm.VoControllerAlarmState; |
| | | import com.dy.pipIrrGlobal.voSt.VoClientAmountStatistics; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<VoClientAmountDay> getClientAmountDayHistory(Map<?, ?> params); |
| | | |
| | | |
| | | /** |
| | | * 以农户维度统计用水量及费用 |
| | | * @param statisticsStartId 统计时间段开始时间对应的ID |
| | | * @param statisticsEndId 统计时间段截止时间对应的ID |
| | | * @return |
| | | */ |
| | | List<VoClientAmountStatistics> statisticsByClient(@Param("startId")Long statisticsStartId, @Param("endId")Long statisticsEndId) ; |
| | | |
| | | } |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDayLast; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmLossLast; |
| | | 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.pojoRm.RmLossHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmOnHourReportHistory; |
| | | 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 org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | * @return update count |
| | | */ |
| | | 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) ; |
| | | |
| | | } |
New file |
| | |
| | | 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 |
| | | * @Date 2024/2/28 15:31 |
| | | * @LastEditTime 2024/2/28 15:31 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface RmLossDayLastMapper extends BaseMapper<RmLossDayLast> { |
| | | /** |
| | | * delete by primary key |
| | | * @param id primaryKey |
| | | * @return deleteCount |
| | | */ |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * insert record to table |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insert(RmLossDayLast record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(RmLossDayLast record); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | RmLossDayLast selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * select by rtuAddr |
| | | * @param intakeId 控制器所绑取水口ID |
| | | * @return object by rtuAddr |
| | | */ |
| | | List<RmLossDayLast> selectByIntakeId(Long intakeId) ; |
| | | /** |
| | | * select by dt |
| | | * @param date 日期(yyyy-mm-dd) |
| | | * @return object by rtuAddr |
| | | */ |
| | | List<RmLossDayLast> selectByDate(Date date) ; |
| | | |
| | | /** |
| | | * update record selective |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKeySelective(RmLossDayLast record); |
| | | |
| | | /** |
| | | * update record |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(RmLossDayLast record); |
| | | |
| | | /** |
| | | * 根据指定条件获取记录总数 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getRecordCount(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据指定条件获取记录 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoLossDay> getLossDayLast(Map<?, ?> params); |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoRm; |
| | | |
| | | 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 |
| | | * @Date 2024/2/28 15:31 |
| | | * @LastEditTime 2024/2/28 15:31 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface RmLossDayMapper extends BaseMapper<RmLossDay> { |
| | | /** |
| | | * delete by primary key |
| | | * @param id primaryKey |
| | | * @return deleteCount |
| | | */ |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * insert record to table |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insert(RmLossDay record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(RmLossDay record); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | 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 |
| | | */ |
| | | List<RmLossDay> selectByDate(Date date) ; |
| | | |
| | | /** |
| | | * update record selective |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKeySelective(RmLossDay record); |
| | | |
| | | /** |
| | | * update record |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | 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) ; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoSt; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSt.StClientAmountMonth; |
| | | import com.dy.pipIrrGlobal.voSt.VoClientAmountStatistics; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/24 17:03 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface StClientAmountMonthMapper extends BaseMapper<StClientAmountMonth> { |
| | | /** |
| | | * delete by primary key |
| | | * @param id primaryKey |
| | | * @return deleteCount |
| | | */ |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * insert record to table |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insert(StClientAmountMonth record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(StClientAmountMonth record); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | StClientAmountMonth selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * update record selective |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKeySelective(StClientAmountMonth record); |
| | | |
| | | /** |
| | | * update record |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(StClientAmountMonth record); |
| | | |
| | | |
| | | /** |
| | | * 以农户维度统计用水量及费用 |
| | | * @param year 统计年度 |
| | | * @return |
| | | */ |
| | | List<VoClientAmountStatistics> statisticsByClient(Integer year) ; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoSt; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSt.StClientAmountYear; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/24 17:03 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface StClientAmountYearMapper extends BaseMapper<StClientAmountYear> { |
| | | /** |
| | | * delete by primary key |
| | | * @param id primaryKey |
| | | * @return deleteCount |
| | | */ |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * insert record to table |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insert(StClientAmountYear record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(StClientAmountYear record); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | StClientAmountYear selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * update record selective |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKeySelective(StClientAmountYear record); |
| | | |
| | | /** |
| | | * update record |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(StClientAmountYear record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoSt; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSt.StIntakeAmountMonth; |
| | | import com.dy.pipIrrGlobal.pojoSt.StLossMonth; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeAmountStatistics; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/24 16:38 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface StIntakeAmountMonthMapper extends BaseMapper<StIntakeAmountMonth> { |
| | | /** |
| | | * delete by primary key |
| | | * @param id primaryKey |
| | | * @return deleteCount |
| | | */ |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * insert record to table |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insert(StIntakeAmountMonth record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(StIntakeAmountMonth record); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | StIntakeAmountMonth selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * update record selective |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKeySelective(StIntakeAmountMonth record); |
| | | |
| | | /** |
| | | * update record |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(StIntakeAmountMonth record); |
| | | |
| | | /** |
| | | * 以取水口维度统计取水量 |
| | | * @param year 统计年度 |
| | | * @return |
| | | */ |
| | | List<VoIntakeAmountStatistics> statisticsByIntake(Integer year, Integer month, Long startId, Long endId) ; |
| | | /** |
| | | * 以取水口维度统计取水量 |
| | | * @param year 统计年度 |
| | | * @return |
| | | */ |
| | | List<VoIntakeAmountStatistics> statisticsByIntake(Integer year) ; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoSt; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSt.StIntakeAmountYear; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/24 16:38 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface StIntakeAmountYearMapper extends BaseMapper<StIntakeAmountYear> { |
| | | /** |
| | | * delete by primary key |
| | | * @param id primaryKey |
| | | * @return deleteCount |
| | | */ |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * insert record to table |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insert(StIntakeAmountYear record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(StIntakeAmountYear record); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | StIntakeAmountYear selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * update record selective |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKeySelective(StIntakeAmountYear record); |
| | | |
| | | /** |
| | | * update record |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(StIntakeAmountYear record); |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoSt; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSt.StLossMonth; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/24 15:48 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface StLossMonthMapper extends BaseMapper<StLossMonth> { |
| | | /** |
| | | * delete by primary key |
| | | * |
| | | * @param id primaryKey |
| | | * @return deleteCount |
| | | */ |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * insert record to table |
| | | * |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insert(StLossMonth record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(StLossMonth record); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | StLossMonth selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * update record selective |
| | | * |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKeySelective(StLossMonth record); |
| | | |
| | | /** |
| | | * update record |
| | | * |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(StLossMonth record); |
| | | |
| | | /** |
| | | * 以取水口维度统计漏损量 |
| | | * @param year 统计年度 |
| | | * @return |
| | | */ |
| | | List<VoIntakeLossStatistics> statisticsByIntake(Integer year) ; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.daoSt; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSt.StLossYear; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/24 15:18 |
| | | * @Description |
| | | */ |
| | | @Mapper |
| | | public interface StLossYearMapper extends BaseMapper<StLossYear> { |
| | | /** |
| | | * delete by primary key |
| | | * @param id primaryKey |
| | | * @return deleteCount |
| | | */ |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * insert record to table |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insert(StLossYear record); |
| | | |
| | | /** |
| | | * insert record to table selective |
| | | * @param record the record |
| | | * @return insert count |
| | | */ |
| | | int insertSelective(StLossYear record); |
| | | |
| | | /** |
| | | * select by primary key |
| | | * @param id primary key |
| | | * @return object by primary key |
| | | */ |
| | | StLossYear selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * update record selective |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKeySelective(StLossYear record); |
| | | |
| | | /** |
| | | * update record |
| | | * @param record the updated record |
| | | * @return update count |
| | | */ |
| | | int updateByPrimaryKey(StLossYear record); |
| | | } |
File was renamed from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmLossHistory.java |
| | |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "控制器日漏损水量历史数据 ") |
| | | public class RmLossHistory implements BaseEntity { |
| | | public class RmLossDay implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202402281620001L; |
| | | /** |
File was renamed from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmLossLast.java |
| | |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "控制器日漏损水量最新数据") |
| | | public class RmLossLast implements BaseEntity { |
| | | public class RmLossDayLast implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202402281621001L; |
| | | /** |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoSt; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/24 17:03 |
| | | * @Description |
| | | */ |
| | | |
| | | 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 io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | @TableName(value="rm_client_amount_month", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "农户用水量及费用月统计") |
| | | public class StClientAmountMonth implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202407241705001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 农户ID |
| | | */ |
| | | @Schema(description = "农户外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long clientId; |
| | | |
| | | /** |
| | | * 统计年度 |
| | | */ |
| | | @Schema(description = "统计年度", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer year; |
| | | |
| | | /** |
| | | * 统计月份 |
| | | */ |
| | | @Schema(description = "统计月份", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer month; |
| | | |
| | | /** |
| | | * 用水量(m3) |
| | | */ |
| | | @Schema(description = "月用水量(m3)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double amount; |
| | | |
| | | /** |
| | | * 费用(元) |
| | | */ |
| | | @Schema(description = "月费用(元)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double money; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoSt; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/24 17:03 |
| | | * @Description |
| | | */ |
| | | |
| | | 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 io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | @TableName(value="rm_client_amount_year", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "农户用水量及费用年统计") |
| | | public class StClientAmountYear implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202407241705002L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 农户ID |
| | | */ |
| | | @Schema(description = "农户外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long clientId; |
| | | |
| | | /** |
| | | * 统计年度 |
| | | */ |
| | | @Schema(description = "统计年度", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer year; |
| | | |
| | | /** |
| | | * 年用水量 |
| | | */ |
| | | @Schema(description = "年用水量(m3)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double amount; |
| | | |
| | | /** |
| | | * 年费用 |
| | | */ |
| | | @Schema(description = "年费用(元)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double money; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoSt; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/24 16:38 |
| | | * @Description |
| | | */ |
| | | |
| | | 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 io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | @TableName(value="rm_intake_amount_month", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "取水口取水量月统计") |
| | | public class StIntakeAmountMonth implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202407241644001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 取水口ID |
| | | */ |
| | | @Schema(description = "取水口外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long intakeId; |
| | | |
| | | /** |
| | | * 统计年度 |
| | | */ |
| | | @Schema(description = "统计年度", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer year; |
| | | |
| | | /** |
| | | * 统计月份 |
| | | */ |
| | | @Schema(description = "统计月份", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer month; |
| | | |
| | | /** |
| | | * 月取水量 |
| | | */ |
| | | @Schema(description = "月取水量(m3)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double amount; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoSt; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/24 16:38 |
| | | * @Description |
| | | */ |
| | | |
| | | 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 io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | @TableName(value="rm_intake_amount_year", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "取水口年取水量统计") |
| | | public class StIntakeAmountYear implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202407241644002L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 取水口ID |
| | | */ |
| | | @Schema(description = "取水口实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long intakeId; |
| | | |
| | | /** |
| | | * 统计年度 |
| | | */ |
| | | @Schema(description = "统计年度", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer year; |
| | | |
| | | /** |
| | | * 年取水量 |
| | | */ |
| | | @Schema(description = "年取水量", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double amount; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoSt; |
| | | |
| | | 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 io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/24 15:48 |
| | | * @Description 取水口漏损月统计 |
| | | */ |
| | | |
| | | @TableName(value="rm_loss_month", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "取水口漏损月统计") |
| | | public class StLossMonth implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202407241523001L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | |
| | | /** |
| | | * 取水口ID |
| | | */ |
| | | /** |
| | | * 取水口ID |
| | | */ |
| | | @Schema(description = "取水口外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long intakeId; |
| | | |
| | | /** |
| | | * 统计年 |
| | | */ |
| | | @Schema(description = "统计年度", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer year; |
| | | |
| | | /** |
| | | * 统计月 |
| | | */ |
| | | @Schema(description = "统计月份", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer month; |
| | | |
| | | /** |
| | | * 月统计 |
| | | */ |
| | | @Schema(description = "月漏损量(m3)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double amount; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.pojoSt; |
| | | |
| | | 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 io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/24 15:18 |
| | | * @Description 取水口漏损年统计 |
| | | */ |
| | | |
| | | @TableName(value="rm_loss_year", autoResultMap = true) |
| | | @Data |
| | | @Builder |
| | | @ToString |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Schema(name = "取水口漏损年统计") |
| | | public class StLossYear implements BaseEntity { |
| | | |
| | | public static final long serialVersionUID = 202407241523002L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | @TableId(type = IdType.INPUT) |
| | | public Long id; |
| | | |
| | | /** |
| | | * 取水口ID |
| | | */ |
| | | @Schema(description = "取水口实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long intakeId; |
| | | |
| | | /** |
| | | * 年度 |
| | | */ |
| | | @Schema(description = "统计年度", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Integer year; |
| | | |
| | | /** |
| | | * 年漏损统计 |
| | | */ |
| | | @Schema(description = "年漏损量(m3)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | | public Double amount; |
| | | |
| | | } |
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.voSt; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/24 17:09 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | public class VoClientAmountStatistics { |
| | | public Long clientId ; |
| | | public Double amount; |
| | | public Double money; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voSt; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/24 14:16 |
| | | * @Description 以取水口统计漏损 |
| | | */ |
| | | @Data |
| | | public class VoIntakeAmountStatistics { |
| | | public Long intakeId ; |
| | | public Double amount; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voSt; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/24 14:16 |
| | | * @Description 以取水口统计漏损 |
| | | */ |
| | | @Data |
| | | public class VoIntakeLossStatistics { |
| | | public Long intakeId ; |
| | | public Double amount; |
| | | } |
| | |
| | | |
| | | pipIrr: |
| | | global: |
| | | dev: false #是否开发阶段,true或false |
| | | dev: true #是否开发阶段,true或false |
| | | dsName: ym #开发阶段,设置临时的数据库名称 |
| | | mw: |
| | | webPort: 8070 |
| | |
| | | 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> |
| | | |
| | | |
| | | <select id="statisticsByClient" resultType="com.dy.pipIrrGlobal.voSt.VoClientAmountStatistics"> |
| | | 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 |
| | | </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_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) amount |
| | | from rm_intake_amount_day |
| | | where id <![CDATA[>=]]> #{startId, jdbcType=BIGINT} and id <![CDATA[<]]> #{endId, jdbcType=BIGINT} |
| | | group by intake_id |
| | | </select> |
| | | </mapper> |
File was renamed from pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmLossLastMapper.xml |
| | |
| | | <?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.daoRm.RmLossLastMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmLossLast"> |
| | | <mapper namespace="com.dy.pipIrrGlobal.daoRm.RmLossDayLastMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmLossDayLast"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_loss_last--> |
| | | <!--@Table rm_loss_day_last--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="last_history_id" jdbcType="BIGINT" property="lastHistoryId" /> |
| | | <result column="controller_id" jdbcType="BIGINT" property="controllerId" /> |
| | |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_loss_last |
| | | from rm_loss_day_last |
| | | 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_last |
| | | from rm_loss_day_last |
| | | where intake_id = #{intakeId,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="selectByDate" parameterType="java.util.Date" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from rm_loss_last |
| | | from rm_loss_day_last |
| | | where dt = #{dt,jdbcType=DATE} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_loss_last |
| | | delete from rm_loss_day_last |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossLast"> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossDayLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_loss_last (id, last_history_id, controller_id, |
| | | 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.RmLossLast"> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossDayLast"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_loss_last |
| | | insert into rm_loss_day_last |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossLast"> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossDayLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_loss_last |
| | | update rm_loss_day_last |
| | | <set> |
| | | <if test="lastHistoryId != null"> |
| | | last_history_id = #{lastHistoryId,jdbcType=BIGINT}, |
| | |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossLast"> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossDayLast"> |
| | | <!--@mbg.generated--> |
| | | update rm_loss_last |
| | | update rm_loss_day_last |
| | | set last_history_id = #{lastHistoryId,jdbcType=BIGINT}, |
| | | controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | |
| | | 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> |
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.daoRm.RmLossDayMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmLossDay"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table rm_loss_day--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="controller_id" jdbcType="BIGINT" property="controllerId" /> |
| | | <result column="intake_id" jdbcType="BIGINT" property="intakeId" /> |
| | | <result column="rtu_addr" jdbcType="VARCHAR" property="rtuAddr" /> |
| | | <result column="dt" jdbcType="DATE" property="dt" /> |
| | | <result column="dt_last" jdbcType="TIMESTAMP" property="dtLast" /> |
| | | <result column="dt_rtu" jdbcType="TIMESTAMP" property="dtRtu" /> |
| | | <result column="loss_amount" jdbcType="DOUBLE" property="lossAmount" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, controller_id, intake_id, rtu_addr, dt, dt_last, dt_rtu, loss_amount |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | 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 |
| | | <include refid="Base_Column_List" /> |
| | | from rm_loss_day |
| | | where dt = #{dt,jdbcType=DATE} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from rm_loss_day |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <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} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossDay"> |
| | | <!--@mbg.generated--> |
| | | insert into rm_loss_day |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="controllerId != null"> |
| | | controller_id, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | intake_id, |
| | | </if> |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="dtLast != null"> |
| | | dt_last, |
| | | </if> |
| | | <if test="dtRtu != null"> |
| | | dt_rtu, |
| | | </if> |
| | | <if test="lossAmount != null"> |
| | | loss_amount, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="controllerId != null"> |
| | | #{controllerId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuAddr != null"> |
| | | #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="dtLast != null"> |
| | | #{dtLast,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="dtRtu != null"> |
| | | #{dtRtu,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="lossAmount != null"> |
| | | #{lossAmount,jdbcType=DOUBLE}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossDay"> |
| | | <!--@mbg.generated--> |
| | | update rm_loss_day |
| | | <set> |
| | | <if test="controllerId != null"> |
| | | controller_id = #{controllerId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="rtuAddr != null"> |
| | | rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=DATE}, |
| | | </if> |
| | | <if test="dtLast != null"> |
| | | dt_last = #{dtLast,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="dtRtu != null"> |
| | | dt_rtu = #{dtRtu,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="lossAmount != null"> |
| | | loss_amount = #{lossAmount,jdbcType=DOUBLE}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmLossDay"> |
| | | <!--@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} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <!--根据指定条件获取记录总数--> |
| | | <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> |
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.daoSt.StClientAmountMonthMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSt.StClientAmountMonth"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table st_client_amount_month--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="client_id" jdbcType="BIGINT" property="clientId" /> |
| | | <result column="year" jdbcType="INTEGER" property="year" /> |
| | | <result column="month" jdbcType="INTEGER" property="month" /> |
| | | <result column="amount" jdbcType="FLOAT" property="amount" /> |
| | | <result column="money" jdbcType="FLOAT" property="money" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, client_id, `year`, `month`, amount, money |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from st_client_amount_month |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from st_client_amount_month |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSt.StClientAmountMonth"> |
| | | <!--@mbg.generated--> |
| | | insert into st_client_amount_month (id, client_id, `year`, |
| | | `month`, amount, money) |
| | | values (#{id,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT}, #{year,jdbcType=INTEGER}, |
| | | #{month,jdbcType=INTEGER}, #{amount,jdbcType=FLOAT}, #{money,jdbcType=FLOAT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSt.StClientAmountMonth"> |
| | | <!--@mbg.generated--> |
| | | insert into st_client_amount_month |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="clientId != null"> |
| | | client_id, |
| | | </if> |
| | | <if test="year != null"> |
| | | `year`, |
| | | </if> |
| | | <if test="month != null"> |
| | | `month`, |
| | | </if> |
| | | <if test="amount != null"> |
| | | amount, |
| | | </if> |
| | | <if test="money != null"> |
| | | money, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientId != null"> |
| | | #{clientId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="year != null"> |
| | | #{year,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="month != null"> |
| | | #{month,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="amount != null"> |
| | | #{amount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="money != null"> |
| | | #{money,jdbcType=FLOAT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSt.StClientAmountMonth"> |
| | | <!--@mbg.generated--> |
| | | update st_client_amount_month |
| | | <set> |
| | | <if test="clientId != null"> |
| | | client_id = #{clientId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="year != null"> |
| | | `year` = #{year,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="month != null"> |
| | | `month` = #{month,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="amount != null"> |
| | | amount = #{amount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="money != null"> |
| | | money = #{money,jdbcType=FLOAT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSt.StClientAmountMonth"> |
| | | <!--@mbg.generated--> |
| | | update st_client_amount_month |
| | | set client_id = #{clientId,jdbcType=BIGINT}, |
| | | `year` = #{year,jdbcType=INTEGER}, |
| | | `month` = #{month,jdbcType=INTEGER}, |
| | | amount = #{amount,jdbcType=FLOAT}, |
| | | money = #{money,jdbcType=FLOAT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | |
| | | <select id="statisticsByClient" resultType="com.dy.pipIrrGlobal.voSt.VoClientAmountStatistics"> |
| | | select client_id, sum(amount) as amount, sum(money) as money |
| | | from st_client_amount_month |
| | | where `year` = #{year,jdbcType=INTEGER} |
| | | group by client_id |
| | | </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.daoSt.StClientAmountYearMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSt.StClientAmountYear"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table st_client_amount_year--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="client_id" jdbcType="BIGINT" property="clientId" /> |
| | | <result column="year" jdbcType="INTEGER" property="year" /> |
| | | <result column="amount" jdbcType="FLOAT" property="amount" /> |
| | | <result column="money" jdbcType="FLOAT" property="money" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, client_id, `year`, amount, money |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from st_client_amount_year |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from st_client_amount_year |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSt.StClientAmountYear"> |
| | | <!--@mbg.generated--> |
| | | insert into st_client_amount_year (id, client_id, `year`, |
| | | amount, money) |
| | | values (#{id,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT}, #{year,jdbcType=INTEGER}, |
| | | #{amount,jdbcType=FLOAT}, #{money,jdbcType=FLOAT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSt.StClientAmountYear"> |
| | | <!--@mbg.generated--> |
| | | insert into st_client_amount_year |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="clientId != null"> |
| | | client_id, |
| | | </if> |
| | | <if test="year != null"> |
| | | `year`, |
| | | </if> |
| | | <if test="amount != null"> |
| | | amount, |
| | | </if> |
| | | <if test="money != null"> |
| | | money, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="clientId != null"> |
| | | #{clientId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="year != null"> |
| | | #{year,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="amount != null"> |
| | | #{amount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="money != null"> |
| | | #{money,jdbcType=FLOAT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSt.StClientAmountYear"> |
| | | <!--@mbg.generated--> |
| | | update st_client_amount_year |
| | | <set> |
| | | <if test="clientId != null"> |
| | | client_id = #{clientId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="year != null"> |
| | | `year` = #{year,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="amount != null"> |
| | | amount = #{amount,jdbcType=FLOAT}, |
| | | </if> |
| | | <if test="money != null"> |
| | | money = #{money,jdbcType=FLOAT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSt.StClientAmountYear"> |
| | | <!--@mbg.generated--> |
| | | update st_client_amount_year |
| | | set client_id = #{clientId,jdbcType=BIGINT}, |
| | | `year` = #{year,jdbcType=INTEGER}, |
| | | amount = #{amount,jdbcType=FLOAT}, |
| | | money = #{money,jdbcType=FLOAT} |
| | | 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.daoSt.StIntakeAmountMonthMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSt.StIntakeAmountMonth"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table st_intake_amount_month--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="intake_id" jdbcType="BIGINT" property="intakeId" /> |
| | | <result column="year" jdbcType="INTEGER" property="year" /> |
| | | <result column="month" jdbcType="INTEGER" property="month" /> |
| | | <result column="amount" jdbcType="FLOAT" property="amount" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, intake_id, `year`, `month`, amount |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from st_intake_amount_month |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from st_intake_amount_month |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSt.StIntakeAmountMonth"> |
| | | <!--@mbg.generated--> |
| | | insert into st_intake_amount_month (id, intake_id, `year`, |
| | | `month`, amount) |
| | | values (#{id,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, #{year,jdbcType=INTEGER}, |
| | | #{month,jdbcType=INTEGER}, #{amount,jdbcType=FLOAT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSt.StIntakeAmountMonth"> |
| | | <!--@mbg.generated--> |
| | | insert into st_intake_amount_month |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | intake_id, |
| | | </if> |
| | | <if test="year != null"> |
| | | `year`, |
| | | </if> |
| | | <if test="month != null"> |
| | | `month`, |
| | | </if> |
| | | <if test="amount != null"> |
| | | amount, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="year != null"> |
| | | #{year,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="month != null"> |
| | | #{month,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="amount != null"> |
| | | #{amount,jdbcType=FLOAT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSt.StIntakeAmountMonth"> |
| | | <!--@mbg.generated--> |
| | | update st_intake_amount_month |
| | | <set> |
| | | <if test="intakeId != null"> |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="year != null"> |
| | | `year` = #{year,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="month != null"> |
| | | `month` = #{month,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="amount != null"> |
| | | amount = #{amount,jdbcType=FLOAT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSt.StIntakeAmountMonth"> |
| | | <!--@mbg.generated--> |
| | | update st_intake_amount_month |
| | | set intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | `year` = #{year,jdbcType=INTEGER}, |
| | | `month` = #{month,jdbcType=INTEGER}, |
| | | amount = #{amount,jdbcType=FLOAT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="statisticsByIntake" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAmountStatistics"> |
| | | select intake_id, sum(amount) as amount |
| | | from st_intake_amount_month |
| | | where `year` = #{year,jdbcType=INTEGER} |
| | | group by intake_id |
| | | </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.daoSt.StIntakeAmountYearMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSt.StIntakeAmountYear"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table st_intake_amount_year--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="intake_id" jdbcType="BIGINT" property="intakeId" /> |
| | | <result column="year" jdbcType="INTEGER" property="year" /> |
| | | <result column="amount" jdbcType="FLOAT" property="amount" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, intake_id, `year`, amount |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from st_intake_amount_year |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from st_intake_amount_year |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSt.StIntakeAmountYear"> |
| | | <!--@mbg.generated--> |
| | | insert into st_intake_amount_year (id, intake_id, `year`, |
| | | amount) |
| | | values (#{id,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, #{year,jdbcType=INTEGER}, |
| | | #{amount,jdbcType=FLOAT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSt.StIntakeAmountYear"> |
| | | <!--@mbg.generated--> |
| | | insert into st_intake_amount_year |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | intake_id, |
| | | </if> |
| | | <if test="year != null"> |
| | | `year`, |
| | | </if> |
| | | <if test="amount != null"> |
| | | amount, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="year != null"> |
| | | #{year,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="amount != null"> |
| | | #{amount,jdbcType=FLOAT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSt.StIntakeAmountYear"> |
| | | <!--@mbg.generated--> |
| | | update st_intake_amount_year |
| | | <set> |
| | | <if test="intakeId != null"> |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="year != null"> |
| | | `year` = #{year,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="amount != null"> |
| | | amount = #{amount,jdbcType=FLOAT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSt.StIntakeAmountYear"> |
| | | <!--@mbg.generated--> |
| | | update st_intake_amount_year |
| | | set intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | `year` = #{year,jdbcType=INTEGER}, |
| | | amount = #{amount,jdbcType=FLOAT} |
| | | 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.daoSt.StLossMonthMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSt.StLossMonth"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table st_loss_month--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="intake_id" jdbcType="BIGINT" property="intakeId" /> |
| | | <result column="year" jdbcType="INTEGER" property="year" /> |
| | | <result column="month" jdbcType="INTEGER" property="month" /> |
| | | <result column="amount" jdbcType="FLOAT" property="amount" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, intake_id, `year`, `month`, amount |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from st_loss_month |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from st_loss_month |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSt.StLossMonth"> |
| | | <!--@mbg.generated--> |
| | | insert into st_loss_month (id, intake_id, `year`, |
| | | `month`, amount) |
| | | values (#{id,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, #{year,jdbcType=INTEGER}, |
| | | #{month,jdbcType=INTEGER}, #{amount,jdbcType=FLOAT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSt.StLossMonth"> |
| | | <!--@mbg.generated--> |
| | | insert into st_loss_month |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | intake_id, |
| | | </if> |
| | | <if test="year != null"> |
| | | `year`, |
| | | </if> |
| | | <if test="month != null"> |
| | | `month`, |
| | | </if> |
| | | <if test="amount != null"> |
| | | amount, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="year != null"> |
| | | #{year,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="month != null"> |
| | | #{month,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="amount != null"> |
| | | #{amount,jdbcType=FLOAT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSt.StLossMonth"> |
| | | <!--@mbg.generated--> |
| | | update st_loss_month |
| | | <set> |
| | | <if test="intakeId != null"> |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="year != null"> |
| | | `year` = #{year,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="month != null"> |
| | | `month` = #{month,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="amount != null"> |
| | | amount = #{amount,jdbcType=FLOAT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSt.StLossMonth"> |
| | | <!--@mbg.generated--> |
| | | update st_loss_month |
| | | set intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | `year` = #{year,jdbcType=INTEGER}, |
| | | `month` = #{month,jdbcType=INTEGER}, |
| | | amount = #{amount,jdbcType=FLOAT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | |
| | | <select id="statisticsByIntake" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics"> |
| | | select intake_id, sum(amount) as amount |
| | | from st_loss_month |
| | | where `year` = #{year,jdbcType=INTEGER} |
| | | group by intake_id |
| | | </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.daoSt.StLossYearMapper"> |
| | | <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSt.StLossYear"> |
| | | <!--@mbg.generated--> |
| | | <!--@Table st_loss_year--> |
| | | <id column="id" jdbcType="BIGINT" property="id" /> |
| | | <result column="intake_id" jdbcType="BIGINT" property="intakeId" /> |
| | | <result column="year" jdbcType="INTEGER" property="year" /> |
| | | <result column="amount" jdbcType="FLOAT" property="amount" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, intake_id, `year`, amount |
| | | </sql> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from st_loss_year |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | delete from st_loss_year |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSt.StLossYear"> |
| | | <!--@mbg.generated--> |
| | | insert into st_loss_year (id, intake_id, `year`, amount) |
| | | values (#{id,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, #{year,jdbcType=INTEGER}, |
| | | #{amount,jdbcType=FLOAT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSt.StLossYear"> |
| | | <!--@mbg.generated--> |
| | | insert into st_loss_year |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | intake_id, |
| | | </if> |
| | | <if test="year != null"> |
| | | `year`, |
| | | </if> |
| | | <if test="amount != null"> |
| | | amount, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="intakeId != null"> |
| | | #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="year != null"> |
| | | #{year,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="amount != null"> |
| | | #{amount,jdbcType=FLOAT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSt.StLossYear"> |
| | | <!--@mbg.generated--> |
| | | update st_loss_year |
| | | <set> |
| | | <if test="intakeId != null"> |
| | | intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="year != null"> |
| | | `year` = #{year,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="amount != null"> |
| | | amount = #{amount,jdbcType=FLOAT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSt.StLossYear"> |
| | | <!--@mbg.generated--> |
| | | update st_loss_year |
| | | set intake_id = #{intakeId,jdbcType=BIGINT}, |
| | | `year` = #{year,jdbcType=INTEGER}, |
| | | amount = #{amount,jdbcType=FLOAT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | package com.dy.rtuMw.server.rtuData.dbSv; |
| | | |
| | | import com.dy.common.util.NumUtil; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pipIrrGlobal.daoBa.BaClientMapper; |
| | | import com.dy.pipIrrGlobal.daoPr.PrControllerMapper; |
| | | import com.dy.pipIrrGlobal.daoPr.PrControllerTrampMapper; |
| | | import com.dy.pipIrrGlobal.daoRm.*; |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaClient; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrController; |
| | | import com.dy.pipIrrGlobal.pojoPr.PrControllerTramp; |
| | | import com.dy.pipIrrGlobal.pojoRm.*; |
| | |
| | | @Autowired |
| | | private RmClientAmountDayMapper rmClientAmountDayMapperDao ;//农户日用水量统计数据DAO |
| | | @Autowired |
| | | private RmLossLastMapper rmLossLastMapperDao ;//控制器漏损水量统计最新数据DAO |
| | | private RmLossDayLastMapper rmLossLastMapperDao ;//控制器漏损水量统计最新数据DAO |
| | | @Autowired |
| | | private RmLossHistoryMapper rmLossHistoryMapperDao ;//控制器漏损水量统计历史数据DAO |
| | | private RmLossDayMapper rmLossHistoryMapperDao ;//控制器漏损水量统计历史数据DAO |
| | | @Autowired |
| | | private RmCommandHistoryMapper rmCommandHistoryDao ;//远程命令日志相关 |
| | | @Autowired |
| | |
| | | * @param intakeId |
| | | * @return |
| | | */ |
| | | public RmLossLast getRmLossLast(Long intakeId){ |
| | | List<RmLossLast> list = rmLossLastMapperDao.selectByIntakeId(intakeId) ; |
| | | public RmLossDayLast getRmLossLast(Long intakeId){ |
| | | List<RmLossDayLast> list = rmLossLastMapperDao.selectByIntakeId(intakeId) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmLossLast(RmLossLast po){ |
| | | public void saveRmLossLast(RmLossDayLast po){ |
| | | this.rmLossLastMapperDao.insert(po) ; |
| | | } |
| | | /** |
| | |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveRmLossHistory(RmLossHistory po){ |
| | | public void saveRmLossHistory(RmLossDay po){ |
| | | this.rmLossHistoryMapperDao.insert(po) ; |
| | | } |
| | | /** |
| | |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateRmLossLast(RmLossLast po){ |
| | | public void updateRmLossLast(RmLossDayLast po){ |
| | | this.rmLossLastMapperDao.updateByPrimaryKey(po) ; |
| | | } |
| | | /** |
| | |
| | | * @param po |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateRmLossHistory(RmLossHistory po){ |
| | | public void updateRmLossHistory(RmLossDay po){ |
| | | this.rmLossHistoryMapperDao.updateByPrimaryKey(po) ; |
| | | } |
| | | |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public RmLossHistory getRmLossHistory(Long id){ |
| | | public RmLossDay getRmLossHistory(Long id){ |
| | | return rmLossHistoryMapperDao.selectByPrimaryKey(id) ; |
| | | } |
| | | |
| | |
| | | * @param dt |
| | | * @return |
| | | */ |
| | | public RmLossLast getRmLossLastByDate(Date dt){ |
| | | List<RmLossLast> list = rmLossLastMapperDao.selectByDate(dt) ; |
| | | public RmLossDayLast getRmLossLastByDate(Date dt){ |
| | | List<RmLossDayLast> list = rmLossLastMapperDao.selectByDate(dt) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | |
| | | * @param dt |
| | | * @return |
| | | */ |
| | | public RmLossHistory getRmLossHistoryByDate(Date dt){ |
| | | List<RmLossHistory> list = rmLossHistoryMapperDao.selectByDate(dt) ; |
| | | public RmLossDay getRmLossHistoryByDate(Date dt){ |
| | | List<RmLossDay> list = rmLossHistoryMapperDao.selectByDate(dt) ; |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0) ; |
| | | } |
| | |
| | | package com.dy.rtuMw.server.rtuData.p206V1_0_0; |
| | | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmLossHistory; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmLossLast; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmLossDay; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmLossDayLast; |
| | | import com.dy.rtuMw.server.rtuData.TaskSurpport; |
| | | import com.dy.rtuMw.server.rtuData.dbSv.DbSv; |
| | | import com.dy.common.mw.protocol.Data; |
| | |
| | | * @param dataCdC0Vo 开阀上报数据对象 |
| | | */ |
| | | private void doDeal(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo dataCdC0Vo) throws Exception { |
| | | RmLossLast poLast = sv.getRmLossLast(controller.getIntakeId()); |
| | | RmLossDayLast poLast = sv.getRmLossLast(controller.getIntakeId()); |
| | | if (poLast == null) { |
| | | //数据库中不存在该取水口的漏损数据 |
| | | //首先生成最新数据及历史数据,并先保存 |
| | |
| | | if(DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCdC0Vo.rtuDt).equals(poLast.dtRtu)){ |
| | | //时间一致,重复上报数据,不进行任何处理 |
| | | }else{ |
| | | RmLossHistory poHistory = null ; |
| | | RmLossDay poHistory = null ; |
| | | if(poLast.lastHistoryId != null){ |
| | | poHistory = sv.getRmLossHistory(poLast.lastHistoryId) ; |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | private RmLossLast newRmLossLast(PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo cdData)throws Exception { |
| | | RmLossLast po = new RmLossLast() ; |
| | | private RmLossDayLast newRmLossLast(PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo cdData)throws Exception { |
| | | RmLossDayLast po = new RmLossDayLast() ; |
| | | po.controllerId = controller==null?null:controller.getId(); |
| | | po.intakeId = controller==null?null:controller.getIntakeId(); |
| | | po.rtuAddr = rtuAddr; |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | private RmLossHistory newRmLossHistory(PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo cdData)throws Exception { |
| | | RmLossHistory po = new RmLossHistory() ; |
| | | private RmLossDay newRmLossHistory(PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo cdData)throws Exception { |
| | | RmLossDay po = new RmLossDay() ; |
| | | po.controllerId = controller==null?null:controller.getId(); |
| | | po.intakeId = controller==null?null:controller.getIntakeId(); |
| | | po.rtuAddr = rtuAddr; |
| | |
| | | * @throws Exception |
| | | * @return RmLossHistory |
| | | */ |
| | | private RmLossHistory newAndSaveHistoryDataDeal(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo dataCdC0Vo, RmLossLast poLast)throws Exception { |
| | | RmLossHistory poHistory = this.newRmLossHistory(controller, rtuAddr, dV1_0_1, dataCdC0Vo) ; |
| | | private RmLossDay newAndSaveHistoryDataDeal(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo dataCdC0Vo, RmLossDayLast poLast)throws Exception { |
| | | RmLossDay poHistory = this.newRmLossHistory(controller, rtuAddr, dV1_0_1, dataCdC0Vo) ; |
| | | sv.saveRmLossHistory(poHistory); |
| | | //由最新数据持有历史数据中的最新记录ID,以方便快速查询 |
| | | poLast.lastHistoryId = poHistory == null ? null: poHistory.id ; |
| | |
| | | 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()); |
| | | } |
| | | } |
| | | } |
File was renamed from pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/ClientAmountDayQueryVo.java |
| | |
| | | package com.dy.pipIrrRemote.records; |
| | | package com.dy.pipIrrRemote.records.clientAmountDay; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.*; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.sql.Date; |
| | | |
| | | /** |
| | | * @author :WuZeYu |
| | |
| | | private String clientName; |
| | | |
| | | @Schema(description = "统计开始日期", 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 Date startDt; |
| | | |
| | | @Schema(description = "统计结束日期", 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 Date endDt; |
| | | } |
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()); |
| | | } |
| | | } |
| | | } |
File was renamed from pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/ControllerAlarmStateQueryVo.java |
| | |
| | | package com.dy.pipIrrRemote.records; |
| | | package com.dy.pipIrrRemote.records.controllerAlarmState; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
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; |
| | | } |
| | | } |
File was renamed from pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/listeners/StClient.java |
| | |
| | | package com.dy.pipIrrStatistics.listeners; |
| | | 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; |
| | |
| | | |
| | | private static Logger log = LogManager.getLogger(StClient.class.getName()) ; |
| | | |
| | | @Autowired |
| | | protected RmClientAmountDayMapper rmClientAmountDayDao ; |
| | | |
| | | private String statisticsYyyy_mm; |
| | | @Autowired |
| | | protected StClientSv sv ; |
| | | |
| | | private Integer statisticsYear; |
| | | private Integer statisticsMonth; |
| | | private Long statisticsStartId ; |
| | | private Long statisticsEndId ; |
| | | |
| | | protected void statistics(String statisticsYyyy_mm, |
| | | protected void statistics(Integer statisticsYear, |
| | | Integer statisticsMonth, |
| | | Long statisticsStartId, |
| | | Long statisticsEndId){ |
| | | this.statisticsYyyy_mm = statisticsYyyy_mm ; |
| | | this.statisticsYear = statisticsYear ; |
| | | this.statisticsMonth = statisticsMonth ; |
| | | this.statisticsStartId = statisticsStartId ; |
| | | this.statisticsEndId = statisticsEndId ; |
| | | this.statisticsMonth() ; |
| | |
| | | * 月统计---农户 |
| | | */ |
| | | private void statisticsMonth(){ |
| | | log.info(statisticsYyyy_mm + " " + statisticsStartId + " " + statisticsEndId); |
| | | log.info(rmClientAmountDayDao.toString()); |
| | | sv.statisticsMonth(statisticsYear, statisticsMonth, statisticsStartId, statisticsEndId); |
| | | } |
| | | |
| | | /** |
| | | * 年统计---农户 |
| | | */ |
| | | private void statisticsYear(){ |
| | | |
| | | sv.statisticsYear(statisticsYear); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrStatistics.statistics; |
| | | |
| | | import com.dy.pipIrrGlobal.daoRm.RmClientAmountDayMapper; |
| | | import com.dy.pipIrrGlobal.daoSt.StClientAmountMonthMapper; |
| | | import com.dy.pipIrrGlobal.daoSt.StClientAmountYearMapper; |
| | | import com.dy.pipIrrGlobal.pojoSt.StClientAmountMonth; |
| | | import com.dy.pipIrrGlobal.pojoSt.StClientAmountYear; |
| | | import com.dy.pipIrrGlobal.voSt.VoClientAmountStatistics; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/24 16:28 |
| | | * @Description |
| | | */ |
| | | @Component |
| | | public class StClientSv { |
| | | |
| | | @Autowired |
| | | protected RmClientAmountDayMapper rmClientAmountDayDao; |
| | | |
| | | @Autowired |
| | | protected StClientAmountMonthMapper stClientAmountMonthDao ; |
| | | |
| | | @Autowired |
| | | protected StClientAmountYearMapper stClientAmountYearDao ; |
| | | |
| | | /** |
| | | * 月统计---漏损 |
| | | */ |
| | | @Transactional |
| | | protected void statisticsMonth(Integer statisticsYear, Integer statisticsMonth, Long statisticsStartId, Long statisticsEndId){ |
| | | List<VoClientAmountStatistics> list = rmClientAmountDayDao.statisticsByClient(statisticsStartId, statisticsEndId) ; |
| | | if(list != null && list.size() > 0){ |
| | | for(VoClientAmountStatistics vo : list){ |
| | | StClientAmountMonth po = new StClientAmountMonth() ; |
| | | po.clientId = vo.clientId ; |
| | | po.year = statisticsYear ; |
| | | po.month = statisticsMonth ; |
| | | po.amount = vo.amount; |
| | | stClientAmountMonthDao.insert(po) ; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 年统计---漏损 |
| | | */ |
| | | @Transactional |
| | | protected void statisticsYear(Integer statisticsYear){ |
| | | List<VoClientAmountStatistics> list = stClientAmountMonthDao.statisticsByClient(statisticsYear) ; |
| | | if(list != null && list.size() > 0){ |
| | | for(VoClientAmountStatistics vo : list){ |
| | | StClientAmountYear po = new StClientAmountYear() ; |
| | | po.clientId = vo.clientId ; |
| | | po.year = statisticsYear ; |
| | | po.amount = vo.amount; |
| | | stClientAmountYearDao.insert(po) ; |
| | | } |
| | | } |
| | | } |
| | | } |
File was renamed from pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/listeners/StIntake.java |
| | |
| | | package com.dy.pipIrrStatistics.listeners; |
| | | package com.dy.pipIrrStatistics.statistics; |
| | | |
| | | import com.dy.pipIrrGlobal.daoRm.RmIntakeAmountDayMapper; |
| | | import org.apache.logging.log4j.LogManager; |
| | |
| | | private static Logger log = LogManager.getLogger(StIntake.class.getName()) ; |
| | | |
| | | @Autowired |
| | | protected RmIntakeAmountDayMapper rmIntakeAmountDayDao ; |
| | | protected StIntakeSv sv ; |
| | | |
| | | private String statisticsYyyy_mm; |
| | | private Integer statisticsYear; |
| | | private Integer statisticsMonth; |
| | | private Long statisticsStartId ; |
| | | private Long statisticsEndId ; |
| | | |
| | | protected void statistics(String statisticsYyyy_mm, |
| | | protected void statistics(Integer statisticsYear, |
| | | Integer statisticsMonth, |
| | | Long statisticsStartId, |
| | | Long statisticsEndId){ |
| | | this.statisticsYyyy_mm = statisticsYyyy_mm ; |
| | | this.statisticsYear = statisticsYear ; |
| | | this.statisticsMonth = statisticsMonth ; |
| | | this.statisticsStartId = statisticsStartId ; |
| | | this.statisticsEndId = statisticsEndId ; |
| | | this.statisticsMonth() ; |
| | |
| | | * 月统计---取水口 |
| | | */ |
| | | private void statisticsMonth(){ |
| | | log.info(statisticsYyyy_mm + " " + statisticsStartId + " " + statisticsEndId); |
| | | log.info(rmIntakeAmountDayDao.toString()); |
| | | sv.statisticsMonth(statisticsYear, statisticsMonth, statisticsStartId, statisticsEndId); |
| | | } |
| | | |
| | | /** |
| | | * 年统计---取水口 |
| | | */ |
| | | private void statisticsYear(){ |
| | | |
| | | sv.statisticsYear(statisticsYear); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrStatistics.statistics; |
| | | |
| | | import com.dy.pipIrrGlobal.daoRm.RmIntakeAmountDayMapper; |
| | | import com.dy.pipIrrGlobal.daoSt.StIntakeAmountMonthMapper; |
| | | 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; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/24 16:28 |
| | | * @Description |
| | | */ |
| | | @Component |
| | | public class StIntakeSv { |
| | | |
| | | @Autowired |
| | | protected RmIntakeAmountDayMapper rmIntakeAmountDayDao; |
| | | |
| | | @Autowired |
| | | protected StIntakeAmountMonthMapper stIntakeAmountMonthDao ; |
| | | |
| | | @Autowired |
| | | protected StIntakeAmountYearMapper stIntakeAmountYearDao ; |
| | | |
| | | /** |
| | | * 月统计---漏损 |
| | | */ |
| | | @Transactional |
| | | protected void statisticsMonth(Integer statisticsYear, Integer statisticsMonth, Long statisticsStartId, Long statisticsEndId){ |
| | | List<VoIntakeAmountStatistics> list = rmIntakeAmountDayDao.statisticsByIntake(statisticsStartId, statisticsEndId) ; |
| | | if(list != null && list.size() > 0){ |
| | | for(VoIntakeAmountStatistics vo : list){ |
| | | StIntakeAmountMonth po = new StIntakeAmountMonth() ; |
| | | po.intakeId = vo.intakeId ; |
| | | po.year = statisticsYear ; |
| | | po.month = statisticsMonth ; |
| | | po.amount = vo.amount; |
| | | stIntakeAmountMonthDao.insert(po) ; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 年统计---漏损 |
| | | */ |
| | | @Transactional |
| | | protected void statisticsYear(Integer statisticsYear){ |
| | | List<VoIntakeAmountStatistics> list = stIntakeAmountMonthDao.statisticsByIntake(statisticsYear) ; |
| | | if(list != null && list.size() > 0){ |
| | | for(VoIntakeAmountStatistics vo : list){ |
| | | StIntakeAmountYear po = new StIntakeAmountYear() ; |
| | | po.intakeId = vo.intakeId ; |
| | | po.year = statisticsYear ; |
| | | po.amount = vo.amount; |
| | | stIntakeAmountYearDao.insert(po) ; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
File was renamed from pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/listeners/StLoss.java |
| | |
| | | package com.dy.pipIrrStatistics.listeners; |
| | | package com.dy.pipIrrStatistics.statistics; |
| | | |
| | | import com.dy.pipIrrGlobal.daoRm.RmLossHistoryMapper; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private static Logger log = LogManager.getLogger(StLoss.class.getName()) ; |
| | | |
| | | @Autowired |
| | | protected RmLossHistoryMapper rmLossHistoryDao ; |
| | | protected StLossSv sv ; |
| | | |
| | | private String statisticsYyyy_mm; |
| | | private Integer statisticsYear; |
| | | private Integer statisticsMonth; |
| | | private Long statisticsStartId ; |
| | | private Long statisticsEndId ; |
| | | |
| | | protected void statistics(String statisticsYyyy_mm, |
| | | protected void statistics(Integer statisticsYear, |
| | | Integer statisticsMonth, |
| | | Long statisticsStartId, |
| | | Long statisticsEndId){ |
| | | this.statisticsYyyy_mm = statisticsYyyy_mm ; |
| | | this.statisticsYear = statisticsYear ; |
| | | this.statisticsMonth = statisticsMonth ; |
| | | this.statisticsStartId = statisticsStartId ; |
| | | this.statisticsEndId = statisticsEndId ; |
| | | this.statisticsMonth() ; |
| | |
| | | * 月统计---漏损 |
| | | */ |
| | | private void statisticsMonth(){ |
| | | log.info(statisticsYyyy_mm + " " + statisticsStartId + " " + statisticsEndId); |
| | | log.info(rmLossHistoryDao.toString()); |
| | | sv.statisticsMonth(statisticsYear, statisticsMonth, statisticsStartId, statisticsEndId); |
| | | } |
| | | |
| | | /** |
| | | * 年统计---漏损 |
| | | */ |
| | | private void statisticsYear(){ |
| | | |
| | | sv.statisticsYear(statisticsYear); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrStatistics.statistics; |
| | | |
| | | import com.dy.pipIrrGlobal.daoRm.RmLossDayMapper; |
| | | import com.dy.pipIrrGlobal.daoSt.StLossMonthMapper; |
| | | import com.dy.pipIrrGlobal.daoSt.StLossYearMapper; |
| | | import com.dy.pipIrrGlobal.pojoSt.StLossMonth; |
| | | import com.dy.pipIrrGlobal.pojoSt.StLossYear; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/24 11:24 |
| | | * @Description |
| | | */ |
| | | @Component |
| | | public class StLossSv { |
| | | |
| | | @Autowired |
| | | protected RmLossDayMapper rmLossDayDao; |
| | | |
| | | @Autowired |
| | | protected StLossMonthMapper stLossMonthDao ; |
| | | |
| | | @Autowired |
| | | protected StLossYearMapper stLossYearDao ; |
| | | |
| | | /** |
| | | * 月统计---漏损 |
| | | */ |
| | | @Transactional |
| | | protected void statisticsMonth(Integer statisticsYear, Integer statisticsMonth, Long statisticsStartId, Long statisticsEndId){ |
| | | List<VoIntakeLossStatistics> list = rmLossDayDao.statisticsByIntake(statisticsStartId, statisticsEndId) ; |
| | | if(list != null && list.size() > 0){ |
| | | for(VoIntakeLossStatistics vo : list){ |
| | | StLossMonth po = new StLossMonth() ; |
| | | po.intakeId = vo.intakeId ; |
| | | po.year = statisticsYear ; |
| | | po.month = statisticsMonth ; |
| | | po.amount = vo.amount; |
| | | stLossMonthDao.insert(po) ; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 年统计---漏损 |
| | | */ |
| | | @Transactional |
| | | protected void statisticsYear(Integer statisticsYear){ |
| | | List<VoIntakeLossStatistics> list = stLossMonthDao.statisticsByIntake(statisticsYear) ; |
| | | if(list != null && list.size() > 0){ |
| | | for(VoIntakeLossStatistics vo : list){ |
| | | StLossYear po = new StLossYear() ; |
| | | po.intakeId = vo.intakeId ; |
| | | po.year = statisticsYear ; |
| | | po.amount = vo.amount; |
| | | stLossYearDao.insert(po) ; |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrStatistics.statistics; |
| | | |
| | | import com.dy.common.multiDataSource.DataSourceContext; |
| | | import com.dy.common.schedulerTask.TaskJob; |
| | | import com.dy.common.schedulerTask.Test; |
| | | import com.dy.common.springUtil.SpringContextUtil; |
| | | import com.dy.common.util.DateTime; |
| | | import com.dy.common.util.IDLongGenerator; |
| | | import com.dy.pipIrrGlobal.util.Org; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | import org.quartz.JobExecutionContext; |
| | | import org.quartz.JobExecutionException; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/7/22 16:41 |
| | | * @Description |
| | | */ |
| | | public class StatisticsJob extends TaskJob { |
| | | |
| | | private static Logger log = LogManager.getLogger(Test.class.getName()) ; |
| | | |
| | | private StLoss stLoss ; |
| | | |
| | | private StIntake stIntake ; |
| | | |
| | | private StClient stClient ; |
| | | |
| | | private Integer statisticsYear; |
| | | private Integer statisticsMonth; |
| | | private Long statisticsStartId ; |
| | | private Long statisticsEndId ; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext ctx) throws JobExecutionException { |
| | | stLoss = SpringContextUtil.getBean(StLoss.class); |
| | | stIntake = SpringContextUtil.getBean(StIntake.class); |
| | | stClient = SpringContextUtil.getBean(StClient.class); |
| | | if(stLoss != null && stIntake != null && stClient != null){ |
| | | int[] ymd = DateTime.yyyy_MM_dd_2_ymdGroup(DateTime.yyyy_MM_dd()) ; |
| | | if(ymd[2] == 1){ |
| | | //统计上个月的 |
| | | String statisticsYyyy_mm = DateTime.lastMonth_ym() ; //统计年月 |
| | | statisticsYear = Integer.parseInt(statisticsYyyy_mm.substring(0, 4)) ;//统计年 |
| | | statisticsMonth = Integer.parseInt(statisticsYyyy_mm.substring(5, 7)) ;//统计月 |
| | | statisticsStartId = IDLongGenerator.generateOneDayStartId(statisticsYear, statisticsMonth, 1) ; |
| | | statisticsEndId = IDLongGenerator.generateOneDayEndId(statisticsYear, statisticsMonth, 31) ; |
| | | }else{ |
| | | //统计本月的 |
| | | statisticsYear = ymd[0] ;//统计月 |
| | | statisticsMonth = ymd[1] ;//统计月 |
| | | statisticsStartId = IDLongGenerator.generateOneDayStartId(ymd[0], ymd[1], 1) ; |
| | | statisticsEndId = IDLongGenerator.generateOneDayEndId(ymd[0], ymd[1], 31) ; |
| | | } |
| | | doStatistics() ; |
| | | }else{ |
| | | log.error("未能从Spring容器中得到统计bean"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 统计 |
| | | */ |
| | | private void doStatistics(){ |
| | | List<Org.OrgVo> orgList = Org.OrgList ; |
| | | if(orgList != null && orgList.size() >0){ |
| | | for(Org.OrgVo vo : orgList){ |
| | | DataSourceContext.set(vo.tag);//设置数据源 |
| | | stLoss.statistics(statisticsYear, statisticsMonth, statisticsStartId, statisticsEndId) ; |
| | | stIntake.statistics(statisticsYear, statisticsMonth, statisticsStartId, statisticsEndId) ; |
| | | stClient.statistics(statisticsYear, statisticsMonth, statisticsStartId, statisticsEndId) ; |
| | | } |
| | | } |
| | | } |
| | | } |
File was renamed from pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/listeners/StatisticsListener.java |
| | |
| | | package com.dy.pipIrrStatistics.listeners; |
| | | package com.dy.pipIrrStatistics.statistics; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | import com.dy.common.schedulerTask.SchedulerTaskSupport; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.context.event.ApplicationReadyEvent; |
| | | import org.springframework.context.ApplicationListener; |
New file |
| | |
| | | package com.dy.pipIrrStatistics.util; |
| | | |
| | | import com.dy.pipIrrGlobal.util.OrgListenerSupport; |
| | | import org.springframework.boot.context.event.ApplicationReadyEvent; |
| | | import org.springframework.context.ApplicationListener; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public class OrgListener extends OrgListenerSupport implements ApplicationListener<ApplicationReadyEvent> { |
| | | |
| | | @Override |
| | | public void onApplicationEvent(ApplicationReadyEvent event) { |
| | | try { |
| | | //等1秒,等待com.alibaba.druid.pool.DruidDataSource实始化完成 |
| | | Thread.sleep(1000L); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | super.init(); |
| | | } |
| | | } |
| | | } |