xiaoyong931011
2021-04-23 d4488a987cccd3ddd51a202a9f8aa71d3cdcbced
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
36
<?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.xcong.excoin.modules.contract.mapper.ContractHoldOrderMapper">
 
    <select id="selectHoldListInPage" resultType="com.xcong.excoin.modules.contract.entity.ContractHoldOrderEntity">
        select *
        from contract_hold_order a
        inner join member b on a.member_id=b.id
        <where>
            <if test="record != null">
                <if test="record.inviteId!=null and record.inviteId!=''">
                    and find_in_set(#{record.inviteId}, b.referer_ids)
                </if>
                <if test="record.symbol!=null and record.symbol!=''">
                    and symbol=#{record.symbol}
                </if>
                <if test="record.openType!=null and record.openType!=''">
                    and opening_type=#{record.openType}
                </if>
                <if test='record.timeType=="1"'>
                    and TO_DAYS(a.create_time) = TO_DAYS(NOW())
                </if>
                <if test='record.timeType=="2"'>
                    and TO_DAYS(NOW()) - TO_DAYS(a.create_time) = 1
                </if>
                <if test='record.timeType=="3"'>
                    and YEARWEEK(date_format(a.create_time,'%Y-%m-%d')) = YEARWEEK(now())
                </if>
                <if test='record.timeType=="4"'>
                    and DATE_FORMAT(a.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE() , '%Y%m' )
                </if>
            </if>
        </where>
        order by a.create_time desc
    </select>
</mapper>