| | |
| | | <select id="getLargeOpenCountClientsCount" 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}) > #{openCount} |
| | | <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} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--获取指定时间段内开阀次数超过指定值的农户--> |
| | |
| | | cli.phone, |
| | | cli.idCard |
| | | FROM se_client cli |
| | | WHERE (SELECT COUNT(*) |
| | | <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} |
| | | </if> |
| | | </where> |
| | | ORDER BY cli.id |
| | | <trim prefix="limit "> |
| | | <if test="start != null and count != null"> |
| | |
| | | <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}) < #{openCount} |
| | | <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} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--获取指定时间段内开阀次数低于指定值的农户--> |
| | |
| | | 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}) < #{openCount} |
| | | <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} |
| | | </if> |
| | | </where> |
| | | ORDER BY cli.id |
| | | <trim prefix="limit "> |
| | | <if test="start != null and count != null"> |