From 471cf8ec2f209183fe3b98499b3d32fb19ac927e Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期五, 09 八月 2024 15:35:45 +0800 Subject: [PATCH] 2024-08-09 朱宝民 统计指定月份各农户各天用水量及消费金额、统计指定年份各农户各月用水量及消费金额 --- pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java | 15 pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java | 13 pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientSv.java | 62 ++ pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/ClientAmountQO.java | 36 + pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoDayClient.java | 93 +++ pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/IntakeAmountQO.java | 9 pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayLastMapper.xml | 1050 ++++++++++++++++++++++++++++++++++--------- pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoMonthClient.java | 55 ++ pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientCtrl.java | 43 + pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmClientAmountDayLastMapper.java | 30 + pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/result/StatisticlResultCode.java | 4 11 files changed, 1,173 insertions(+), 237 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmClientAmountDayLastMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmClientAmountDayLastMapper.java index 1d7ef01..332281a 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmClientAmountDayLastMapper.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmClientAmountDayLastMapper.java @@ -3,6 +3,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.dy.pipIrrGlobal.pojoRm.RmClientAmountDayLast; import com.dy.pipIrrGlobal.voRm.VoClientAmountDay; +import com.dy.pipIrrGlobal.voSt.VoDayClient; +import com.dy.pipIrrGlobal.voSt.VoMonthClient; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -79,4 +81,32 @@ * @return */ List<VoClientAmountDay> getClientAmountDayLast(Map<?, ?> params); + + /** + * 缁熻鎸囧畾鏈堜唤鍚勫啘鎴峰悇澶╃敤姘撮噺鍙婃秷璐归噾棰濊褰曟暟閲� + * @param params + * @return + */ + Long getDayAmountAndMoneyCount(Map<?, ?> params); + + /** + * 缁熻鎸囧畾鏈堜唤鍚勫啘鎴峰悇澶╃敤姘撮噺鍙婃秷璐归噾棰� + * @param params + * @return + */ + List<VoDayClient> getDayAmountAndMoney(Map<?, ?> params); + + /** + * 缁熻鎸囧畾骞翠唤鍚勫啘鎴峰悇鏈堢敤姘撮噺鍙婃秷璐归噾棰濊褰曟暟閲� + * @param params + * @return + */ + Long getMonthAmountAndMoneyCount(Map<?, ?> params); + + /** + * 缁熻鎸囧畾骞翠唤鍚勫啘鎴峰悇鏈堢敤姘撮噺鍙婃秷璐归噾棰� + * @param params + * @return + */ + List<VoMonthClient> getMonthAmountAndMoney(Map<?, ?> params); } \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoDayClient.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoDayClient.java new file mode 100644 index 0000000..76c3787 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoDayClient.java @@ -0,0 +1,93 @@ +package com.dy.pipIrrGlobal.voSt; + +import com.alibaba.fastjson2.annotation.JSONField; +import com.alibaba.fastjson2.writer.ObjectWriterImplToString; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import lombok.Data; + +/** + * @author ZhuBaoMin + * @date 2024-08-09 9:39 + * @LastEditTime 2024-08-09 9:39 + * @Description 鍐滄埛鏃ョ敤姘磋鍥� + */ + +@Data +@JsonPropertyOrder({ "clientId", "clientName", "amount1" ,"money1", "amount2" ,"money2", "amount3" ,"money3", "amount4" ,"money4", "amount5" ,"money5", "amount6" ,"money6", "amount7" ,"money7", "amount8" ,"money8", "amount9" ,"money9", "amount10" ,"money10", "amount11" ,"money11", "amount12" ,"money12", "amount13" ,"money13", "amount14" ,"money14", "amount15" ,"money15", "amount16" ,"money16", "amount17" ,"money17", "amount18" ,"money18", "amount19" ,"money19", "amount20" ,"money20", "amount21" ,"money21", "amount22" ,"money22", "amount23" ,"money23", "amount24" ,"money24", "amount25" ,"money25", "amount26" ,"money26", "amount27" ,"money27", "amount28" ,"money28", "amount29" ,"money29", "amount30" ,"money30", "amount31" ,"money31" }) +public class VoDayClient { + private static final long serialVersionUID = 202408090946001L; + + /** + * 鍐滄埛ID + */ + @JSONField(serializeUsing= ObjectWriterImplToString.class) + private Long clientId; + + /** + * 鍐滄埛濮撳悕 + */ + private String clientName; + + private Double amount1; + private Double money1; + private Double amount2; + private Double money2; + private Double amount3; + private Double money3; + private Double amount4; + private Double money4; + private Double amount5; + private Double money5; + private Double amount6; + private Double money6; + private Double amount7; + private Double money7; + private Double amount8; + private Double money8; + private Double amount9; + private Double money9; + private Double amount10; + private Double money10; + private Double amount11; + private Double money11; + private Double amount12; + private Double money12; + private Double amount13; + private Double money13; + private Double amount14; + private Double money14; + private Double amount15; + private Double money15; + private Double amount16; + private Double money16; + private Double amount17; + private Double money17; + private Double amount18; + private Double money18; + private Double amount19; + private Double money19; + private Double amount20; + private Double money20; + private Double amount21; + private Double money21; + private Double amount22; + private Double money22; + private Double amount23; + private Double money23; + private Double amount24; + private Double money24; + private Double amount25; + private Double money25; + private Double amount26; + private Double money26; + private Double amount27; + private Double money27; + private Double amount28; + private Double money28; + private Double amount29; + private Double money29; + private Double amount30; + private Double money30; + private Double amount31; + private Double money31; +} diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoMonthClient.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoMonthClient.java new file mode 100644 index 0000000..6dfdb6c --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoMonthClient.java @@ -0,0 +1,55 @@ +package com.dy.pipIrrGlobal.voSt; + +import com.alibaba.fastjson2.annotation.JSONField; +import com.alibaba.fastjson2.writer.ObjectWriterImplToString; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import lombok.Data; + +/** + * @author ZhuBaoMin + * @date 2024-08-09 10:41 + * @LastEditTime 2024-08-09 10:41 + * @Description 鍐滄埛鏈堢敤姘磋鍥� + */ + +@Data +@JsonPropertyOrder({ "clientId", "clientName", "amount1" ,"money1", "amount2" ,"money2", "amount3" ,"money3", "amount4" ,"money4", "amount5" ,"money5", "amount6" ,"money6", "amount7" ,"money7", "amount8" ,"money8", "amount9" ,"money9", "amount10" ,"money10", "amount11" ,"money11", "amount12" ,"money12" }) +public class VoMonthClient { + private static final long serialVersionUID = 202408091042001L; + + /** + * 鍐滄埛ID + */ + @JSONField(serializeUsing= ObjectWriterImplToString.class) + private Long clientId; + + /** + * 鍐滄埛濮撳悕 + */ + private String clientName; + + private Double amount1; + private Double money1; + private Double amount2; + private Double money2; + private Double amount3; + private Double money3; + private Double amount4; + private Double money4; + private Double amount5; + private Double money5; + private Double amount6; + private Double money6; + private Double amount7; + private Double money7; + private Double amount8; + private Double money8; + private Double amount9; + private Double money9; + private Double amount10; + private Double money10; + private Double amount11; + private Double money11; + private Double amount12; + private Double money12; +} diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayLastMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayLastMapper.xml index 2e25990..07fb518 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayLastMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayLastMapper.xml @@ -1,246 +1,836 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.dy.pipIrrGlobal.daoRm.RmClientAmountDayLastMapper"> - <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmClientAmountDayLast"> - <!--@mbg.generated--> - <!--@Table rm_client_amount_day_last--> - <id column="id" jdbcType="BIGINT" property="id" /> - <result column="last_history_id" jdbcType="BIGINT" property="lastHistoryId" /> - <result column="client_id" jdbcType="BIGINT" property="clientId" /> - <result column="amount" jdbcType="FLOAT" property="amount" /> - <result column="money" jdbcType="FLOAT" property="money" /> - <result column="dt" jdbcType="DATE" property="dt" /> - <result column="open_dt_last" jdbcType="TIMESTAMP" property="openDtLast" /> - <result column="close_dt_last" jdbcType="TIMESTAMP" property="closeDtLast" /> - <result column="this_amount_last" jdbcType="FLOAT" property="thisAmountLast" /> - <result column="this_money_last" jdbcType="FLOAT" property="thisMoneyLast" /> - <result column="this_time_last" jdbcType="INTEGER" property="thisTimeLast" /> - <result column="rtu_dt_last" jdbcType="TIMESTAMP" property="rtuDtLast" /> - </resultMap> - <sql id="Base_Column_List"> - <!--@mbg.generated--> - id, last_history_id, client_id, amount, money, dt, open_dt_last, close_dt_last, this_amount_last, - this_money_last, this_time_last, rtu_dt_last - </sql> - <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> - <!--@mbg.generated--> - select - <include refid="Base_Column_List" /> - from rm_client_amount_day_last - where id = #{id,jdbcType=BIGINT} - </select> - <select id="selectByClientId" parameterType="java.lang.Long" resultMap="BaseResultMap"> - <!--@mbg.generated--> - select - <include refid="Base_Column_List" /> - from rm_client_amount_day_last - where client_id = #{ClientId,jdbcType=BIGINT} - </select> - <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> - <!--@mbg.generated--> - delete from rm_client_amount_day_last - where id = #{id,jdbcType=BIGINT} - </delete> - <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmClientAmountDayLast"> - <!--@mbg.generated--> - insert into rm_client_amount_day_last (id, last_history_id, client_id, - amount, money, dt, open_dt_last, - close_dt_last, this_amount_last, this_money_last, - this_time_last, rtu_dt_last) - values (#{id,jdbcType=BIGINT}, #{lastHistoryId,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT}, - #{amount,jdbcType=FLOAT}, #{money,jdbcType=FLOAT}, #{dt,jdbcType=DATE}, #{openDtLast,jdbcType=TIMESTAMP}, - #{closeDtLast,jdbcType=TIMESTAMP}, #{thisAmountLast,jdbcType=FLOAT}, #{thisMoneyLast,jdbcType=FLOAT}, - #{thisTimeLast,jdbcType=INTEGER}, #{rtuDtLast,jdbcType=TIMESTAMP}) - </insert> - <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmClientAmountDayLast"> - <!--@mbg.generated--> - insert into rm_client_amount_day_last - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="id != null"> + <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmClientAmountDayLast"> + <!--@mbg.generated--> + <!--@Table rm_client_amount_day_last--> + <id column="id" jdbcType="BIGINT" property="id"/> + <result column="last_history_id" jdbcType="BIGINT" property="lastHistoryId"/> + <result column="client_id" jdbcType="BIGINT" property="clientId"/> + <result column="amount" jdbcType="FLOAT" property="amount"/> + <result column="money" jdbcType="FLOAT" property="money"/> + <result column="dt" jdbcType="DATE" property="dt"/> + <result column="open_dt_last" jdbcType="TIMESTAMP" property="openDtLast"/> + <result column="close_dt_last" jdbcType="TIMESTAMP" property="closeDtLast"/> + <result column="this_amount_last" jdbcType="FLOAT" property="thisAmountLast"/> + <result column="this_money_last" jdbcType="FLOAT" property="thisMoneyLast"/> + <result column="this_time_last" jdbcType="INTEGER" property="thisTimeLast"/> + <result column="rtu_dt_last" jdbcType="TIMESTAMP" property="rtuDtLast"/> + </resultMap> + <sql id="Base_Column_List"> + <!--@mbg.generated--> id, - </if> - <if test="lastHistoryId != null"> last_history_id, - </if> - <if test="clientId != null"> client_id, - </if> - <if test="amount != null"> amount, - </if> - <if test="money != null"> money, - </if> - <if test="dt != null"> dt, - </if> - <if test="openDtLast != null"> open_dt_last, - </if> - <if test="closeDtLast != null"> close_dt_last, - </if> - <if test="thisAmountLast != null"> this_amount_last, - </if> - <if test="thisMoneyLast != null"> this_money_last, - </if> - <if test="thisTimeLast != null"> this_time_last, - </if> - <if test="rtuDtLast != null"> - rtu_dt_last, - </if> - </trim> - <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="id != null"> - #{id,jdbcType=BIGINT}, - </if> - <if test="lastHistoryId != null"> - #{lastHistoryId,jdbcType=BIGINT}, - </if> - <if test="clientId != null"> - #{clientId,jdbcType=BIGINT}, - </if> - <if test="amount != null"> - #{amount,jdbcType=FLOAT}, - </if> - <if test="money != null"> - #{money,jdbcType=FLOAT}, - </if> - <if test="dt != null"> - #{dt,jdbcType=DATE}, - </if> - <if test="openDtLast != null"> - #{openDtLast,jdbcType=TIMESTAMP}, - </if> - <if test="closeDtLast != null"> - #{closeDtLast,jdbcType=TIMESTAMP}, - </if> - <if test="thisAmountLast != null"> - #{thisAmountLast,jdbcType=FLOAT}, - </if> - <if test="thisMoneyLast != null"> - #{thisMoneyLast,jdbcType=FLOAT}, - </if> - <if test="thisTimeLast != null"> - #{thisTimeLast,jdbcType=INTEGER}, - </if> - <if test="rtuDtLast != null"> - #{rtuDtLast,jdbcType=TIMESTAMP}, - </if> - </trim> - </insert> - <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmClientAmountDayLast"> - <!--@mbg.generated--> - update rm_client_amount_day_last - <set> - <if test="lastHistoryId != null"> - last_history_id = #{lastHistoryId,jdbcType=BIGINT}, - </if> - <if test="clientId != null"> - client_id = #{clientId,jdbcType=BIGINT}, - </if> - <if test="amount != null"> - amount = #{amount,jdbcType=FLOAT}, - </if> - <if test="money != null"> - money = #{money,jdbcType=FLOAT}, - </if> - <if test="dt != null"> - dt = #{dt,jdbcType=DATE}, - </if> - <if test="openDtLast != null"> - open_dt_last = #{openDtLast,jdbcType=TIMESTAMP}, - </if> - <if test="closeDtLast != null"> - close_dt_last = #{closeDtLast,jdbcType=TIMESTAMP}, - </if> - <if test="thisAmountLast != null"> - this_amount_last = #{thisAmountLast,jdbcType=FLOAT}, - </if> - <if test="thisMoneyLast != null"> - this_money_last = #{thisMoneyLast,jdbcType=FLOAT}, - </if> - <if test="thisTimeLast != null"> - this_time_last = #{thisTimeLast,jdbcType=INTEGER}, - </if> - <if test="rtuDtLast != null"> - rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP}, - </if> - </set> - where id = #{id,jdbcType=BIGINT} - </update> - <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmClientAmountDayLast"> - <!--@mbg.generated--> - update rm_client_amount_day_last - set last_history_id = #{lastHistoryId,jdbcType=BIGINT}, - client_id = #{clientId,jdbcType=BIGINT}, - amount = #{amount,jdbcType=FLOAT}, - money = #{money,jdbcType=FLOAT}, - dt = #{dt,jdbcType=DATE}, - open_dt_last = #{openDtLast,jdbcType=TIMESTAMP}, - close_dt_last = #{closeDtLast,jdbcType=TIMESTAMP}, - this_amount_last = #{thisAmountLast,jdbcType=FLOAT}, - this_money_last = #{thisMoneyLast,jdbcType=FLOAT}, - this_time_last = #{thisTimeLast,jdbcType=INTEGER}, - rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=BIGINT} - </update> - <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍鎬绘暟--> - <select id="getRecordCount" resultType="java.lang.Long"> - select count(*) - from rm_client_amount_day_last rcadl - Left join se_client sc on sc.id = rcadl.client_id - <where> - <if test="clientName != null and clientName != '' "> - and sc.name like CONCAT('%',#{clientName,jdbcType=VARCHAR},'%') - </if> - <if test="clientId != null and clientId != ''"> - and rcad.client_id = #{clientId} - </if> - <if test="startDt != null"> - and rcadl.dt >= #{startDt,jdbcType=DATE} - </if> - <if test="endDt != null"> - and rcadl.dt <= #{endDt,jdbcType=DATE} - </if> - </where> + rtu_dt_last + </sql> + <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> + <!--@mbg.generated--> + select + <include refid="Base_Column_List"/> + from rm_client_amount_day_last + where id = #{id,jdbcType=BIGINT} </select> - <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍--> - <select id="getClientAmountDayLast" resultType="com.dy.pipIrrGlobal.voRm.VoClientAmountDay"> - select - CAST(rcadl.client_id AS char)AS clientId, - rcadl.amount as amount, - rcadl.money as money, - rcadl.dt as dt, - rcadl.open_dt_last as openDtLast, - rcadl.close_dt_last as closeDtLast, - rcadl.this_amount_last as thisAmountLast, - rcadl.this_money_last as thisMoneyLast, - rcadl.this_time_last as thisTimeLast, - rcadl.rtu_dt_last as rtuDtLast, - sc.name as clientName - from rm_client_amount_day_last rcadl - Left join se_client sc on sc.id = rcadl.client_id - <where> - <if test="clientName != null and clientName != '' "> - and sc.name like CONCAT('%',#{clientName,jdbcType=VARCHAR},'%') - </if> - <if test="clientId != null and clientId != ''"> - and rcad.client_id = #{clientId} - </if> - <if test="startDt != null"> - and rcadl.dt >= #{startDt,jdbcType=DATE} - </if> - <if test="endDt != null"> - and rcadl.dt <= #{endDt,jdbcType=DATE} - </if> - </where> - ORDER BY rcadl.id DESC - <if test="pageCurr != null and pageSize != null"> - LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} - </if> - </select> + <select id="selectByClientId" parameterType="java.lang.Long" resultMap="BaseResultMap"> + <!--@mbg.generated--> + select + <include refid="Base_Column_List"/> + from rm_client_amount_day_last + where client_id = #{ClientId,jdbcType=BIGINT} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> + <!--@mbg.generated--> + delete + from rm_client_amount_day_last + where id = #{id,jdbcType=BIGINT} + </delete> + <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmClientAmountDayLast"> + <!--@mbg.generated--> + insert into rm_client_amount_day_last (id, last_history_id, client_id, + amount, money, dt, open_dt_last, + close_dt_last, this_amount_last, this_money_last, + this_time_last, rtu_dt_last) + values (#{id,jdbcType=BIGINT}, #{lastHistoryId,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT}, + #{amount,jdbcType=FLOAT}, #{money,jdbcType=FLOAT}, #{dt,jdbcType=DATE}, + #{openDtLast,jdbcType=TIMESTAMP}, + #{closeDtLast,jdbcType=TIMESTAMP}, #{thisAmountLast,jdbcType=FLOAT}, #{thisMoneyLast,jdbcType=FLOAT}, + #{thisTimeLast,jdbcType=INTEGER}, #{rtuDtLast,jdbcType=TIMESTAMP}) + </insert> + <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmClientAmountDayLast"> + <!--@mbg.generated--> + insert into rm_client_amount_day_last + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + id, + </if> + <if test="lastHistoryId != null"> + last_history_id, + </if> + <if test="clientId != null"> + client_id, + </if> + <if test="amount != null"> + amount, + </if> + <if test="money != null"> + money, + </if> + <if test="dt != null"> + dt, + </if> + <if test="openDtLast != null"> + open_dt_last, + </if> + <if test="closeDtLast != null"> + close_dt_last, + </if> + <if test="thisAmountLast != null"> + this_amount_last, + </if> + <if test="thisMoneyLast != null"> + this_money_last, + </if> + <if test="thisTimeLast != null"> + this_time_last, + </if> + <if test="rtuDtLast != null"> + rtu_dt_last, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id,jdbcType=BIGINT}, + </if> + <if test="lastHistoryId != null"> + #{lastHistoryId,jdbcType=BIGINT}, + </if> + <if test="clientId != null"> + #{clientId,jdbcType=BIGINT}, + </if> + <if test="amount != null"> + #{amount,jdbcType=FLOAT}, + </if> + <if test="money != null"> + #{money,jdbcType=FLOAT}, + </if> + <if test="dt != null"> + #{dt,jdbcType=DATE}, + </if> + <if test="openDtLast != null"> + #{openDtLast,jdbcType=TIMESTAMP}, + </if> + <if test="closeDtLast != null"> + #{closeDtLast,jdbcType=TIMESTAMP}, + </if> + <if test="thisAmountLast != null"> + #{thisAmountLast,jdbcType=FLOAT}, + </if> + <if test="thisMoneyLast != null"> + #{thisMoneyLast,jdbcType=FLOAT}, + </if> + <if test="thisTimeLast != null"> + #{thisTimeLast,jdbcType=INTEGER}, + </if> + <if test="rtuDtLast != null"> + #{rtuDtLast,jdbcType=TIMESTAMP}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmClientAmountDayLast"> + <!--@mbg.generated--> + update rm_client_amount_day_last + <set> + <if test="lastHistoryId != null"> + last_history_id = #{lastHistoryId,jdbcType=BIGINT}, + </if> + <if test="clientId != null"> + client_id = #{clientId,jdbcType=BIGINT}, + </if> + <if test="amount != null"> + amount = #{amount,jdbcType=FLOAT}, + </if> + <if test="money != null"> + money = #{money,jdbcType=FLOAT}, + </if> + <if test="dt != null"> + dt = #{dt,jdbcType=DATE}, + </if> + <if test="openDtLast != null"> + open_dt_last = #{openDtLast,jdbcType=TIMESTAMP}, + </if> + <if test="closeDtLast != null"> + close_dt_last = #{closeDtLast,jdbcType=TIMESTAMP}, + </if> + <if test="thisAmountLast != null"> + this_amount_last = #{thisAmountLast,jdbcType=FLOAT}, + </if> + <if test="thisMoneyLast != null"> + this_money_last = #{thisMoneyLast,jdbcType=FLOAT}, + </if> + <if test="thisTimeLast != null"> + this_time_last = #{thisTimeLast,jdbcType=INTEGER}, + </if> + <if test="rtuDtLast != null"> + rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP}, + </if> + </set> + where id = #{id,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmClientAmountDayLast"> + <!--@mbg.generated--> + update rm_client_amount_day_last + set last_history_id = #{lastHistoryId,jdbcType=BIGINT}, + client_id = #{clientId,jdbcType=BIGINT}, + amount = #{amount,jdbcType=FLOAT}, + money = #{money,jdbcType=FLOAT}, + dt = #{dt,jdbcType=DATE}, + open_dt_last = #{openDtLast,jdbcType=TIMESTAMP}, + close_dt_last = #{closeDtLast,jdbcType=TIMESTAMP}, + this_amount_last = #{thisAmountLast,jdbcType=FLOAT}, + this_money_last = #{thisMoneyLast,jdbcType=FLOAT}, + this_time_last = #{thisTimeLast,jdbcType=INTEGER}, + rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=BIGINT} + </update> + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍鎬绘暟--> + <select id="getRecordCount" resultType="java.lang.Long"> + select count(*) + from rm_client_amount_day_last rcadl + Left join se_client sc on sc.id = rcadl.client_id + <where> + <if test="clientName != null and clientName != ''"> + and sc.name like CONCAT('%', #{clientName,jdbcType=VARCHAR}, '%') + </if> + <if test="clientId != null and clientId != ''"> + and rcadl.client_id = #{clientId} + </if> + <if test="startDt != null"> + and rcadl.dt >= #{startDt,jdbcType=DATE} + </if> + <if test="endDt != null"> + and rcadl.dt <= #{endDt,jdbcType=DATE} + </if> + </where> + </select> + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍--> + <select id="getClientAmountDayLast" resultType="com.dy.pipIrrGlobal.voRm.VoClientAmountDay"> + select CAST(rcadl.client_id AS char) AS clientId, + rcadl.amount as amount, + rcadl.money as money, + rcadl.dt as dt, + rcadl.open_dt_last as openDtLast, + rcadl.close_dt_last as closeDtLast, + rcadl.this_amount_last as thisAmountLast, + rcadl.this_money_last as thisMoneyLast, + rcadl.this_time_last as thisTimeLast, + rcadl.rtu_dt_last as rtuDtLast, + sc.name as clientName + from rm_client_amount_day_last rcadl + Left join se_client sc on sc.id = rcadl.client_id + <where> + <if test="clientName != null and clientName != ''"> + and sc.name like CONCAT('%', #{clientName,jdbcType=VARCHAR}, '%') + </if> + <if test="clientId != null and clientId != ''"> + and rcadl.client_id = #{clientId} + </if> + <if test="startDt != null"> + and rcadl.dt >= #{startDt,jdbcType=DATE} + </if> + <if test="endDt != null"> + and rcadl.dt <= #{endDt,jdbcType=DATE} + </if> + </where> + ORDER BY rcadl.id DESC + <!-- <if test="pageCurr != null and pageSize != null">--> + <!-- LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}--> + <!-- </if>--> + <trim prefix="limit "> + <if test="start != null and count != null"> + #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} + </if> + </trim> + </select> + + <!--缁熻鎸囧畾鏈堜唤鍚勫啘鎴峰悇澶╃敤姘撮噺鍙婃秷璐归噾棰濊褰曟暟閲�--> + <select id="getDayAmountAndMoneyCount" resultType="java.lang.Long"> + SELECT COUNT(*) AS recordCount + FROM se_client cli + <where> + <if test="clientName != null and clientName != ''"> + AND cli.name = #{clientName} + </if> + </where> + </select> + + <!--缁熻鎸囧畾鏈堜唤鍚勫啘鎴峰悇澶╃敤姘撮噺鍙婃秷璐归噾棰�--> + <select id="getDayAmountAndMoney" resultType="com.dy.pipIrrGlobal.voSt.VoDayClient"> + SELECT cli.id AS clientId, + cli.name AS clientName, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 1), 0) AS amount1, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 1), 0) AS money1, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 2), 0) AS amount2, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 2), 0) AS money2, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 3), 0) AS amount3, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 3), 0) AS money3, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 4), 0) AS amount4, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 4), 0) AS money4, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 5), 0) AS amount5, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 5), 0) AS money5, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 6), 0) AS amount6, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 6), 0) AS money6, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 7), 0) AS amount7, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 7), 0) AS money7, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 8), 0) AS amount8, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 8), 0) AS money8, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 9), 0) AS amount9, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 9), 0) AS money9, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 10), 0) AS amount10, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 10), 0) AS money10, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 11), 0) AS amount11, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 11), 0) AS money11, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 12), 0) AS amount12, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 12), 0) AS money12, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 13), 0) AS amount13, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 13), 0) AS money13, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 14), 0) AS amount14, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 14), 0) AS money14, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 15), 0) AS amount15, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 15), 0) AS money15, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 16), 0) AS amount16, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 16), 0) AS money16, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 17), 0) AS amount17, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 17), 0) AS money17, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 18), 0) AS amount18, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 18), 0) AS money18, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 19), 0) AS amount19, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 19), 0) AS money19, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 20), 0) AS amount20, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 20), 0) AS money20, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 21), 0) AS amount21, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 21), 0) AS money21, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 22), 0) AS amount22, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 22), 0) AS money22, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 23), 0) AS amount23, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 23), 0) AS money23, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 24), 0) AS amount24, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 24), 0) AS money24, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 25), 0) AS amount25, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 25), 0) AS money25, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 26), 0) AS amount26, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 26), 0) AS money26, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 27), 0) AS amount27, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 27), 0) AS money27, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 28), 0) AS amount28, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 28), 0) AS money28, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 29), 0) AS amount29, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 29), 0) AS money29, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 30), 0) AS amount30, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 30), 0) AS money30, + IFNULL((SELECT IFNULL(amount, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 31), 0) AS amount31, + IFNULL((SELECT IFNULL(money, 0) + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = #{month} + AND DAY(clientDay.dt) = 31), 0) AS money31 + FROM se_client cli + <where> + <if test="clientName != null and clientName != ''"> + AND cli.name = #{clientName} + </if> + </where> + ORDER BY cli.id + <trim prefix="limit "> + <if test="start != null and count != null"> + #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} + </if> + </trim> + </select> + + <!--缁熻鎸囧畾骞翠唤鍚勫啘鎴峰悇鏈堢敤姘撮噺鍙婃秷璐归噾棰濊褰曟暟閲�--> + <select id="getMonthAmountAndMoneyCount" resultType="java.lang.Long"> + SELECT COUNT(*) AS recordCount + FROM se_client cli + <where> + <if test="clientName != null and clientName != ''"> + AND cli.name = #{clientName} + </if> + </where> + </select> + + <!--缁熻鎸囧畾骞翠唤鍚勫啘鎴峰悇鏈堢敤姘撮噺鍙婃秷璐归噾棰�--> + <select id="getMonthAmountAndMoney" resultType="com.dy.pipIrrGlobal.voSt.VoMonthClient"> + SELECT cli.id AS clientId, + cli.name AS clientName, + IFNULL((SELECT SUM(amount) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 1 + GROUP BY(clientDay.client_id)), 0) AS amount1, + IFNULL((SELECT SUM(money) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 1 + GROUP BY(clientDay.client_id)), 0) AS money1, + IFNULL((SELECT SUM(amount) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 2 + GROUP BY(clientDay.client_id)), 0) AS amount2, + IFNULL((SELECT SUM(money) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 2 + GROUP BY(clientDay.client_id)), 0) AS money2, + IFNULL((SELECT SUM(amount) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 3 + GROUP BY(clientDay.client_id)), 0) AS amount3, + IFNULL((SELECT SUM(money) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 3 + GROUP BY(clientDay.client_id)), 0) AS money3, + IFNULL((SELECT SUM(amount) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 4 + GROUP BY(clientDay.client_id)), 0) AS amount4, + IFNULL((SELECT SUM(money) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 4 + GROUP BY(clientDay.client_id)), 0) AS money4, + IFNULL((SELECT SUM(amount) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 5 + GROUP BY(clientDay.client_id)), 0) AS amount5, + IFNULL((SELECT SUM(money) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 5 + GROUP BY(clientDay.client_id)), 0) AS money5, + IFNULL((SELECT SUM(amount) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 6 + GROUP BY(clientDay.client_id)), 0) AS amount6, + IFNULL((SELECT SUM(money) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 6 + GROUP BY(clientDay.client_id)), 0) AS money6, + IFNULL((SELECT SUM(amount) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 7 + GROUP BY(clientDay.client_id)), 0) AS amount7, + IFNULL((SELECT SUM(money) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 7 + GROUP BY(clientDay.client_id)), 0) AS money7, + IFNULL((SELECT SUM(amount) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 8 + GROUP BY(clientDay.client_id)), 0) AS amount8, + IFNULL((SELECT SUM(money) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 8 + GROUP BY(clientDay.client_id)), 0) AS money8, + IFNULL((SELECT SUM(amount) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 9 + GROUP BY(clientDay.client_id)), 0) AS amount9, + IFNULL((SELECT SUM(money) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 9 + GROUP BY(clientDay.client_id)), 0) AS money9, + IFNULL((SELECT SUM(amount) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 10 + GROUP BY(clientDay.client_id)), 0) AS amount10, + IFNULL((SELECT SUM(money) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 10 + GROUP BY(clientDay.client_id)), 0) AS money10, + IFNULL((SELECT SUM(amount) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 11 + GROUP BY(clientDay.client_id)), 0) AS amount11, + IFNULL((SELECT SUM(money) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 11 + GROUP BY(clientDay.client_id)), 0) AS money11, + IFNULL((SELECT SUM(amount) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 12 + GROUP BY(clientDay.client_id)), 0) AS amount12, + IFNULL((SELECT SUM(money) AS amount + FROM rm_client_amount_day_last clientDay + WHERE clientDay.client_id = cli.id + AND YEAR(clientDay.dt) = #{year} + AND MONTH(clientDay.dt) = 12 + GROUP BY(clientDay.client_id)), 0) AS money12 + FROM se_client cli + <where> + <if test="clientName != null and clientName != ''"> + AND cli.name = #{clientName} + </if> + </where> + ORDER BY cli.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> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientCtrl.java index 84ec52e..b0dd80b 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientCtrl.java @@ -5,10 +5,14 @@ import com.dy.common.webUtil.BaseResponseUtils; import com.dy.common.webUtil.QueryResultVo; import com.dy.pipIrrGlobal.voSt.VoClient; +import com.dy.pipIrrGlobal.voSt.VoDayClient; +import com.dy.pipIrrGlobal.voSt.VoMonthClient; import com.dy.pipIrrStatistics.client.qo.AmountSpentQO; import com.dy.pipIrrStatistics.client.qo.OpenCountQO; import com.dy.pipIrrStatistics.client.qo.WaterConsumptionQO; import com.dy.pipIrrStatistics.client.qo.WaterDurationQO; +import com.dy.pipIrrStatistics.intake.qo.ClientAmountQO; +import com.dy.pipIrrStatistics.result.StatisticlResultCode; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -132,4 +136,43 @@ return BaseResponseUtils.buildException(e.getMessage()) ; } } + + /** + * 缁熻鎸囧畾鏈堜唤鍚勫啘鎴峰悇澶╃敤姘撮噺鍙婃秷璐归噾棰� + * @param qo + * @return + */ + @GetMapping(path = "/getDayAmountAndMoney") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoDayClient>>> getDayAmountAndMoney(ClientAmountQO qo) { + if(qo.getYearMonth() == null) { + return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.YEAR_AND_MONTH_CANNOT_BE_NULL.getMessage()); + } + + try { + return BaseResponseUtils.buildSuccess(clientSv.getDayAmountAndMoney(qo)); + } catch (Exception e) { + log.error("鑾峰彇璁板綍寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } + + /** + * 缁熻鎸囧畾骞翠唤鍚勫啘鎴峰悇鏈堢敤姘撮噺鍙婃秷璐归噾棰� + * @param qo + * @return + */ + @GetMapping(path = "/getMonthAmountAndMoney") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoMonthClient>>> getMonthAmountAndMoney(ClientAmountQO qo) { + if(qo.getYear() == null) { + return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.YEAR_CANNOT_BE_NULL.getMessage()); + } + try { + return BaseResponseUtils.buildSuccess(clientSv.getMonthAmountAndMoney(qo)); + } catch (Exception e) { + log.error("鑾峰彇璁板綍寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } } diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientSv.java index f86b5db..3314c6b 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientSv.java @@ -1,18 +1,24 @@ package com.dy.pipIrrStatistics.client; import com.dy.common.webUtil.QueryResultVo; +import com.dy.pipIrrGlobal.daoRm.RmClientAmountDayLastMapper; import com.dy.pipIrrGlobal.daoRm.RmOpenCloseValveHistoryMapper; import com.dy.pipIrrGlobal.voSt.VoClient; +import com.dy.pipIrrGlobal.voSt.VoDayClient; +import com.dy.pipIrrGlobal.voSt.VoMonthClient; import com.dy.pipIrrStatistics.client.qo.AmountSpentQO; import com.dy.pipIrrStatistics.client.qo.OpenCountQO; import com.dy.pipIrrStatistics.client.qo.WaterConsumptionQO; import com.dy.pipIrrStatistics.client.qo.WaterDurationQO; +import com.dy.pipIrrStatistics.intake.qo.ClientAmountQO; import lombok.extern.slf4j.Slf4j; import org.apache.dubbo.common.utils.PojoUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.text.ParseException; import java.time.LocalDate; +import java.util.Calendar; import java.util.List; import java.util.Map; import java.util.Optional; @@ -29,6 +35,9 @@ public class ClientSv { @Autowired private RmOpenCloseValveHistoryMapper rmOpenCloseValveHistoryMapper; + + @Autowired + private RmClientAmountDayLastMapper rmClientAmountDayLastMapper; /** * 鑾峰彇鎸囧畾鏃堕棿娈靛唴寮�闃�娆℃暟瓒呰繃鎸囧畾鍊肩殑鍐滄埛 @@ -219,4 +228,57 @@ rsVo.obj = rmOpenCloseValveHistoryMapper.getLargeWaterDurationClients(params); return rsVo ; } + + /** + * 缁熻鎸囧畾鏈堜唤鍚勫啘鎴峰悇澶╃敤姘撮噺鍙婃秷璐归噾棰� + * @param qo + * @return + */ + public QueryResultVo<List<VoDayClient>> getDayAmountAndMoney(ClientAmountQO qo) throws ParseException { + Integer year = qo.getYearMonth().getYear(); + Integer month = qo.getYearMonth().getMonthValue(); + qo.setYear(year); + qo.setMonth(month); + + // 鐢熸垚鏌ヨ鍙傛暟 + Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; + + // 鑾峰彇绗﹀悎鏉′欢鐨勮褰曟暟 + Long itemTotal = Optional.ofNullable(rmClientAmountDayLastMapper.getDayAmountAndMoneyCount(params)).orElse(0L); + + QueryResultVo<List<VoDayClient>> rsVo = new QueryResultVo<>() ; + + rsVo.pageSize = qo.pageSize ; + rsVo.pageCurr = qo.pageCurr ; + + rsVo.calculateAndSet(itemTotal, params); + rsVo.obj = rmClientAmountDayLastMapper.getDayAmountAndMoney(params); + return rsVo ; + } + + /** + * 缁熻鎸囧畾骞翠唤鍚勫啘鎴峰悇鏈堢敤姘撮噺鍙婃秷璐归噾棰� + * @param qo + * @return + */ + public QueryResultVo<List<VoMonthClient>> getMonthAmountAndMoney(ClientAmountQO qo) { + Calendar calendar = Calendar.getInstance(); + Integer year = Optional.ofNullable(qo.getYear()).orElse(calendar.get(Calendar.YEAR)); + qo.setYear(year); + + // 鐢熸垚鏌ヨ鍙傛暟 + Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; + + // 鑾峰彇绗﹀悎鏉′欢鐨勮褰曟暟 + Long itemTotal = Optional.ofNullable(rmClientAmountDayLastMapper.getMonthAmountAndMoneyCount(params)).orElse(0L); + + QueryResultVo<List<VoMonthClient>> rsVo = new QueryResultVo<>() ; + + rsVo.pageSize = qo.pageSize ; + rsVo.pageCurr = qo.pageCurr ; + + rsVo.calculateAndSet(itemTotal, params); + rsVo.obj = rmClientAmountDayLastMapper.getMonthAmountAndMoney(params); + return rsVo ; + } } diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java index 704e2c0..f92bb82 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java @@ -648,9 +648,8 @@ * @return */ public QueryResultVo<List<VoDayIntakeAmount>> getDayIntakeAmount(IntakeAmountQO qo) { - Calendar calendar = Calendar.getInstance(); - Integer year = Optional.ofNullable(qo.getYear()).orElse(calendar.get(Calendar.YEAR)); - Integer month = Optional.ofNullable(qo.getMonth()).orElse(calendar.get(Calendar.MONTH)); + Integer year = qo.getYearMonth().getYear(); + Integer month = qo.getYearMonth().getMonthValue(); qo.setYear(year); qo.setMonth(month); @@ -702,9 +701,11 @@ * @return */ public QueryResultVo<List<VoDayLoss>> getDayLossAmount(IntakeAmountQO qo) { - Calendar calendar = Calendar.getInstance(); - Integer year = Optional.ofNullable(qo.getYear()).orElse(calendar.get(Calendar.YEAR)); - Integer month = Optional.ofNullable(qo.getMonth()).orElse(calendar.get(Calendar.MONTH)); + //Calendar calendar = Calendar.getInstance(); + //Integer year = Optional.ofNullable(qo.getYear()).orElse(calendar.get(Calendar.YEAR)); + //Integer month = Optional.ofNullable(qo.getMonth()).orElse(calendar.get(Calendar.MONTH)); + Integer year = qo.getYearMonth().getYear(); + Integer month = qo.getYearMonth().getMonthValue(); qo.setYear(year); qo.setMonth(month); diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java index 948a8e2..2d103d1 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java @@ -6,6 +6,7 @@ import com.dy.common.webUtil.QueryResultVo; import com.dy.pipIrrGlobal.voSt.*; import com.dy.pipIrrStatistics.intake.qo.*; +import com.dy.pipIrrStatistics.result.StatisticlResultCode; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -335,6 +336,10 @@ @GetMapping(path = "/getDayIntakeAmount") @SsoAop() public BaseResponse<QueryResultVo<List<VoDayIntakeAmount>>> getDayIntakeAmount(IntakeAmountQO qo) { + if(qo.getYearMonth() == null) { + return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.YEAR_AND_MONTH_CANNOT_BE_NULL.getMessage()); + } + try { return BaseResponseUtils.buildSuccess(intakeSv.getDayIntakeAmount(qo)); } catch (Exception e) { @@ -351,6 +356,9 @@ @GetMapping(path = "/getMonthIntakeAmount") @SsoAop() public BaseResponse<QueryResultVo<List<VoMonthAmount>>> getMonthIntakeAmount(IntakeAmountQO qo) { + if(qo.getYear() == null) { + return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.YEAR_CANNOT_BE_NULL.getMessage()); + } try { return BaseResponseUtils.buildSuccess(intakeSv.getMonthIntakeAmount(qo)); } catch (Exception e) { @@ -367,6 +375,10 @@ @GetMapping(path = "/getDayLossAmount") @SsoAop() public BaseResponse<QueryResultVo<List<VoDayLoss>>> getDayLossAmount(IntakeAmountQO qo) { + if(qo.getYearMonth() == null) { + return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.YEAR_AND_MONTH_CANNOT_BE_NULL.getMessage()); + } + try { return BaseResponseUtils.buildSuccess(intakeSv.getDayLossAmount(qo)); } catch (Exception e) { @@ -383,6 +395,9 @@ @GetMapping(path = "/getMonthLossAmount") @SsoAop() public BaseResponse<QueryResultVo<List<VoMonthAmount>>> getMonthLossAmount(IntakeAmountQO qo) { + if(qo.getYear() == null) { + return BaseResponseUtils.buildErrorMsg(StatisticlResultCode.YEAR_CANNOT_BE_NULL.getMessage()); + } try { return BaseResponseUtils.buildSuccess(intakeSv.getMonthLossAmount(qo)); } catch (Exception e) { diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/ClientAmountQO.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/ClientAmountQO.java new file mode 100644 index 0000000..a989010 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/ClientAmountQO.java @@ -0,0 +1,36 @@ +package com.dy.pipIrrStatistics.intake.qo; + +import com.dy.common.webUtil.QueryConditionVo; +import lombok.Data; + +import java.time.LocalDate; + +/** + * @author ZhuBaoMin + * @date 2024-08-09 11:18 + * @LastEditTime 2024-08-09 11:18 + * @Description 缁熻鍐滄埛鐢ㄦ按鏌ヨ瀵硅薄 + */ + +@Data +public class ClientAmountQO extends QueryConditionVo { + /** + * 缁熻骞存湀 + */ + private LocalDate yearMonth; + + /** + * 骞� + */ + private Integer year; + + /** + * 鏈� + */ + private Integer month; + + /** + * 鍐滄埛濮撳悕 + */ + private String clientName; +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/IntakeAmountQO.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/IntakeAmountQO.java index eea4659..f854097 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/IntakeAmountQO.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/IntakeAmountQO.java @@ -1,7 +1,10 @@ package com.dy.pipIrrStatistics.intake.qo; import com.dy.common.webUtil.QueryConditionVo; +import jakarta.validation.constraints.NotNull; import lombok.Data; + +import java.time.LocalDate; /** * @author ZhuBaoMin @@ -14,6 +17,12 @@ public class IntakeAmountQO extends QueryConditionVo { /** + * 缁熻骞存湀 + */ + @NotNull(message = "缁熻骞存湀涓嶈兘涓虹┖") + private LocalDate yearMonth; + + /** * 骞� */ private Integer year; diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/result/StatisticlResultCode.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/result/StatisticlResultCode.java index 4cba413..b5c298e 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/result/StatisticlResultCode.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/result/StatisticlResultCode.java @@ -13,7 +13,9 @@ @Getter @AllArgsConstructor public enum StatisticlResultCode { - NO_RECORDS(10001, "娌℃湁绗﹀悎鏉′欢鐨勮褰�"); + NO_RECORDS(10001, "娌℃湁绗﹀悎鏉′欢鐨勮褰�"), + YEAR_AND_MONTH_CANNOT_BE_NULL(10002, "骞翠唤鍜屾湀浠戒笉鑳戒负绌�"), + YEAR_CANNOT_BE_NULL(10003, "骞翠唤涓嶈兘涓虹┖"); private final Integer code; private final String message; -- Gitblit v1.8.0