zyy
2025-12-09 0f97f4a40b557b8083575f7138cb48c3c2ce9a0d
trading-order-service/src/main/resources/mapper/dz/StockDzMapper.xml
@@ -3,7 +3,7 @@
<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
@@ -15,7 +15,10 @@
        </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">
@@ -38,14 +41,17 @@
            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.ExchangeApplyOrderDz" parameterType="map">
    <select id="getDzOrderList" resultType="com.yami.trading.bean.dz.dto.ExchangeApplyOrderDzDto" parameterType="map">
        SELECT
        t.*
        t.*,s.stock_name,s.day_rate,s.period
        FROM t_exchange_apply_order_dz t
        LEFT JOIN t_stock_dz s ON t.dz_id=s.uuid
        WHERE 1=1
@@ -55,6 +61,9 @@
        <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>
@@ -63,20 +72,29 @@
    <select id="getDzCheckList" resultType="com.yami.trading.bean.dz.dto.ExchangeApplyOrderDzDto" parameterType="map">
        SELECT
        t.*,u.user_name,u.user_code,s.stock_name
        t.*,u.user_name,u.user_code,s.stock_name,r.user_name AS 'recomUserName'
        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
        LEFT JOIN tz_user r ON u.user_recom = r.user_id
        WHERE 1=1
        <if test="state != null and state != ''">
            AND t.state = #{state}
        </if>
        <if test="stockCode != null and stockCode != '' ">
            AND t.symbol = #{stockCode}
            AND t.symbol LIKE CONCAT('%', #{stockCode}, '%')
        </if>
        <if test="stockType != null and stockType != '' ">
            AND s.stock_type = #{stockType}
        </if>
        <if test="checkedList!=null">
            and u.user_id in
            <foreach collection="checkedList" separator="," index="index" open="(" close=")" item="r">
                #{r}
            </foreach>
        </if>
        ORDER BY  t.create_time DESC
    </select>