<?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.GoodsMapper">
|
|
<select id="selectListByShopId" resultType="com.ruoyi.other.api.domain.Goods">
|
SELECT
|
tg.id,
|
tg.`name`,
|
tg.type,
|
tg.introduction,
|
tg.selling_price,
|
tg.original_price,
|
tg.sale_num,
|
tg.home_page_picture
|
FROM
|
t_shop ts
|
LEFT JOIN t_goods_shop tgs ON ts.id = tgs.shop_id
|
LEFT JOIN t_goods tg ON tg.id = tgs.goods_id
|
where ts.id = #{shopId} and ts.del_flag = 0
|
<if test="vip != null">
|
and FIND_IN_SET(#{vip}, commodity_authority) > 0
|
</if>
|
ORDER BY tg.sale_num DESC
|
</select>
|
<select id="selectManageGoodsList" resultType="com.ruoyi.other.api.domain.Goods">
|
SELECT
|
tg.id,
|
tg.`name`,
|
tg.type,
|
tg.goods_category_id,
|
tgc.`name`,
|
tg.operating_cost,
|
tg.shop_cost,
|
tg.`status`
|
FROM
|
t_goods tg
|
LEFT JOIN t_goods_category tgc ON tg.goods_category_id = tgc.id
|
<where>
|
tg.del_flag = 0
|
<if test="goods.id != null">
|
<if test="goods.id != null">
|
and tg.id = #{goods.id}
|
</if>
|
<if test="goods.name != null and goods.name != ''">
|
and tg.`name` like concat('%',#{goods.name},'%')
|
</if>
|
<if test="goods.type != null">
|
and tg.type = #{goods.type}
|
</if>
|
<if test="goods.goodsCategoryId != null">
|
and tg.goodsCategoryId = #{goods.goodsCategoryId}
|
</if>
|
<if test="goods.status != null">
|
and tg.`status` = #{goods.status}
|
</if>
|
</if>
|
</where>
|
</select>
|
</mapper>
|