<?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="cc.mrbird.febs.dapp.mapper.MallGoodsMapper">
|
|
<select id="selectMallGoodsInPage" resultType="cc.mrbird.febs.dapp.entity.MallGoods">
|
select
|
a.*,
|
b.name categoryName
|
from mall_goods a
|
left join mall_goods_category b on a.category_id = b.id
|
<where>
|
<if test="record != null">
|
<if test="record.goodsName != null and record.goodsName != ''">
|
and a.goods_name like CONCAT('%', CONCAT(#{record.goodsName}, '%'))
|
</if>
|
</if>
|
</where>
|
group by a.id
|
order by a.sort_cnt asc
|
</select>
|
|
<select id="selectMallGoodsCountByGoodsName" resultType="java.lang.Integer">
|
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="selectGoodsStockAndVolume" resultType="java.util.HashMap">
|
select
|
sum(stock) stock,
|
sum(sku_volume) volume
|
from mall_goods_sku
|
where goods_id=#{id}
|
</select>
|
|
<select id="selectOrderListInPage" resultType="cc.mrbird.febs.dapp.entity.MallOrderInfo">
|
select a.*,
|
b.address address,
|
c.goods_name
|
from mall_order_item c
|
left join mall_order_info a on a.id = c.order_id
|
left join dapp_member b on a.member_id = b.id
|
<where>
|
<if test="record != null">
|
<if test="record.goodsName != null and record.goodsName != ''">
|
and c.goods_name like CONCAT('%', CONCAT(#{record.goodsName}, '%'))
|
</if>
|
<if test="record.payResult != null and record.payResult != ''">
|
and a.pay_result = #{record.payResult}
|
</if>
|
<if test="record.orderType != null">
|
and a.order_type = #{record.orderType}
|
</if>
|
<if test="record.status != null and record.status != ''">
|
and a.status = #{record.status}
|
</if>
|
<if test="record.orderNo != null and record.orderNo != ''">
|
and a.order_no like CONCAT('%', CONCAT(#{record.orderNo}, '%'))
|
</if>
|
<if test="record.name != null and record.name != ''">
|
and b.address like CONCAT('%', CONCAT(#{record.name}, '%'))
|
</if>
|
<if test="record.startTime != null and record.startTime != ''">
|
and a.order_time >= #{record.startTime}
|
</if>
|
<if test="record.endTime != null and record.endTime != ''">
|
and a.order_time <= #{record.endTime}
|
</if>
|
</if>
|
</where>
|
order by a.create_time desc
|
</select>
|
|
<select id="selectMallGoodsByCategaryId" resultType="cc.mrbird.febs.dapp.entity.MallGoods">
|
select * from mall_goods a where a.category_id = #{categaryId}
|
</select>
|
|
<select id="getMallOrderInfoById" resultType="cc.mrbird.febs.dapp.vo.AdminMallOrderVo">
|
select b.* from mall_address_info b
|
where b.id = (select a.address_id from mall_order_info a where a.id = #{id})
|
</select>
|
|
</mapper>
|