zyy
2026-02-09 30e592bd0975b41e0b4b4140c4b794c2e1e121de
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?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.IntradayOrderMapper">
 
    <select id="conditionQuery" resultType="com.nq.pojo.IntradayOrder">
        SELECT
        o.*
        FROM
        intraday_order o
        LEFT JOIN user u ON o.user_id = u.id
        LEFT JOIN stock s ON s.id = o.stock_id
        <where>
            1=1
            <if test="userId != null and userId != ''">
                AND u.id = #{userId}
            </if>
            <if test="phone != null and phone != ''">
                AND u.phone = #{phone}
            </if>
            <if test="stockName != null and stockName != ''">
                AND s.stock_name LIKE CONCAT('%', #{stockName}, '%')
            </if>
            <if test="stockGid != null and stockGid != ''">
                AND s.stock_gid = #{stockGid}
            </if>
            <if test="status != null and status != '' ">
                AND o.audit_status = #{auditStatus}
            </if>
        </where>
        GROUP BY o.id
        ORDER BY o.created_at DESC
 
    </select>
</mapper>