| | |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | <!--最近未充值的农户数量--> |
| | | <select id="getNotRechargeLastClientsCount" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) |
| | | FROM |
| | | ( SELECT |
| | | sc.id AS clientId, |
| | | sc.`name` AS clientName, |
| | | sc.clientNum AS clientNum, |
| | | sc.address AS address, |
| | | sc.phone AS phone, |
| | | sc.idCard AS idCard |
| | | FROM |
| | | se_client sc |
| | | LEFT JOIN (SELECT srh.clientId FROM `se_recharge_history` srh |
| | | <where> |
| | | srh.amount > 0 AND srh.operate_valid = 2 |
| | | <if test="timeStart != null and timeStart != ''"> |
| | | AND srh.operateDt > #{timeStart} |
| | | </if> |
| | | </where> |
| | | ) c on c.clientId = sc.id |
| | | WHERE c.clientId IS NULL |
| | | GROUP BY sc.id) d |
| | | </select> |
| | | <!--最近未充值的农户--> |
| | | <select id="getNotRechargeLastClients" resultType="com.dy.pipIrrGlobal.voSt.VoClient"> |
| | | SELECT |
| | | sc.id AS clientId, |
| | | sc.`name` AS clientName, |
| | | sc.clientNum AS clientNum, |
| | | sc.address AS address, |
| | | sc.phone AS phone, |
| | | sc.idCard AS idCard |
| | | FROM |
| | | se_client sc |
| | | LEFT JOIN (SELECT srh.clientId FROM `se_recharge_history` srh |
| | | <where> |
| | | srh.amount > 0 AND srh.operate_valid = 2 |
| | | <if test="timeStart != null and timeStart != ''"> |
| | | AND srh.operateDt > #{timeStart} |
| | | </if> |
| | | </where> |
| | | ) c on c.clientId = sc.id |
| | | WHERE c.clientId IS NULL |
| | | GROUP BY sc.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> |