Administrator
2024-08-06 c081e4f2d10ded85f3b76745f4e642531159c77d
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml
@@ -755,4 +755,35 @@
            </if>
        </trim>
    </select>
    <!--获取指定时间段内开阀次数低于指定值的农户数量-->
    <select id="getSmallOpenCountClientsCount" resultType="java.lang.Long">
        SELECT COUNT(*) AS recordCount
        FROM se_client cli
        WHERE (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>
    <!--获取指定时间段内开阀次数低于指定值的农户-->
    <select id="getSmallOpenCountClients" resultType="com.dy.pipIrrGlobal.voSt.VoClient">
        SELECT cli.id                                 AS clientId,
               cli.name                               AS clientName,
               cli.clientNum,
               CONCAT(cli.districtTitle, cli.address) AS address,
               cli.phone,
               cli.idCard
        FROM se_client cli
        WHERE (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}
        ORDER BY cli.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>