<?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() AND tsai.del_flag = 0
|
<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} AND tsai.del_flag = 0
|
</select>
|
<select id="querySeckillActivity" resultType="com.ruoyi.other.vo.SeckillActivityVO">
|
SELECT
|
tsai.id,
|
tg.`name` goodsName,
|
tg.introduction,
|
tgc.`name` goodsCategoryName,
|
tg.operating_cost,
|
tg.shop_cost,
|
tg.purchase_limit maxNum,
|
tg.home_page_picture,
|
tg.original_price,
|
tg.sale_num,
|
tg.`type` goodsType,
|
tsai.start_time,
|
tsai.end_time,
|
tsai.is_shelves showStatus
|
FROM
|
t_seckill_activity_info tsai
|
LEFT JOIN t_goods tg ON tsai.good_id = tg.id
|
LEFT JOIN t_goods_category tgc ON tgc.id = tg.goods_category_id
|
WHERE tsai.del_flag = 0
|
<if test="goods.name != null and goods.name != ''">
|
AND tg.`name` LIKE concat('%',#{goods.name},'%')
|
</if>
|
<if test="goods.goodsCategoryId != null">
|
AND tg.goods_category_id = #{goods.goodsCategoryId}
|
</if>
|
<if test="goods.categoryName != null and goods.categoryName != ''">
|
AND tgc.name = #{goods.categoryName}
|
</if>
|
<if test="goods.showStatus != null">
|
AND tsai.is_shelves = #{goods.showStatus}
|
</if>
|
|
<if test="goods.type != null">
|
AND tg.type = #{goods.type}
|
</if>
|
|
<if test="goods.status != null and goods.status ==1">
|
AND tsai.start_time <![CDATA[>]]> NOW()
|
</if>
|
|
<if test="goods.status != null and goods.status ==2">
|
AND tsai.start_time <![CDATA[<=]]> NOW() AND tsai.end_time <![CDATA[>]]> NOW()
|
</if>
|
|
<if test="goods.status != null and goods.status ==3">
|
AND tsai.end_time <![CDATA[<]]> NOW()
|
</if>
|
|
<if test="goods.vipId != null">
|
AND find_in_set(#{goods.vipId},tgs.vip) > 0
|
</if>
|
</select>
|
</mapper>
|