指定时间段内消费金额超过指定值的取水口;
指定时间段内用水时长超过指定值的取水口;
7个文件已修改
237 ■■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmOpenCloseValveHistoryMapper.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoIntakeAccumulateAmount.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoIntakeOpenCount.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmOpenCloseValveHistoryMapper.java
@@ -207,4 +207,32 @@
     * @return
     */
    List<VoIntakeAccumulateAmount> getUseWaterGtValueIntakes(Map<String, Object> params);
    /**
     * 指定时间段内消费金额超过指定值的取水口的数量
     * @param params
     * @return
     */
    Long getExpenseGtValueIntakesCount(Map<String, Object> params);
    /**
     * 指定时间段内消费金额超过指定值的取水口
     * @param params
     * @return
     */
    List<VoIntakeAccumulateAmount> getExpenseGtValueIntakes(Map<String, Object> params);
    /**
     * 指定时间段内用水时长超过指定值的取水口数量
     * @param params
     * @return
     */
    Long getUseWaterDurationGtValueIntakesCount(Map<String, Object> params);
    /**
     * 指定时间段内用水时长超过指定值的取水口
     * @param params
     * @return
     */
    List<VoIntakeOpenCount> getUseWaterDurationGtValueIntakes(Map<String, Object> params);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoIntakeAccumulateAmount.java
@@ -6,7 +6,9 @@
 * @author :WuZeYu
 * @Date :2024/8/5  10:45
 * @LastEditTime :2024/8/5  10:45
 * @Description 取水口累积流量 大于 指定值
 * @Description 取水口 累积流量 大于 指定值  视图
 *                    用水量 大于 指定值
 *                    消费金额 大于 指定值
 */
