From ff812a4f923da2dea4c883f4e34e2ce928c76d99 Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Tue, 24 Sep 2024 14:57:18 +0800
Subject: [PATCH] 1

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

diff --git a/src/main/resources/mapper/UserPositionMapper.xml b/src/main/resources/mapper/UserPositionMapper.xml
index f96e1da..7ea7077 100644
--- a/src/main/resources/mapper/UserPositionMapper.xml
+++ b/src/main/resources/mapper/UserPositionMapper.xml
@@ -44,7 +44,7 @@
     id, position_type, position_sn, user_id, nick_name, agent_id, stock_name, stock_code, 
     stock_gid, stock_spell, buy_order_id, buy_order_time, buy_order_price, sell_order_id, 
     sell_order_time, sell_order_price, profit_target_price, stop_target_price, order_direction, 
-    order_num, order_lever, order_total_price, order_fee, order_spread, order_stay_fee, 
+    order_num, order_lever, order_total_price, order_fee, order_spread, order_stay_fee,
     order_stay_days, profit_and_lose, all_profit_and_lose,is_lock,lock_msg,stock_plate,spread_rate_price,margin_add
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
@@ -65,7 +65,7 @@
       buy_order_price, sell_order_id, sell_order_time, 
       sell_order_price, profit_target_price, stop_target_price, 
       order_direction, order_num, order_lever, 
-      order_total_price, order_fee, order_spread, 
+      order_total_price, order_fee, order_spread,
       order_stay_fee, order_stay_days, profit_and_lose, 
       all_profit_and_lose, is_lock, lock_msg,stock_plate,spread_rate_price)
     values (#{id,jdbcType=INTEGER}, #{positionType,jdbcType=INTEGER}, #{positionSn,jdbcType=VARCHAR}, 
@@ -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,7 +485,7 @@
     <include refid="Base_Column_List"/>
     FROM user_position
     <where>
-      <if test="searchId != null  ">
+      <if test="searchId != null  and searchId != '' ">
         and agent_id = #{searchId}
       </if>
       <if test="state != null  ">
@@ -502,15 +502,19 @@
       <if test="positionSn != null and positionSn != '' ">
         and position_sn like CONCAT('%','${positionSn}','%')
       </if>
-      <if test="positionType != null ">
+      <if test="positionType != null and positionType != ''">
         and position_type = #{positionType}
       </if>
-      <if test="beginTime != null ">
+      <if test="beginTime != null and beginTime != ''">
         and sell_order_time <![CDATA[>=]]> #{beginTime}
       </if>
-      <if test="endTime != null ">
+      <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
   </select>
@@ -603,5 +607,7 @@
     limit 1
   </select>
 
+
+
 </mapper>
 

--
Gitblit v1.9.3