From 7c2ba7fb149b8ebf5f28c45d88eb3abffb7c14da Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Sat, 14 Sep 2024 12:02:27 +0800
Subject: [PATCH] 1
---
src/main/resources/mapper/UserPositionMapper.xml | 53 +++++++++++++++++++++++++++++++----------------------
1 files changed, 31 insertions(+), 22 deletions(-)
diff --git a/src/main/resources/mapper/UserPositionMapper.xml b/src/main/resources/mapper/UserPositionMapper.xml
index 1351a56..297730d 100644
--- a/src/main/resources/mapper/UserPositionMapper.xml
+++ b/src/main/resources/mapper/UserPositionMapper.xml
@@ -454,9 +454,9 @@
<if test="stockSpell != null and stockSpell != '' ">
and stock_spell like CONCAT('%','${stockSpell}','%')
</if>
- <if test="stockType != null and stockType!= ''">
- and stock_gid = #{stockType}
- </if>
+<!-- <if test="stockType != null and stockType!= ''">-->
+<!-- and stock_gid = #{stockType}-->
+<!-- </if>-->
</where>
@@ -485,31 +485,40 @@
<include refid="Base_Column_List"/>
FROM user_position
<where>
- <if test="searchId != null ">
- and agent_id = #{searchId}
+ 1=1
+ <if test="ids != null and ids.size > 0">
+ AND agent_id IN
+ <foreach item="id" collection="ids" open="(" separator="," close=")">
+ #{id}
+ </foreach>
</if>
- <if test="state != null ">
- <if test="state == 0">
- and sell_order_id is null
- </if>
- <if test="state == 1">
- and sell_order_id is not null
- </if>
+ <if test="state != null">
+ <choose>
+ <when test="state == 0">
+ AND sell_order_id IS NULL
+ </when>
+ <when test="state == 1">
+ AND sell_order_id IS NOT NULL
+ </when>
+ </choose>
</if>
- <if test="userId != null and userId != '' ">
- and user_id = #{userId}
+ <if test="userId != null and userId != ''">
+ AND user_id = #{userId}
</if>
- <if test="positionSn != null and positionSn != '' ">
- and position_sn like CONCAT('%','${positionSn}','%')
+ <if test="positionSn != null and positionSn != ''">
+ AND position_sn LIKE CONCAT('%', #{positionSn}, '%')
</if>
- <if test="positionType != null ">
- and position_type = #{positionType}
+ <if test="positionType != null and positionType != ''">
+ AND position_type = #{positionType}
</if>
- <if test="beginTime != null ">
- and sell_order_time <![CDATA[>=]]> #{beginTime}
+ <if test="beginTime != null and beginTime != ''">
+ AND sell_order_time <![CDATA[>=]]> #{beginTime}
</if>
- <if test="endTime != null ">
- and sell_order_time <![CDATA[<=]]> #{endTime}
+ <if test="endTime != null and endTime != ''">
+ AND sell_order_time <![CDATA[<=]]> #{endTime}
+ </if>
+ <if test="phone != null and phone != ''">
+ AND user_id = (SELECT id FROM user WHERE phone = #{phone})
</if>
</where>
ORDER BY id DESC
--
Gitblit v1.9.3