pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmOpenCloseValveHistoryMapper.java
@@ -235,4 +235,32 @@ * @return */ List<VoIntakeOpenCount> getUseWaterDurationGtValueIntakes(Map<String, Object> params); /** * 指定时间段 有开阀 无关阀的取水口数量 * @param params * @return */ Long getHaveOpenNoCloseIntakesCount(Map<String, Object> params); /** * 指定时间段 有开阀 无关阀的取水口 * @param params * @return */ List<VoIntake> getHaveOpenNoCloseIntakes(Map<String, Object> params); /** * 指定时间段 无开阀 有关阀的取水口数量 * @param params * @return */ Long getNoOpenHaveCloseIntakesCount(Map<String, Object> params); /** * 指定时间段 无开阀 有关阀的取水口 * @param params * @return */ List<VoIntake> getNoOpenHaveCloseIntakes(Map<String, Object> params); } pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml
@@ -995,4 +995,72 @@ </if> </trim> </select> <!--指定时间段 有开阀 无关阀的取水口数量--> <select id="getHaveOpenNoCloseIntakesCount" resultType="java.lang.Long"> select count(*) from ( SELECT inta.id AS intakeId, inta.NAME AS intakeNum, blo.NAME AS blockName FROM pr_intake inta INNER JOIN ba_block blo ON blo.id = inta.blockId inner JOIN rm_open_close_valve_history rocvh ON rocvh.intake_id = inta.id WHERE rocvh.op_dt BETWEEN #{timeStart} AND #{timeStop} AND rocvh.cl_dt IS NULL AND inta.deleted = 0 GROUP BY inta.id) c </select> <!--指定时间段 有开阀 无关阀的取水口--> <select id="getHaveOpenNoCloseIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntake"> SELECT inta.id AS intakeId, inta.NAME AS intakeNum, blo.NAME AS blockName FROM pr_intake inta INNER JOIN ba_block blo ON blo.id = inta.blockId inner JOIN rm_open_close_valve_history rocvh ON rocvh.intake_id = inta.id WHERE rocvh.op_dt BETWEEN #{timeStart} AND #{timeStop} AND rocvh.cl_dt IS NULL AND inta.deleted = 0 GROUP BY inta.id ORDER BY inta.id <trim prefix="limit "> <if test="start != null and count != null"> #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} </if> </trim> </select> <!--指定时间段 无开阀 有关阀的取水口数量--> <select id="getNoOpenHaveCloseIntakesCount" resultType="java.lang.Long"> select count(*) from ( SELECT inta.id AS intakeId, inta.NAME AS intakeNum, blo.NAME AS blockName FROM pr_intake inta INNER JOIN ba_block blo ON blo.id = inta.blockId inner JOIN rm_open_close_valve_history rocvh ON rocvh.intake_id = inta.id WHERE rocvh.cl_dt BETWEEN #{timeStart} AND #{timeStop} AND rocvh.op_dt IS NULL AND inta.deleted = 0 GROUP BY inta.id) c </select> <!--指定时间段 无开阀 有关阀的取水口--> <select id="getNoOpenHaveCloseIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntake"> SELECT inta.id AS intakeId, inta.NAME AS intakeNum, blo.NAME AS blockName FROM pr_intake inta INNER JOIN ba_block blo ON blo.id = inta.blockId inner JOIN rm_open_close_valve_history rocvh ON rocvh.intake_id = inta.id WHERE rocvh.cl_dt BETWEEN #{timeStart} AND #{timeStop} AND rocvh.op_dt IS NULL AND inta.deleted = 0 GROUP BY inta.id ORDER BY inta.id <trim prefix="limit "> <if test="start != null and count != null"> #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} </if> </trim> </select> </mapper> pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java
@@ -198,13 +198,14 @@ String timeStart = qo.getTimeStart(); String timeStop = qo.getTimeStop(); if(timeStart != null) { if(timeStart != null && timeStart != "") { timeStart = timeStart + " 00:00:00"; }else { timeStart = LocalDate.now() + " 00:00:00"; } else { timeStart = LocalDateTime.of(2024, 1, 1, 0, 0, 0).toString(); } qo.setTimeStart(timeStart); if(timeStop != null) { if(timeStop != null && timeStop != "") { timeStop = timeStop + " 23:59:59"; }else { timeStop = LocalDate.now() + " 23:59:59"; @@ -236,13 +237,14 @@ String timeStart = qo.getTimeStart(); String timeStop = qo.getTimeStop(); if(timeStart != null) { if(timeStart != null && timeStart != "") { timeStart = timeStart + " 00:00:00"; }else { timeStart = LocalDate.now() + " 00:00:00"; } else { timeStart = LocalDateTime.of(2024, 1, 1, 0, 0, 0).toString(); } qo.setTimeStart(timeStart); if(timeStop != null) { if(timeStop != null && timeStop != "") { timeStop = timeStop + " 23:59:59"; }else { timeStop = LocalDate.now() + " 23:59:59"; @@ -274,13 +276,14 @@ String timeStart = qo.getTimeStart(); String timeStop = qo.getTimeStop(); if(timeStart != null) { if(timeStart != null && timeStart != "") { timeStart = timeStart + " 00:00:00"; }else { timeStart = LocalDate.now() + " 00:00:00"; } else { timeStart = LocalDateTime.of(2024, 1, 1, 0, 0, 0).toString(); } qo.setTimeStart(timeStart); if(timeStop != null) { if(timeStop != null && timeStop != "") { timeStop = timeStop + " 23:59:59"; }else { timeStop = LocalDate.now() + " 23:59:59"; @@ -577,4 +580,74 @@ rsVo.obj = rmOpenCloseValveHistoryMapper.getUseWaterDurationGtValueIntakes(params); return rsVo ; } /** * 指定时间段 有开阀 无关阀的取水口 * @param qo * @return */ public QueryResultVo<List<VoIntake>> getHaveOpenNoCloseIntakes(CommonQO qo) { String timeStart = qo.getTimeStart(); String timeStop = qo.getTimeStop(); if(timeStart != null && timeStart != "") { timeStart = timeStart + " 00:00:00"; } else { timeStart = LocalDateTime.of(2024, 1, 1, 0, 0, 0).toString(); } qo.setTimeStart(timeStart); if(timeStop != null && timeStop != "") { timeStop = timeStop + " 23:59:59"; }else { timeStop = LocalDate.now() + " 23:59:59"; } qo.setTimeStop(timeStop); Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); Long itemTotal = rmOpenCloseValveHistoryMapper.getHaveOpenNoCloseIntakesCount(params); QueryResultVo<List<VoIntake>> rsVo = new QueryResultVo<>() ; rsVo.pageSize = qo.pageSize ; rsVo.pageCurr = qo.pageCurr ; rsVo.calculateAndSet(itemTotal, params); rsVo.obj = rmOpenCloseValveHistoryMapper.getHaveOpenNoCloseIntakes(params); return rsVo ; } /** * 指定时间段 无开阀 有关阀的取水口 * @param qo * @return */ public QueryResultVo<List<VoIntake>> getNoOpenHaveCloseIntakes(CommonQO qo) { String timeStart = qo.getTimeStart(); String timeStop = qo.getTimeStop(); if(timeStart != null && timeStart != "") { timeStart = timeStart + " 00:00:00"; } else { timeStart = LocalDateTime.of(2024, 1, 1, 0, 0, 0).toString(); } qo.setTimeStart(timeStart); if(timeStop != null && timeStop != "") { timeStop = timeStop + " 23:59:59"; }else { timeStop = LocalDate.now() + " 23:59:59"; } qo.setTimeStop(timeStop); Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); Long itemTotal = rmOpenCloseValveHistoryMapper.getNoOpenHaveCloseIntakesCount(params); QueryResultVo<List<VoIntake>> rsVo = new QueryResultVo<>() ; rsVo.pageSize = qo.pageSize ; rsVo.pageCurr = qo.pageCurr ; rsVo.calculateAndSet(itemTotal, params); rsVo.obj = rmOpenCloseValveHistoryMapper.getNoOpenHaveCloseIntakes(params); return rsVo ; } } pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java
@@ -183,10 +183,7 @@ */ @GetMapping(path = "/getNeverOpenValveIntakes") @SsoAop() public BaseResponse<QueryResultVo<List<VoIntake>>> getNeverOpenValveIntakes(@Valid CommonQO qo, BindingResult bindingResult) { if(bindingResult != null && bindingResult.hasErrors()){ return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } public BaseResponse<QueryResultVo<List<VoIntake>>> getNeverOpenValveIntakes(CommonQO qo) { try { QueryResultVo<List<VoIntake>> res = intakeSv.getNeverOpenValveIntakes(qo); return BaseResponseUtils.buildSuccess(res); @@ -204,10 +201,7 @@ */ @GetMapping(path = "/getOpenValveGtIntakes") @SsoAop() public BaseResponse<QueryResultVo<List<VoIntakeOpenCount>>> getOpenValveGtIntakes(@Valid IntakeCountValueQO qo, BindingResult bindingResult) { if(bindingResult != null && bindingResult.hasErrors()){ return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } public BaseResponse<QueryResultVo<List<VoIntakeOpenCount>>> getOpenValveGtIntakes(IntakeCountValueQO qo) { try { QueryResultVo<List<VoIntakeOpenCount>> res = intakeSv.getOpenValveGtIntakes(qo); return BaseResponseUtils.buildSuccess(res); @@ -225,10 +219,7 @@ */ @GetMapping(path = "/getOpenValveLtIntakes") @SsoAop() public BaseResponse<QueryResultVo<List<VoIntakeOpenCount>>> getOpenValveLtIntakes(@Valid IntakeCountValueQO qo, BindingResult bindingResult) { if(bindingResult != null && bindingResult.hasErrors()){ return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } public BaseResponse<QueryResultVo<List<VoIntakeOpenCount>>> getOpenValveLtIntakes(IntakeCountValueQO qo) { try { QueryResultVo<List<VoIntakeOpenCount>> res = intakeSv.getOpenValveLtIntakes(qo); return BaseResponseUtils.buildSuccess(res); @@ -246,10 +237,7 @@ */ @GetMapping(path = "/getTotalFlowGtValueIntakes") @SsoAop() public BaseResponse<QueryResultVo<List<VoIntakeAccumulateAmount>>> getTotalFlowGtValueIntakes(@Valid IntakeAmountValueQO qo, BindingResult bindingResult) { if(bindingResult != null && bindingResult.hasErrors()){ return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } public BaseResponse<QueryResultVo<List<VoIntakeAccumulateAmount>>> getTotalFlowGtValueIntakes(IntakeAmountValueQO qo) { try { QueryResultVo<List<VoIntakeAccumulateAmount>> res = intakeSv.getTotalFlowGtValueIntakes(qo); return BaseResponseUtils.buildSuccess(res); @@ -267,10 +255,7 @@ */ @GetMapping(path = "/getUseWaterGtValueIntakes") @SsoAop() public BaseResponse<QueryResultVo<List<VoIntakeAccumulateAmount>>> getUseWaterGtValueIntakes(@Valid IntakeAmountValueQO qo, BindingResult bindingResult) { if(bindingResult != null && bindingResult.hasErrors()){ return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } public BaseResponse<QueryResultVo<List<VoIntakeAccumulateAmount>>> getUseWaterGtValueIntakes(IntakeAmountValueQO qo) { try { QueryResultVo<List<VoIntakeAccumulateAmount>> res = intakeSv.getUseWaterGtValueIntakes(qo); return BaseResponseUtils.buildSuccess(res); @@ -288,10 +273,7 @@ */ @GetMapping(path = "/getExpenseGtValueIntakes") @SsoAop() public BaseResponse<QueryResultVo<List<VoIntakeAccumulateAmount>>> getExpenseGtValueIntakes(@Valid IntakeAmountValueQO qo, BindingResult bindingResult) { if(bindingResult != null && bindingResult.hasErrors()){ return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } public BaseResponse<QueryResultVo<List<VoIntakeAccumulateAmount>>> getExpenseGtValueIntakes(IntakeAmountValueQO qo) { try { QueryResultVo<List<VoIntakeAccumulateAmount>> res = intakeSv.getExpenseGtValueIntakes(qo); return BaseResponseUtils.buildSuccess(res); @@ -310,10 +292,7 @@ */ @GetMapping(path = "/getUseWaterDurationGtValueIntakes") @SsoAop() public BaseResponse<QueryResultVo<List<VoIntakeOpenCount>>> getUseWaterDurationGtValueIntakes(@Valid IntakeCountValueQO qo, BindingResult bindingResult) { if(bindingResult != null && bindingResult.hasErrors()){ return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } public BaseResponse<QueryResultVo<List<VoIntakeOpenCount>>> getUseWaterDurationGtValueIntakes(IntakeCountValueQO qo) { try { QueryResultVo<List<VoIntakeOpenCount>> res = intakeSv.getUseWaterDurationGtValueIntakes(qo); return BaseResponseUtils.buildSuccess(res); @@ -322,4 +301,39 @@ return BaseResponseUtils.buildException(e.getMessage()) ; } } /** * 指定时间段 有开阀 无关阀的取水口 * @param * @return */ @GetMapping(path = "/getHaveOpenNoCloseIntakes") @SsoAop() public BaseResponse<QueryResultVo<List<VoIntake>>> getHaveOpenNoCloseIntakes(CommonQO qo) { try { QueryResultVo<List<VoIntake>> res = intakeSv.getHaveOpenNoCloseIntakes(qo); return BaseResponseUtils.buildSuccess(res); } catch (Exception e) { log.error("获取记录异常", e); return BaseResponseUtils.buildException(e.getMessage()) ; } } /** * 指定时间段 无开阀 有关阀的取水口 * @param * @return */ @GetMapping(path = "/getNoOpenHaveCloseIntakes") @SsoAop() public BaseResponse<QueryResultVo<List<VoIntake>>> getNoOpenHaveCloseIntakes(CommonQO qo) { try { QueryResultVo<List<VoIntake>> res = intakeSv.getNoOpenHaveCloseIntakes(qo); return BaseResponseUtils.buildSuccess(res); } catch (Exception e) { log.error("获取记录异常", e); return BaseResponseUtils.buildException(e.getMessage()) ; } } }