1
phpcjl
2024-12-20 d51a8cfa10c34d9c1e7d6b4726d31e75ecee5dc6
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>