| | |
| | | <if test="record.isHot != null and record.isHot != ''"> |
| | | and a.is_hot = 1 |
| | | </if> |
| | | <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> |
| | |
| | | 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 |
| | |
| | | <if test="record != null"> |
| | | <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> |
| | |
| | | select count(id) from mall_goods a where a.goods_name = #{goodsName} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="selectMallGoodsCountByGoodsNameAndGoodId" resultType="java.lang.Integer"> |
| | | select count(id) from mall_goods a where a.goods_name = #{goodsName} and a.id != #{id} |
| | | </select> |
| | | |
| | | <select id="selectMallGoodsCountByGoodsNo" resultType="java.lang.Integer"> |
| | | select count(id) from mall_goods a where a.goods_no = #{goodsNo} |
| | | </select> |
| | | |
| | | <select id="selectMallGoodsCountByGoodsNoAndGoodId" resultType="java.lang.Integer"> |
| | | select count(id) from mall_goods a where a.goods_no = #{goodsNo} and a.id != #{id} |
| | | </select> |
| | | |
| | | <select id="selectMallGoodsInfoById" resultType="cc.mrbird.febs.mall.vo.AdminMailGoodsDetailVo"> |
| | |
| | | <select id="selectMallGoodsByCategaryId" resultType="cc.mrbird.febs.mall.entity.MallGoods"> |
| | | select * from mall_goods a where a.category_id = #{categaryId} |
| | | </select> |
| | | |
| | | <select id="getMallGoodsUpdateInfoById" resultType="cc.mrbird.febs.mall.vo.AdminMailGoodsUpdateVo"> |
| | | select * from mall_goods a where a.id = #{id} |
| | | </select> |
| | | |
| | | <select id="getAllGoodsTree" resultType="cc.mrbird.febs.mall.vo.AdminMallGoodsTreeVo"> |
| | | select |
| | | a.id goodsId, |
| | | a.goods_name goodsName |
| | | from mall_goods a |
| | | </select> |
| | | </mapper> |