liurunyu
2025-07-29 86eba8eaec4494bf29657333ea7b0385cb818578
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml
@@ -692,12 +692,13 @@
        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}) > #{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}
            </if>
            ) > #{openCount}
        </where>
    </select>
@@ -714,17 +715,18 @@
                <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 his.op_dt BETWEEN #{timeStart} AND #{timeStop}
            </if>
            ) > #{openCount}
        </where>
        ORDER BY cli.id
        <trim prefix="limit ">
@@ -739,11 +741,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}
            </if>
            <if test="openCount != null">
                ) &lt; #{openCount}
            </if>
        </where>
    </select>
@@ -766,11 +771,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}
            </if>
            <if test="openCount != null">
                &lt; #{openCount}
            </if>
        </where>
        ORDER BY cli.id