Helius
2022-05-10 722f17e0fc6a1fbe709bd02bbb7c75b8da435e07
src/main/resources/mapper/modules/MallGoodsMapper.xml
@@ -77,6 +77,9 @@
                    <if test="record.isNormal != null and record.isNormal != ''">
                        and a.is_normal = #{record.isNormal}
                    </if>
                    <if test="record.goodsType != null and record.goodsType != ''">
                        and a.goods_type = #{record.goodsType}
                    </if>
                    <if test="record.categoryId != null and record.categoryId != ''">
                        and (c.id = #{record.categoryId} or c.parent_id=#{record.categoryId})
                    </if>
@@ -120,9 +123,10 @@
        a.original_price,
        a.present_price,
        a.is_hot,
        a.score,
        b.name categaryName,
        sum(c.sku_volume) skuVolume,
        sum(c.stock) stock
        IFNULL(sum(c.sku_volume), a.volume) skuVolume,
        IFNULL(sum(c.stock), a.stock) stock
        from mall_goods a
        left join mall_goods_category b on b.id = a.category_id
        left join mall_goods_sku c on c.goods_id = a.id
@@ -131,6 +135,9 @@
                <if test="record.goodsName != null and record.goodsName != ''">
                    and a.goods_name like CONCAT('%', CONCAT(#{record.goodsName}, '%'))
                </if>
                <if test="record.goodsType != null and record.goodsType != ''">
                    and a.goods_type=#{record.goodsType}
                </if>
            </if>
        </where>
        group by a.id