From d4c8e72800fcf6fbaa3804d383c7b6a23f826f3e Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 20 八月 2025 14:35:00 +0800
Subject: [PATCH] 修改bug
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/StClientAmountDayMapper.xml | 77 +++++++++++++++++++++++++++-----------
1 files changed, 55 insertions(+), 22 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/StClientAmountDayMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/StClientAmountDayMapper.xml
index 4bd6635..3f0d939 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/StClientAmountDayMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/StClientAmountDayMapper.xml
@@ -117,7 +117,6 @@
times30, amount31, money31, times31
</sql>
<sql id="Base_Column_List_with_alias">
- <!--@mbg.generated-->
${alias}.id, ${alias}.client_id, ${alias}.`year`, ${alias}.`month`, ${alias}.amount1, ${alias}.money1, ${alias}.times1, ${alias}.amount2, ${alias}.money2, ${alias}.times2,
${alias}.amount3, ${alias}.money3, ${alias}.times3, ${alias}.amount4, ${alias}.money4, ${alias}.times4, ${alias}.amount5, ${alias}.money5, ${alias}.times5, ${alias}.amount6,
${alias}.money6, ${alias}.times6, ${alias}.amount7, ${alias}.money7, ${alias}.times7, ${alias}.amount8, ${alias}.money8, ${alias}.times8, ${alias}.amount9, ${alias}.money9,
@@ -1207,35 +1206,25 @@
select
count(*)
from se_client mtb
- <where>
+ where mtb.deleted != 1
+ <trim prefix="and" suffixOverrides="and">
<if test="name != null and name != ''">
mtb.name like concat('%', #{name}, '%')
</if>
- </where>
+ </trim>
</select>
- <select id="selectDayStatistics" resultType="com.dy.pipIrrGlobal.voSt.VoStClientAmountDay">
+ <select id="selectClientIds4DayStatistics" resultType="com.dy.pipIrrGlobal.voSt.VoStClientIdAmountYearRecord">
select
- mtb.clientNum as clientNum,
- mtb.phone as clientPhone,
- mtb.address as clientAddress,
- <include refid="Base_Column_List_with_alias" >
- <property name="alias" value="stTb"/>
- </include>
+ mtb.id as clientId
from se_client mtb
- LEFT JOIN st_client_amount_day stTb on stTb.client_id = mtb.id
- <where>
- <if test = "year != null">
- stTb.year = #{year, jdbcType=INTEGER}
- </if>
- <if test = "month != null">
- AND stTb.month = #{month, jdbcType=INTEGER}
- </if>
+ where mtb.deleted != 1
+ <trim prefix="and" suffixOverrides="and">
<if test="name != null and name != ''">
- AND mtb.name like concat('%', #{name}, '%')
+ mtb.name like concat('%', #{name}, '%')
</if>
- </where>
- order by mtb.id ASC
+ </trim>
+ order by mtb.id DESC
<trim prefix="limit " >
<if test="start != null and count != null">
#{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
@@ -1243,7 +1232,51 @@
</trim>
</select>
- <!-- ////////////////////////////////// -->
+
+ <select id="selectDayStatistics" resultType="com.dy.pipIrrGlobal.voSt.VoStClientAmountDay">
+ select
+ mtb.id as clientId,
+ mtb.clientNum as clientNum,
+ mtb.name as clientName,
+ mtb.address as clientAddress,
+ <include refid="Base_Column_List_with_alias" >
+ <property name="alias" value="stTb"/>
+ </include>
+ from se_client mtb
+ <if test="clientIdsJson != null and clientIdsJson !=''">
+ INNER JOIN JSON_TABLE(
+ <!--'[{"clientId":"37142501020100215"},{"clientId":"37142501020100215"}]'-->
+ #{clientIdsJson},
+ '$[*]' COLUMNS (
+ clientId BIGINT PATH '$.clientId'
+ )
+ ) clientIdTb ON clientIdTb.clientId = mtb.id
+ </if>
+ LEFT JOIN
+ (
+ select *
+ from st_client_amount_day
+ <where>
+ <if test="year != null">
+ `year` = #{year,jdbcType=INTEGER}
+ </if>
+ <if test = "month != null">
+ AND month = #{month, jdbcType=INTEGER}
+ </if>
+ </where>
+ ) as stTb on stTb.client_id = mtb.id
+ where mtb.deleted != 1
+ order by mtb.id DESC
+ <!-- 2025-07-14 鍥犱负鏈塩lientIdsJson闄愬埗浜嗘暟閲忥紝鎵�浠ヤ笉鍐嶇敤limit浜�
+ <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="statisticsByClient" resultType="com.dy.pipIrrGlobal.voSt.VoClientAmountStatistics">
--
Gitblit v1.8.0