@Data
public class VoIntakeAccumulateAmount extends VoIntake{
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoIntakeOpenCount.java
@@ -1,14 +1,14 @@
package com.dy.pipIrrGlobal.voSt;
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import lombok.Data;
/**
 * @author :WuZeYu
 * @Date :2024/8/5  10:45
 * @LastEditTime :2024/8/5  10:45
 * @Description 取水口开阀 指定值 次数
 * @Description 取水口开阀 >  指定值 (次数)
 *                用水时长 > 指定值  (分钟)
 */
@Data
public class VoIntakeOpenCount extends VoIntake{
pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml
@@ -72,7 +72,7 @@
pipIrr:
    global:
        dev: true   #是否开发阶段,true或false
        dev: flase   #是否开发阶段,true或false
        dsName: ym  #开发阶段,设置临时的数据库名称
    mw:
        webPort: 8070
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml
@@ -917,4 +917,82 @@
            </if>
        </trim>
    </select>
    <!--指定时间段内消费金额超过指定值的取水口的数量-->
    <select id="getExpenseGtValueIntakesCount" resultType="java.lang.Long">
        select
        count(*)
        from
        (        SELECT
        inta.id AS intakeId,
        inta.NAME AS intakeNum,
        blo.NAME AS blockName ,
        IFNULL(SUM(rocvh.cl_this_money),0) AS value
        FROM
        pr_intake inta
        INNER JOIN ba_block blo ON blo.id = inta.blockId
        LEFT JOIN rm_open_close_valve_history rocvh ON rocvh.intake_id = inta.id
        WHERE rocvh.op_dt &gt;= #{timeStart} AND rocvh.cl_dt &lt;= #{timeStop} AND inta.deleted = 0
        GROUP BY inta.id
        HAVING IFNULL(SUM(rocvh.cl_this_money),0) &gt; #{value}) c
    </select>
    <!--指定时间段内消费金额超过指定值的取水口-->
    <select id="getExpenseGtValueIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAccumulateAmount">
        SELECT
        inta.id AS intakeId,
        inta.NAME AS intakeNum,
        blo.NAME AS blockName ,
        IFNULL(SUM(rocvh.cl_this_money),0) AS value
        FROM
        pr_intake inta
        INNER JOIN ba_block blo ON blo.id = inta.blockId
        LEFT JOIN rm_open_close_valve_history rocvh ON rocvh.intake_id = inta.id
        WHERE rocvh.op_dt &gt;= #{timeStart} AND rocvh.cl_dt &lt;= #{timeStop} AND inta.deleted = 0
        GROUP BY inta.id
        HAVING IFNULL(SUM(rocvh.cl_this_money),0) &gt; #{value}
        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="getUseWaterDurationGtValueIntakesCount" resultType="java.lang.Long">
        select
        count(*)
        from
        (        SELECT
        inta.id AS intakeId,
        inta.NAME AS intakeNum,
        blo.NAME AS blockName ,
        IFNULL(SUM(rocvh.cl_this_time),0) AS recordCount
        FROM
        pr_intake inta
        INNER JOIN ba_block blo ON blo.id = inta.blockId
        LEFT JOIN rm_open_close_valve_history rocvh ON rocvh.intake_id = inta.id
        WHERE rocvh.op_dt &gt;= #{timeStart} AND rocvh.cl_dt &lt;= #{timeStop} AND inta.deleted = 0
        GROUP BY inta.id
        HAVING IFNULL(SUM(rocvh.cl_this_time),0) &gt; #{value}) c
    </select>
    <!--指定时间段内用水时长超过指定值的取水口-->
    <select id="getUseWaterDurationGtValueIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeOpenCount">
        SELECT
        inta.id AS intakeId,
        inta.NAME AS intakeNum,
        blo.NAME AS blockName ,
        IFNULL(SUM(rocvh.cl_this_time),0) AS recordCount
        FROM
        pr_intake inta
        INNER JOIN ba_block blo ON blo.id = inta.blockId
        LEFT JOIN rm_open_close_valve_history rocvh ON rocvh.intake_id = inta.id
        WHERE rocvh.op_dt &gt;= #{timeStart} AND rocvh.cl_dt &lt;= #{timeStop} AND inta.deleted = 0
        GROUP BY inta.id
        HAVING IFNULL(SUM(rocvh.cl_this_time),0) &gt; #{value}
        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
@@ -501,4 +501,80 @@
        rsVo.obj = rmOpenCloseValveHistoryMapper.getUseWaterGtValueIntakes(params);
        return rsVo ;
    }
    /**
     * 指定时间段内消费金额超过指定值的取水口
     * @param qo
     * @return
     */
    public QueryResultVo<List<VoIntakeAccumulateAmount>> getExpenseGtValueIntakes(IntakeAmountValueQO 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);
        if (qo.getValue() == null){
            qo.setValue(0.0);
        }
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo);
        Long itemTotal = rmOpenCloseValveHistoryMapper.getExpenseGtValueIntakesCount(params);
        QueryResultVo<List<VoIntakeAccumulateAmount>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = qo.pageSize ;
        rsVo.pageCurr = qo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = rmOpenCloseValveHistoryMapper.getExpenseGtValueIntakes(params);
        return rsVo ;
    }
    /**
     * 指定时间段内用水时长超过指定值的取水口
     * @param qo
     * @return
     */
    public QueryResultVo<List<VoIntakeOpenCount>> getUseWaterDurationGtValueIntakes(IntakeCountValueQO 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.getUseWaterDurationGtValueIntakesCount(params);
        QueryResultVo<List<VoIntakeOpenCount>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = qo.pageSize ;
        rsVo.pageCurr = qo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = rmOpenCloseValveHistoryMapper.getUseWaterDurationGtValueIntakes(params);
        return rsVo ;
    }
}
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java
@@ -279,4 +279,47 @@
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 指定时间段内消费金额超过指定值的取水口
     * @param
     * @return
     */
    @GetMapping(path = "/getExpenseGtValueIntakes")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoIntakeAccumulateAmount>>> getExpenseGtValueIntakes(IntakeAmountValueQO qo) {
        try {
            QueryResultVo<List<VoIntakeAccumulateAmount>> res = intakeSv.getExpenseGtValueIntakes(qo);
            if(res.itemTotal == 0) {
                return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.NO_RECORDS.getMessage());
            }
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 指定时间段内用水时长超过指定值的取水口
     * @param
     * @return
     */
    @GetMapping(path = "/getUseWaterDurationGtValueIntakes")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoIntakeOpenCount>>> getUseWaterDurationGtValueIntakes(IntakeCountValueQO qo) {
        try {
            QueryResultVo<List<VoIntakeOpenCount>> res = intakeSv.getUseWaterDurationGtValueIntakes(qo);
            if(res.itemTotal == 0) {
                return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.NO_RECORDS.getMessage());
            }
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
}