优化代码 指定时间段内开阀次数高于指定值的农户
指定时间段内开阀次数低于指定值的农户
2个文件已修改
27 ■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoClient.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoClient.java
@@ -45,4 +45,9 @@
     * 身份证号
     */
    private String idCard;
    /**
     * 开阀次数
     */
    private Integer openCount;
}
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml
@@ -654,11 +654,19 @@
               cli.clientNum,
               CONCAT(cli.districtTitle, cli.address) AS address,
               cli.phone,
               cli.idCard
               cli.idCard,
                (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}
                    </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(*)
               (SELECT COUNT(*)
               FROM rm_open_close_valve_history his
               WHERE his.client_id = cli.id
                 AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) > #{openCount}
@@ -693,7 +701,15 @@
               cli.clientNum,
               CONCAT(cli.districtTitle, cli.address) AS address,
               cli.phone,
               cli.idCard
               cli.idCard,
                (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}
                    </if>
                </where>) AS openCount
        FROM se_client cli
        <where>
            <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and openCount != null">