| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmClientAmountDayLast; |
| | | import com.dy.pipIrrGlobal.voRm.VoClientAmountDay; |
| | | import com.dy.pipIrrGlobal.voSt.VoClient; |
| | | import com.dy.pipIrrGlobal.voSt.VoDayClient; |
| | | import com.dy.pipIrrGlobal.voSt.VoMonthClient; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | * @return |
| | | */ |
| | | List<VoMonthClient> getMonthAmountAndMoney(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 最近未充值的农户数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getNotRechargeLastClientsCount(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 最近未充值的农户 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoClient> getNotRechargeLastClients(Map<String, Object> params); |
| | | } |
| | |
| | | </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> |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 最近未充值的农户 |
| | | * |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getNotRechargeLastClients") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoClient>>> getNotRechargeLastClients(CommonQO qo) { |
| | | try { |
| | | QueryResultVo<List<VoClient>> res = clientSv.getNotRechargeLastClients(qo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | }catch (Exception e){ |
| | | log.error("获取记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | rsVo.obj = rmClientAmountDayLastMapper.getMonthAmountAndMoney(params); |
| | | return rsVo ; |
| | | } |
| | | |
| | | /** |
| | | * 最近未充值的农户 |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoClient>> getNotRechargeLastClients(CommonQO qo) { |
| | | String timeStart = qo.getTimeStart(); |
| | | if (timeStart != null && timeStart != ""){ |
| | | timeStart = timeStart + " 00:00:00"; |
| | | qo.setTimeStart(timeStart); |
| | | } |
| | | // 生成查询参数 |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; |
| | | |
| | | // 获取符合条件的记录数 |
| | | Long itemTotal = Optional.ofNullable(rmClientAmountDayLastMapper.getNotRechargeLastClientsCount(params)).orElse(0L); |
| | | |
| | | QueryResultVo<List<VoClient>> rsVo = new QueryResultVo<>() ; |
| | | |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = rmClientAmountDayLastMapper.getNotRechargeLastClients(params); |
| | | return rsVo ; |
| | | } |
| | | } |