From 57c2b6875b5f026a1432f3209471d6b4503f43fc Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Tue, 29 Oct 2024 13:35:05 +0800
Subject: [PATCH] 1

---
 src/main/resources/mapper/UserPositionMapper.xml |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/main/resources/mapper/UserPositionMapper.xml b/src/main/resources/mapper/UserPositionMapper.xml
index 7ea7077..a50f9bb 100644
--- a/src/main/resources/mapper/UserPositionMapper.xml
+++ b/src/main/resources/mapper/UserPositionMapper.xml
@@ -436,27 +436,26 @@
 
   <select id="findMyPositionByCodeAndSpell" parameterType="map" resultMap="BaseResultMap">
     SELECT
-    <include refid="Base_Column_List"/>
-    FROM user_position
+    u.*
+    FROM user_position u  left join stock s on u.stock_code = s.stock_code
     <where>
-      user_id = #{uid}
+      u.user_id = #{uid}
+    and s.stock_type = #{stockType}
       <if test="state != null ">
         <if test="state == 0">
-          and sell_order_id is null
+          and u.sell_order_id is null
         </if>
         <if test="state == 1">
-          and sell_order_id is not null
+          and u.sell_order_id is not null
         </if>
       </if>
       <if test="stockCode != null and stockCode != '' ">
-        and stock_code like CONCAT('%','${stockCode}','%')
+        and u.stock_code like CONCAT('%','${stockCode}','%')
       </if>
       <if test="stockSpell != null and stockSpell != '' ">
-        and stock_spell like CONCAT('%','${stockSpell}','%')
+        and u.stock_spell like CONCAT('%','${stockSpell}','%')
       </if>
-<!--      <if test="stockType != null and stockType!= ''">-->
-<!--        and stock_gid = #{stockType}-->
-<!--      </if>-->
+
 
 
     </where>

--
Gitblit v1.9.3