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
25
26
27
28
29
30
31
32
33
34
35
<?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.GoodsBargainPriceMapper">
 
    <select id="queryGoodsBargainPricePage" resultType="com.ruoyi.other.api.domain.GoodsBargainPrice">
        SELECT
            tgbp.*,
            tg.`name` AS goodsName,
            tgc.`name` AS categoryName,
            ts.`name` AS shop_name,
            ts.shop_manager AS ownerName,
            ts.phone AS ownerPhone
        FROM
            t_goods_bargain_price tgbp
                INNER JOIN t_goods tg ON tgbp.goods_id = tg.id and tg.del_flag = 0
                INNER JOIN t_shop ts ON tgbp.shop_id = ts.id and tg.del_flag = 0
                LEFT JOIN t_goods_category tgc ON tg.goods_category_id = tgc.id
        where tgbp.del_flag = 0
        <if test="gp.goodsId != null">
            and tgbp.goods_id = #{gp.goodsId}
        </if>
        <if test="gp.goodsName != null and gp.goodsName != ''">
            and tg.`name` like concat('%',#{gp.goodsName},'%')
        </if>
        <if test="gp.goodsType != null and gp.goodsType != ''">
            and tg.`type` = #{gp.goodsType}
        </if>
        <if test="gp.categoryId != null and gp.categoryId != ''">
            and tg.goods_category_id = #{gp.categoryId}
        </if>
        <if test="gp.auditStatus != null and gp.auditStatus != ''">
            and tgbp.audit_status = #{gp.auditStatus}
        </if>
    </select>
</mapper>