Pu Zhibing
2025-04-22 fd7b8fb7c89832c28a838b0449bbb8a392433ee2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?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.GoodsShopMapper">
 
    <select id="getShopGoodsList" resultType="com.ruoyi.other.vo.ShopGoodsList">
        select
            a.id,
            a.name,
            b.name as goodsCategory
        from t_goods a
        left join t_goods_category b on (a.goods_category_id = b.id)
        where a.type = 1 and a.del_flag = 0 and a.status = 2 and (a.appoint_store = 2 or a.id in (select goods_id from t_goods_shop where shop_id = #{shopId}))
        <if test="null != goodsId and '' != goodsId">
            and a.id like CONCAT('%', #{goodsId}, '%')
        </if>
        <if test="null != goodsName and '' != goodsName">
            and a.name like CONCAT('%', #{goodsName}, '%')
        </if>
        <if test="null != goodsCategoryId">
            and a.goods_category_id = #{goodsCategoryId}
        </if>
        order by a.create_time desc
    </select>
</mapper>