<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.yami.trading.dao.dz.StockDzMapper">
|
|
|
<select id="findStockTypeDz" resultType="com.yami.trading.bean.dz.StockDz" 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})
|
</if>
|
|
<if test="orderBy != null">
|
ORDER BY increase_ratio
|
<if test="orderBy == 'desc'">
|
DESC
|
</if>
|
<if test="orderBy == 'asc'">
|
ASC
|
</if>
|
</if>
|
</select>
|
|
<select id="getDzListByAdmin" resultType="java.util.HashMap" parameterType="map">
|
SELECT
|
*
|
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})
|
</if>
|
ORDER BY add_time DESC
|
</select>
|
|
<select id="getDzOrderList" resultType="com.yami.trading.bean.dz.ExchangeApplyOrderDz" parameterType="map">
|
SELECT
|
t.*
|
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="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 = #{stockCode}
|
</if>
|
<if test="stockType != null and stockType != '' ">
|
AND s.stock_type = #{stockType}
|
</if>
|
ORDER BY t.create_time DESC
|
</select>
|
|
</mapper>
|