pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeCardOperateMapper.java
@@ -5,6 +5,7 @@ import com.dy.pipIrrGlobal.voSe.*; import com.dy.pipIrrGlobal.voSt.VoClient; import com.dy.pipIrrGlobal.voSt.VoClientOpenCardCount; import com.dy.pipIrrGlobal.voSt.VoClientRechargeTotal; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -170,4 +171,18 @@ * @return */ List<VoClientOpenCardCount> getOpenIcCardClients(Map<String, Object> params); /** * 指定时间段内每个农户充值合计 农户数量 * @param params * @return */ Long getRechargeTotalClientsCount(Map<String, Object> params); /** * 指定时间段内每个农户充值合计 * @param params * @return */ List<VoClientRechargeTotal> getRechargeTotalClients(Map<String, Object> params); } pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoClientRechargeTotal.java
New file @@ -0,0 +1,18 @@ package com.dy.pipIrrGlobal.voSt; import lombok.Data; /** * @author :WuZeYu * @Date :2024/8/9 10:58 * @LastEditTime :2024/8/9 10:58 * @Description */ @Data public class VoClientRechargeTotal extends VoClient{ /** *充值总量 */ private Double rechargeTotal; } pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeCardOperateMapper.xml
@@ -764,4 +764,48 @@ </if> </trim> </select> <!--指定时间段内每个农户充值合计 农户数量--> <select id="getRechargeTotalClientsCount" resultType="java.lang.Long"> select count(*) from ( SELECT sco.client_id AS clientId, sc.`name` AS clientName, sc.clientNum AS clientNum, sc.address AS address, sc.phone AS phone, sc.idCard AS idCard, IFNULL(SUM(sco.trade_amount),0) AS rechargeTotal FROM `se_card_operate` sco INNER JOIN se_client sc ON sc.id = sco.client_id WHERE sco.operate_dt BETWEEN #{timeStart} AND #{timeStop} AND sco.operate_type = 2 AND sc.deleted = 0 AND sc.disabled = 0 GROUP BY sc.id) c </select> <!--指定时间段内每个农户充值合计--> <select id="getRechargeTotalClients" resultType="com.dy.pipIrrGlobal.voSt.VoClientRechargeTotal"> SELECT sco.client_id AS clientId, sc.`name` AS clientName, sc.clientNum AS clientNum, sc.address AS address, sc.phone AS phone, sc.idCard AS idCard, IFNULL(SUM(sco.trade_amount),0) AS rechargeTotal FROM `se_card_operate` sco INNER JOIN se_client sc ON sc.id = sco.client_id WHERE sco.operate_dt BETWEEN #{timeStart} AND #{timeStop} AND sco.operate_type = 2 AND sc.deleted = 0 AND sc.disabled = 0 GROUP BY sc.id ORDER BY sc.id DESC <trim prefix="limit " > <if test="start != null and count != null"> #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} </if> </trim> </select> </mapper> pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientCtrl.java
@@ -6,6 +6,7 @@ import com.dy.common.webUtil.QueryResultVo; import com.dy.pipIrrGlobal.voSt.VoClient; import com.dy.pipIrrGlobal.voSt.VoClientOpenCardCount; import com.dy.pipIrrGlobal.voSt.VoClientRechargeTotal; import com.dy.pipIrrGlobal.voSt.VoICCard; import com.dy.pipIrrStatistics.card.IcCardqo.CommonQO; import com.dy.pipIrrStatistics.client.qo.AmountSpentQO; @@ -154,4 +155,25 @@ return BaseResponseUtils.buildException(e.getMessage()); } } /** * 指定时间段内每个农户充值合计(物理卡) * * @param qo * @return */ @GetMapping(path = "/getRechargeTotalClients") @SsoAop() public BaseResponse<QueryResultVo<List<VoClientRechargeTotal>>> getRechargeTotalClients(CommonQO qo) { try { QueryResultVo<List<VoClientRechargeTotal>> res = clientSv.getRechargeTotalClients(qo); return BaseResponseUtils.buildSuccess(res); }catch (Exception e){ log.error("获取记录异常", e); return BaseResponseUtils.buildException(e.getMessage()); } } } pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientSv.java
@@ -5,6 +5,7 @@ import com.dy.pipIrrGlobal.daoSe.SeCardOperateMapper; import com.dy.pipIrrGlobal.voSt.VoClient; import com.dy.pipIrrGlobal.voSt.VoClientOpenCardCount; import com.dy.pipIrrGlobal.voSt.VoClientRechargeTotal; import com.dy.pipIrrGlobal.voSt.VoICCard; import com.dy.pipIrrStatistics.card.IcCardqo.CommonQO; import com.dy.pipIrrStatistics.client.qo.AmountSpentQO; @@ -261,4 +262,39 @@ rsVo.obj = seCardOperateMapper.getOpenIcCardClients(params); return rsVo ; } /** * 指定时间段内每个农户充值合计(物理卡) * @param qo * @return */ public QueryResultVo<List<VoClientRechargeTotal>> getRechargeTotalClients(CommonQO qo) { String timeStart = qo.getTimeStart(); String timeStop = qo.getTimeStop(); if (timeStart != null && timeStart != ""){ timeStart = timeStart + " 00:00:00"; }else { timeStart = LocalDate.now() + " 00:00:00"; } if (timeStop != null && timeStop != ""){ timeStop = timeStop + " 23:59:59"; }else { timeStop = LocalDateTime.now().toString(); } qo.setTimeStart(timeStart); qo.setTimeStop(timeStop); Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); Long itemTotal = seCardOperateMapper.getRechargeTotalClientsCount(params); QueryResultVo<List<VoClientRechargeTotal>> rsVo = new QueryResultVo<>() ; rsVo.pageSize = qo.pageSize ; rsVo.pageCurr = qo.pageCurr ; rsVo.calculateAndSet(itemTotal, params); rsVo.obj = seCardOperateMapper.getRechargeTotalClients(params); return rsVo ; } }