<?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.nq.dao.StockAiOrderMapper" >
|
|
<sql id="Base_Column_List" >
|
id, user_id, stock_ai_id, buy_date, buy_amount, remain_amount, real_earning, status, audit_date
|
</sql>
|
|
<select id="getAdminStockAiOrderList" resultType="com.nq.vo.stock.ai.StockAiOrderVO">
|
SELECT s.id, user_id, stock_ai_id, buy_date, buy_amount, remain_amount, real_earning, s.status, audit_date,
|
phone, real_name, stock_name, success_rate, expected_earning, cycle, a.stock_type
|
FROM stock_ai_order s
|
LEFT JOIN user u ON u.id = s.user_id
|
LEFT JOIN stock_ai a ON a.id = s.stock_ai_id
|
<where>
|
<if test="stockType != null and stockType != ''">
|
and a.stock_type = #{stockType}
|
</if>
|
<if test="status != null and status != ''">
|
and s.status = #{status}
|
</if>
|
<if test="userId != null">
|
and u.id = #{userId}
|
</if>
|
<if test="phone != null and phone != ''">
|
and u.phone like concat('%',#{phone},'%')
|
</if>
|
</where>
|
ORDER BY buy_date DESC
|
</select>
|
|
<select id="getStockAiOrderList" resultType="com.nq.vo.stock.ai.StockAiOrderTypeVO">
|
SELECT s.id, user_id, stock_ai_id, buy_date, buy_amount, remain_amount, real_earning, s.status, audit_date,
|
a.stock_name, a.stock_type
|
FROM stock_ai_order s
|
LEFT JOIN stock_ai a ON a.id = s.stock_ai_id
|
<where>
|
<if test="status != null and status != ''">
|
and s.status = #{status}
|
</if>
|
<if test="userId != null">
|
and user_id = #{userId}
|
</if>
|
</where>
|
ORDER BY buy_date DESC
|
</select>
|
|
</mapper>
|