huliguo
2025-08-01 8059e9b991c15edbac508e6b658a0d9571d11b1c
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
39
40
41
42
<?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.ruoyi.member.mapper.birthday.BirthdayCardMapper">
 
    <select id="getPlatformBirthdayCard" resultType="com.ruoyi.system.api.domain.poji.member.BirthdayCard">
        SELECT *
        FROM t_birthday_card
        WHERE del_flag = 0 AND card_status = 1 AND shop_id = 0
            AND (shop_flag = 1 OR (shop_flag = 2 AND FIND_IN_SET(#{shopId}, applicable_shop) > 0))
    </select>
 
    <select id="getMerShopBirthdayCard" resultType="com.ruoyi.system.api.domain.poji.member.BirthdayCard">
        SELECT *
        FROM t_birthday_card
        WHERE del_flag = 0 AND card_status = 1
            AND shop_id = #{shopId}
    </select>
 
    <select id="pageAppMemberPrize" resultType="com.ruoyi.member.domain.vo.AppMemberPrizePageVo">
        SELECT prize_id      prizeId,
               CASE gift_type
                   WHEN 1 THEN CONCAT(coupon_name, "优惠券")
                   WHEN 2 THEN CONCAT(goods_name, "商品")
                   WHEN 4 THEN CONCAT(gift_name, "实物")
                   WHEN 3 THEN CONCAT("现金", money, "元")
                   WHEN 5 THEN CONCAT(integral_number, "积分")
                   END       prizeName,
               CASE prize_from
                   WHEN 1 THEN "生日卡"
                   ELSE "抽奖"
                   END       prizeFrom,
               verify_status verifyStatus,
               create_time   createTime,
               verify_time   verifyTime,
               shop_id       shopId,
               gift_type     gifttype
        FROM t_member_gift_record
        WHERE del_flag = 0
          AND user_id = #{userId}
        ORDER BY verify_status ASC,create_time desc
    </select>
</mapper>