From c054148b591113869b25c7c2f9b323fe1e5d132d Mon Sep 17 00:00:00 2001
From: zyy <zyy@email.com>
Date: Tue, 29 Jul 2025 18:32:41 +0800
Subject: [PATCH] 持仓列表修改
---
src/main/resources/mapper/UserPositionMapper.xml | 19 +++++++++++--------
src/main/java/com/nq/pojo/User.java | 2 +-
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/main/java/com/nq/pojo/User.java b/src/main/java/com/nq/pojo/User.java
index 00dc1ab..9e41123 100644
--- a/src/main/java/com/nq/pojo/User.java
+++ b/src/main/java/com/nq/pojo/User.java
@@ -30,7 +30,7 @@
private String img1Key;
private String img2Key;
private String img3Key;
- //1.未实名 2.已实名 3.驳回
+ //注册默认0 1.提交未实名 2.已实名 3.驳回
private Integer isActive;
private String authMsg;
private String withdrawalPwd;
diff --git a/src/main/resources/mapper/UserPositionMapper.xml b/src/main/resources/mapper/UserPositionMapper.xml
index a052158..dc41545 100644
--- a/src/main/resources/mapper/UserPositionMapper.xml
+++ b/src/main/resources/mapper/UserPositionMapper.xml
@@ -547,6 +547,14 @@
FROM user_position
WHERE
user_id = #{uid}
+ <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>
UNION ALL
SELECT
p.id,
@@ -599,14 +607,6 @@
</if>
) a
WHERE a.position_type != 1
- <if test="state != null ">
- <if test="state == 0">
- and a.sell_order_id is null
- </if>
- <if test="state == 1">
- and a.sell_order_id is not null
- </if>
- </if>
<if test="stockCode != null and stockCode != '' ">
and a.stock_code like CONCAT('%','${stockCode}','%')
</if>
@@ -616,6 +616,9 @@
<if test="positionType != null">
and a.position_type = #{positionType}
</if>
+ <if test="stockType != null and stockType != '' ">
+ and a.stock_gid = #{stockType}
+ </if>
ORDER BY a.buy_order_time DESC
</select>
--
Gitblit v1.9.3