优化代码 指定时间段内用水量超过指定值的农户
指定时间段内消费金额超过指定值的农户
指定时间段内用水时长超过指定值的农户
2个文件已修改
50 ■■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoClient.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoClient.java
@@ -50,4 +50,21 @@
     * 开阀次数
     */
    private Integer openCount;
    /**
     * 用水量
     */
    private Double waterConsumption;
    /**
     * 消费金额
     */
    private Double amountSpent;
    /**
     * 用水时长
     */
    private Double waterDuration;
}
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml
@@ -748,7 +748,16 @@
               cli.clientNum,
               CONCAT(cli.districtTitle, cli.address) AS address,
               cli.phone,
               cli.idCard
               cli.idCard,
                IFNULL((SELECT SUM(his.cl_this_amount)
                FROM rm_open_close_valve_history his
                <where>
                    his.client_id = cli.id
                    <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''">
                        AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}
                    </if>
                </where>
                ),0) AS waterConsumption
        FROM se_client cli
        <where>
            <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and waterConsumption != null">
@@ -786,7 +795,16 @@
               cli.clientNum,
               CONCAT(cli.districtTitle, cli.address) AS address,
               cli.phone,
               cli.idCard
               cli.idCard,
                IFNULL((SELECT SUM(his.cl_this_money)
                FROM rm_open_close_valve_history his
                <where>
                    his.client_id = cli.id
                    <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''">
                        AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}
                    </if>
                </where>
                ),0) AS amountSpent
        FROM se_client cli
        <where>
            <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and amountSpent != null">
@@ -825,7 +843,16 @@
               cli.clientNum,
               CONCAT(cli.districtTitle, cli.address) AS address,
               cli.phone,
               cli.idCard
               cli.idCard,
                IFNULL((SELECT SUM(his.cl_this_time)
                FROM rm_open_close_valve_history his
                <where>
                    his.client_id = cli.id
                    <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != ''">
                        AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}
                    </if>
                </where>
                ),0) AS waterDuration
        FROM se_client cli
        <where>
            <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and waterDuration != null">