修改库存
This commit is contained in:
@@ -65,11 +65,24 @@
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<select id="selectAllByShop" resultType="com.chaozhanggui.system.cashierservice.entity.po.OrderPo">
|
||||
select toi.created_at as createAt,toi.id,toi.order_no as orderNo,toi.order_amount as orderAmount,count(*) as
|
||||
productNum,toi.order_type as orderType,
|
||||
ifnull(TRIM(TRAILING ', ' FROM GROUP_CONCAT(tod.product_name ORDER BY tod.id SEPARATOR ', ')),'') AS productName,
|
||||
toi.status from tb_order_info toi left join tb_order_detail tod on tod.order_id = toi.id
|
||||
where toi.shop_id = #{shopId}
|
||||
SELECT
|
||||
toi.created_at AS createAt,
|
||||
toi.id,
|
||||
toi.order_no AS orderNo,
|
||||
toi.order_amount AS orderAmount,
|
||||
count(*) AS productNum,
|
||||
toi.order_type AS orderType,
|
||||
GROUP_CONCAT(tod.product_name) AS productName,
|
||||
toi.STATUS,
|
||||
toi.out_number AS outNumber,
|
||||
toi.table_name AS tableName
|
||||
|
||||
FROM
|
||||
tb_order_info toi
|
||||
LEFT JOIN tb_order_detail tod ON tod.order_id = toi.id
|
||||
|
||||
WHERE
|
||||
toi.shop_id = #{shopId}
|
||||
<choose>
|
||||
<when test="orderType == 'return'">
|
||||
and toi.order_type = 'return' and toi.status in ('refund','closed')
|
||||
@@ -87,7 +100,7 @@
|
||||
<if test="orderNo != null and orderNo != ''">
|
||||
and toi.order_no = #{orderNo}
|
||||
</if>
|
||||
group by toi.shop_id,toi.order_no
|
||||
group by toi.id,toi.shop_id
|
||||
order by toi.id desc
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
@@ -565,4 +578,17 @@ select * from tb_order_info where trade_day = #{day} and table_id = #{masterId}
|
||||
GROUP BY
|
||||
d.order_id
|
||||
</select>
|
||||
|
||||
<select id="selectSkuByOrderId" resultType="com.chaozhanggui.system.cashierservice.entity.po.SkuInfoPo">
|
||||
SELECT
|
||||
d.product_name AS productName,
|
||||
d.num,
|
||||
d.product_sku_name AS productSkuName,
|
||||
c.category_id AS categoryId
|
||||
FROM
|
||||
tb_order_detail d
|
||||
LEFT JOIN tb_cashier_cart c ON d.order_id = c.order_id
|
||||
AND d.product_sku_id = c.sku_id
|
||||
where c.order_id=#{orderId}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user