liurunyu
2025-07-29 60fe15f3a5e572b5393374c741cf645966e54cde
修改农户开关阀次数统计中的bug
2个文件已修改
58 ■■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientCtrl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml
@@ -692,11 +692,14 @@
        SELECT COUNT(*) AS recordCount
        FROM se_client cli
        <where>
            <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and openCount != null">
                (SELECT COUNT(*)
                FROM rm_open_close_valve_history his
                WHERE his.client_id = cli.id
            (SELECT COUNT(*)
            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}) > #{openCount}
            </if>
            <if test="openCount != null">
                > #{openCount}
            </if>
        </where>
    </select>
@@ -714,16 +717,19 @@
                <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}
                        AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}
                    </if>
                </where>) AS openCount
        FROM se_client cli
        <where>
            <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and openCount != null">
               (SELECT COUNT(*)
               FROM rm_open_close_valve_history his
               WHERE his.client_id = cli.id
                 AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) > #{openCount}
            (SELECT COUNT(*)
            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}) > #{openCount}
            </if>
            <if test="openCount != null">
                > #{openCount}
            </if>
        </where>
        ORDER BY cli.id
@@ -739,11 +745,14 @@
        SELECT COUNT(*) AS recordCount
        FROM se_client cli
        <where>
            <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and openCount != null">
                (SELECT COUNT(*)
                FROM rm_open_close_valve_history his
                WHERE his.client_id = cli.id
                AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) &lt; #{openCount}
            (SELECT COUNT(*)
            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}) > #{openCount}
            </if>
            <if test="openCount != null">
                &lt; #{openCount}
            </if>
        </where>
    </select>
@@ -766,11 +775,14 @@
                </where>) AS openCount
        FROM se_client cli
        <where>
            <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and openCount != null">
                (SELECT COUNT(*)
                FROM rm_open_close_valve_history his
                WHERE his.client_id = cli.id
                AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) &lt; #{openCount}
            (SELECT COUNT(*)
            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}) > #{openCount}
            </if>
            <if test="openCount != null">
                &lt; #{openCount}
            </if>
        </where>
        ORDER BY cli.id
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientCtrl.java
@@ -49,6 +49,9 @@
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        try {
            if(qo.getOpenCount() == null){
                qo.setOpenCount(0);
            }
            return BaseResponseUtils.buildSuccess(clientSv.getLargeOpenCountClients(qo));
        } catch (Exception e) {
            log.error("获取开卡记录异常", e);
@@ -69,6 +72,9 @@
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        try {
            if(qo.getOpenCount() == null){
                qo.setOpenCount(0);
            }
            return BaseResponseUtils.buildSuccess(clientSv.getSmallOpenCountClients(qo));
        } catch (Exception e) {
            log.error("获取开卡记录异常", e);