<?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>
|