From 36e04e9e9cdcebd3305316c8d93d97d351d47f9d Mon Sep 17 00:00:00 2001
From: zyy <zyy@email.com>
Date: Sat, 15 Nov 2025 16:43:28 +0800
Subject: [PATCH] 委托成本
---
trading-order-service/src/main/resources/mapper/dz/StockDzMapper.xml | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 56 insertions(+), 3 deletions(-)
diff --git a/trading-order-service/src/main/resources/mapper/dz/StockDzMapper.xml b/trading-order-service/src/main/resources/mapper/dz/StockDzMapper.xml
index 826b2d6..2c81989 100644
--- a/trading-order-service/src/main/resources/mapper/dz/StockDzMapper.xml
+++ b/trading-order-service/src/main/resources/mapper/dz/StockDzMapper.xml
@@ -3,15 +3,22 @@
<mapper namespace="com.yami.trading.dao.dz.StockDzMapper">
- <select id="findStockTypeDz" resultType="com.yami.trading.bean.dz.StockDz" parameterType="map">
+ <select id="findStockTypeDz" resultType="com.yami.trading.bean.dz.dto.StockDzDto" parameterType="map">
SELECT
*
FROM t_stock_dz
WHERE start_time < #{formatDate} AND end_time > #{formatDate}
+ <if test="stockType != null and stockType != '' ">
+ AND stock_type = #{stockType}
+ </if>
+
<if test="keyWords != null and keyWords != '' ">
- AND (stock_spell LIKE #{keyWords} OR stock_name LIKE #{keyWords})
+ AND (
+ stock_spell LIKE CONCAT('%', #{keyWords}, '%')
+ OR stock_name LIKE CONCAT('%', #{keyWords}, '%')
+ )
</if>
<if test="orderBy != null">
@@ -30,10 +37,56 @@
*
FROM t_stock_dz
WHERE 1=1
+ <if test="stockType != null and stockType != '' ">
+ AND stock_type = #{stockType}
+ </if>
<if test="keyWords != null and keyWords != '' ">
- AND (stock_code LIKE #{keyWords} OR stock_name LIKE #{keyWords})
+ AND (
+ stock_code LIKE CONCAT('%', #{keyWords}, '%')
+ OR stock_name LIKE CONCAT('%', #{keyWords}, '%')
+ )
</if>
ORDER BY add_time DESC
</select>
+ <select id="getDzOrderList" resultType="com.yami.trading.bean.dz.dto.ExchangeApplyOrderDzDto" parameterType="map">
+ SELECT
+ t.*,s.stock_name
+ FROM t_exchange_apply_order_dz t
+ LEFT JOIN t_stock_dz s ON t.dz_id=s.uuid
+ WHERE 1=1
+ <if test="stockType != null and stockType != '' ">
+ AND s.stock_type = #{stockType}
+ </if>
+ <if test="state != null and state != ''">
+ AND t.state = #{state}
+ </if>
+ <if test="state == null">
+ AND t.state != 'position'
+ </if>
+ <if test="userId != null and userId != '' ">
+ AND t.party_id = #{userId}
+ </if>
+ ORDER BY t.create_time DESC
+ </select>
+
+ <select id="getDzCheckList" resultType="com.yami.trading.bean.dz.dto.ExchangeApplyOrderDzDto" parameterType="map">
+ SELECT
+ t.*,u.user_name,u.user_code,s.stock_name
+ FROM t_exchange_apply_order_dz t
+ LEFT JOIN tz_user u ON t.party_id = u.user_id
+ LEFT JOIN t_stock_dz s ON s.uuid = t.dz_id
+ WHERE 1=1
+ <if test="state != null and state != ''">
+ AND t.state = #{state}
+ </if>
+ <if test="stockCode != null and stockCode != '' ">
+ AND t.symbol LIKE CONCAT('%', #{stockCode}, '%')
+ </if>
+ <if test="stockType != null and stockType != '' ">
+ AND s.stock_type = #{stockType}
+ </if>
+ ORDER BY t.create_time DESC
+ </select>
+
</mapper>
--
Gitblit v1.9.3