2024-08-09 朱宝民 统计指定月份各农户各天用水量及消费金额、统计指定年份各农户各月用水量及消费金额
8个文件已修改
3个文件已添加
1410 ■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmClientAmountDayLastMapper.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoDayClient.java 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoMonthClient.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayLastMapper.xml 1050 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientCtrl.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/client/ClientSv.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/ClientAmountQO.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/IntakeAmountQO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/result/StatisticlResultCode.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoDayClient.java
New file
@@ -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;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoMonthClient.java
New file
@@ -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;
}
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 &gt;= #{startDt,jdbcType=DATE}
      </if>
      <if test="endDt != null">
        and rcadl.dt &lt;= #{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 &gt;= #{startDt,jdbcType=DATE}
      </if>
      <if test="endDt != null">
        and rcadl.dt &lt;= #{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 &gt;= #{startDt,jdbcType=DATE}
            </if>
            <if test="endDt != null">
                and rcadl.dt &lt;= #{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 &gt;= #{startDt,jdbcType=DATE}
            </if>
            <if test="endDt != null">
                and rcadl.dt &lt;= #{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>
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()) ;
        }
    }
}
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 ;
    }
}
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);
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) {
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/ClientAmountQO.java
New file
@@ -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;
}
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;
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;