| | |
| | | <select id="getLargeWaterConsumptionClientsCount" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS recordCount |
| | | FROM se_client cli |
| | | WHERE (SELECT SUM(his.cl_this_amount) |
| | | FROM rm_open_close_valve_history his |
| | | WHERE his.client_id = cli.id |
| | | AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) > #{waterConsumption} |
| | | <where> |
| | | <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and waterConsumption != null"> |
| | | (SELECT SUM(his.cl_this_amount) |
| | | FROM rm_open_close_valve_history his |
| | | WHERE his.client_id = cli.id |
| | | AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) > #{waterConsumption} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--获取指定时间段内用水量超过指定值的农户--> |
| | |
| | | cli.phone, |
| | | cli.idCard |
| | | FROM se_client cli |
| | | WHERE (SELECT SUM(his.cl_this_amount) |
| | | FROM rm_open_close_valve_history his |
| | | WHERE his.client_id = cli.id |
| | | AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) > #{waterConsumption} |
| | | <where> |
| | | <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and waterConsumption != null"> |
| | | (SELECT SUM(his.cl_this_amount) |
| | | FROM rm_open_close_valve_history his |
| | | WHERE his.client_id = cli.id |
| | | AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) > #{waterConsumption} |
| | | </if> |
| | | </where> |
| | | ORDER BY cli.id |
| | | <trim prefix="limit "> |
| | | <if test="start != null and count != null"> |
| | |
| | | <select id="getLargeAmountSpentClientsCount" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS recordCount |
| | | FROM se_client cli |
| | | WHERE (SELECT SUM(his.cl_this_money) |
| | | <where> |
| | | <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and amountSpent != null"> |
| | | (SELECT SUM(his.cl_this_money) |
| | | FROM rm_open_close_valve_history his |
| | | WHERE his.client_id = cli.id |
| | | AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) > #{amountSpent} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <!--获取指定时间段内消费金额超过指定值的农户--> |
| | | <select id="getLargeAmountSpentClients" resultType="com.dy.pipIrrGlobal.voSt.VoClient"> |
| | |
| | | cli.phone, |
| | | cli.idCard |
| | | FROM se_client cli |
| | | WHERE (SELECT SUM(his.cl_this_money) |
| | | FROM rm_open_close_valve_history his |
| | | WHERE his.client_id = cli.id |
| | | AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) > #{amountSpent} |
| | | <where> |
| | | <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and amountSpent != null"> |
| | | (SELECT SUM(his.cl_this_money) |
| | | FROM rm_open_close_valve_history his |
| | | WHERE his.client_id = cli.id |
| | | AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) > #{amountSpent} |
| | | </if> |
| | | </where> |
| | | ORDER BY cli.id |
| | | <trim prefix="limit "> |
| | | <if test="start != null and count != null"> |
| | |
| | | <select id="getLargeWaterDurationClientsCount" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS recordCount |
| | | FROM se_client cli |
| | | WHERE (SELECT SUM(his.cl_this_time) |
| | | <where> |
| | | <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and waterDuration != null"> |
| | | (SELECT SUM(his.cl_this_time) |
| | | FROM rm_open_close_valve_history his |
| | | WHERE his.client_id = cli.id |
| | | AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) > #{waterDuration} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--获取指定时间段内用水时长超过指定值的农户--> |
| | |
| | | cli.phone, |
| | | cli.idCard |
| | | FROM se_client cli |
| | | WHERE (SELECT SUM(his.cl_this_time) |
| | | FROM rm_open_close_valve_history his |
| | | WHERE his.client_id = cli.id |
| | | AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) > #{waterDuration} |
| | | <where> |
| | | <if test="timeStart != null and timeStart != '' and timeStop != null and timeStop != '' and waterDuration != null"> |
| | | (SELECT SUM(his.cl_this_time) |
| | | FROM rm_open_close_valve_history his |
| | | WHERE his.client_id = cli.id |
| | | AND his.op_dt BETWEEN #{timeStart} AND #{timeStop}) > #{waterDuration} |
| | | </if> |
| | | </where> |
| | | ORDER BY cli.id |
| | | <trim prefix="limit "> |
| | | <if test="start != null and count != null"> |