From 4a2deb11b819dd78a8c75e244ef67ec2e48cf5f5 Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期一, 14 四月 2025 21:03:28 +0800 Subject: [PATCH] 重构轮灌组修改接口 --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayMapper.xml | 82 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 79 insertions(+), 3 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayMapper.xml index cbd5d43..23981d4 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayMapper.xml @@ -8,6 +8,7 @@ <result column="client_id" jdbcType="BIGINT" property="clientId" /> <result column="amount" jdbcType="FLOAT" property="amount" /> <result column="money" jdbcType="FLOAT" property="money" /> + <result column="times" jdbcType="INTEGER" property="times" /> <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" /> @@ -18,7 +19,7 @@ </resultMap> <sql id="Base_Column_List"> <!--@mbg.generated--> - id, client_id, amount, money, dt, open_dt_last, close_dt_last, this_amount_last, this_money_last, + id, client_id, amount, money, times, 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"> @@ -43,11 +44,11 @@ </delete> <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmClientAmountDay"> <!--@mbg.generated--> - insert into rm_client_amount_day (id, client_id, amount, money, + insert into rm_client_amount_day (id, client_id, amount, money, times, dt, open_dt_last, close_dt_last, this_amount_last, this_money_last, this_time_last, rtu_dt_last) - values (#{id,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT}, #{amount,jdbcType=FLOAT}, #{money,jdbcType=FLOAT}, + values (#{id,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT}, #{amount,jdbcType=FLOAT}, #{money,jdbcType=FLOAT}, #{times,jdbcType=FLOAT}, #{dt,jdbcType=DATE}, #{openDtLast,jdbcType=TIMESTAMP}, #{closeDtLast,jdbcType=TIMESTAMP}, #{thisAmountLast,jdbcType=FLOAT}, #{thisMoneyLast,jdbcType=FLOAT}, #{thisTimeLast,jdbcType=INTEGER}, #{rtuDtLast,jdbcType=TIMESTAMP}) @@ -67,6 +68,9 @@ </if> <if test="money != null"> money, + </if> + <if test="times != null"> + times, </if> <if test="dt != null"> dt, @@ -102,6 +106,9 @@ </if> <if test="money != null"> #{money,jdbcType=FLOAT}, + </if> + <if test="times != null"> + #{times,jdbcType=INTEGER}, </if> <if test="dt != null"> #{dt,jdbcType=DATE}, @@ -139,6 +146,9 @@ <if test="money != null"> money = #{money,jdbcType=FLOAT}, </if> + <if test="times != null"> + times = #{times,jdbcType=INTEGER}, + </if> <if test="dt != null"> dt = #{dt,jdbcType=DATE}, </if> @@ -169,6 +179,7 @@ set client_id = #{clientId,jdbcType=BIGINT}, amount = #{amount,jdbcType=FLOAT}, money = #{money,jdbcType=FLOAT}, + times = #{times,jdbcType=INTEGER}, dt = #{dt,jdbcType=DATE}, open_dt_last = #{openDtLast,jdbcType=TIMESTAMP}, close_dt_last = #{closeDtLast,jdbcType=TIMESTAMP}, @@ -178,4 +189,69 @@ 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 rcad + Left join se_client sc on sc.id = rcad.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 rcad.dt >= #{startDt,jdbcType=DATE} + </if> + <if test="endDt != null"> + and rcad.dt <= #{endDt,jdbcType=DATE} + </if> + </where> + </select> + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍--> + <select id="getClientAmountDayHistory" resultType="com.dy.pipIrrGlobal.voRm.VoClientAmountDay"> + select + CAST(rcad.client_id AS char)AS clientId, + rcad.amount as amount, + rcad.money as money, + rcad.times as times, + rcad.dt as dt, + rcad.open_dt_last as openDtLast, + rcad.close_dt_last as closeDtLast, + rcad.this_amount_last as thisAmountLast, + rcad.this_money_last as thisMoneyLast, + rcad.this_time_last as thisTimeLast, + rcad.rtu_dt_last as rtuDtLast, + sc.name as clientName + from rm_client_amount_day rcad + Left join se_client sc on sc.id = rcad.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 rcad.dt >= #{startDt,jdbcType=DATE} + </if> + <if test="endDt != null"> + and rcad.dt <= #{endDt,jdbcType=DATE} + </if> + </where> + ORDER BY rcad.id DESC + <if test="pageCurr != null and pageSize != null"> + LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} + </if> + </select> + + + <select id="statisticsByClient" resultType="com.dy.pipIrrGlobal.voSt.VoClientAmountStatistics"> + select client_id, sum(amount) as amount, sum(money) as money, sum(times) as times + from rm_client_amount_day + where id <![CDATA[>=]]> #{startId,jdbcType=BIGINT} and id <![CDATA[<]]> #{endId,jdbcType=BIGINT} + group by client_id + </select> + </mapper> \ No newline at end of file -- Gitblit v1.8.0