xiaoyong931011
2022-09-24 aa2885980b4b6aeb309aab9762a6220e903b498a
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
37
38
<?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="cc.mrbird.febs.mall.mapper.MallActLuckdrawRecordMapper">
 
    <select id="selectMallActLuckdrawsInPage" resultType="cc.mrbird.febs.mall.vo.AdminMallActLuckdrawRecordVo">
        select
        a.*,
        b.name,
        b.phone
        from mall_act_luckdraw_record a
        left join mall_member b on a.member_id = b.id
        <where>
            <if test="record != null">
                <if test="record.name != null and record.name != ''">
                    and b.name like CONCAT('%', CONCAT(#{record.name}, '%'))
                </if>
                <if test="record.account!=null and record.account!=''">
                    and (
                    b.phone like concat('%',  #{record.account},'%')
                    or b.email like concat('%',  #{record.account},'%')
                    or b.bind_phone like concat('%',  #{record.account},'%')
                    or b.invite_id like concat('%',  #{record.account},'%')
                    )
                </if>
            </if>
        </where>
        order by a.created_time desc
    </select>
 
    <select id="selectRecordByMemberIdAndActId" resultType="cc.mrbird.febs.mall.entity.MallActLuckdrawRecord">
        select
        a.*
        from mall_act_luckdraw_record a
        where a.member_id = #{memberId} and a.act_id = #{actId}
        order by a.created_time desc limit 0,10
    </select>
 
</mapper>