puzhibing
2024-12-09 609d91e1e62b1e8932b34b15b09baf02e7f09a93
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
43
44
45
46
47
48
49
<?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.other.mapper.SeckillActivityInfoMapper">
 
    <select id="listSeckillActivity" resultType="com.ruoyi.other.vo.SeckillActivityVO">
        SELECT
            tsai.id,
            tg.`name`,
            tg.introduction,
            tg.home_page_picture,
            tg.original_price,
            tgs.selling_price,
            tg.sale_num,
            tsai.start_time
        FROM
            t_seckill_activity_info tsai
                LEFT JOIN t_goods tg ON tsai.good_id = tg.id
                LEFT JOIN t_goods_seckill tgs ON tgs.seckill_activity_info_id = tsai.id
        WHERE tsai.end_time >= NOW()
        <if test="name != null and name != ''">
            AND tg.`name` LIKE concat('%',#{goodsName},'%')
        </if>
        <if test="goodsCategoryId != null">
            AND tg.goods_category_id = #{goodsCategoryId}
        </if>
        <if test="vipId != null">
            AND find_in_set(#{vipId},tgs.vip) > 0
        </if>
    </select>
    <select id="selectDetail" resultType="com.ruoyi.other.vo.SeckillActivityDetailVO">
        SELECT
            tsai.id,
            tg.`name`,
            tg.introduction,
            tg.home_page_picture,
            tg.original_price,
            tgs.selling_price,
            tg.sale_num,
            tsai.start_time,
            tg.detail_picture,
            tsal.end_time,
            tg.detail
        FROM
            t_seckill_activity_info tsai
                LEFT JOIN t_goods tg ON tsai.good_id = tg.id
                LEFT JOIN t_goods_seckill tgs ON tgs.seckill_activity_info_id = tsai.id
        WHERE tsai.id = #{seckillActivityId}
    </select>
</mapper>