Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
mall
Commits
cbdb93ee
Commit
cbdb93ee
authored
Sep 05, 2018
by
zhh
Browse files
下单接口完善,添加支付成功回调及自动取消超时订单接口
parent
cae7f7e4
Changes
21
Hide whitespace changes
Inline
Side-by-side
mall-portal/src/main/resources/dao/PortalOrderDao.xml
0 → 100644
View file @
cbdb93ee
<?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.macro.mall.portal.dao.PortalOrderDao"
>
<resultMap
id=
"orderDetailMap"
type=
"com.macro.mall.portal.domain.OmsOrderDetail"
extends=
"com.macro.mall.mapper.OmsOrderMapper.BaseResultMap"
>
<collection
property=
"orderItemList"
columnPrefix=
"ot_"
resultMap=
"com.macro.mall.mapper.OmsOrderItemMapper.BaseResultMap"
>
</collection>
</resultMap>
<select
id=
"getDetail"
resultMap=
"orderDetailMap"
>
SELECT
o.id,
o.order_sn,
o.coupon_id,
o.integration,
o.member_id,
ot.id ot_id,
ot.product_name ot_product_name,
ot.product_sku_id ot_product_sku_id,
ot.product_sku_code ot_product_sku_code,
ot.product_quantity ot_product_quantity
FROM
oms_order o
LEFT JOIN oms_order_item ot ON o.id = ot.order_id
WHERE
o.id = #{orderId}
</select>
<select
id=
"getTimeOutOrders"
resultMap=
"orderDetailMap"
>
SELECT
o.id,
o.order_sn,
o.coupon_id,
o.integration,
o.member_id,
o.use_integration,
ot.id ot_id,
ot.product_name ot_product_name,
ot.product_sku_id ot_product_sku_id,
ot.product_sku_code ot_product_sku_code,
ot.product_quantity ot_product_quantity
FROM
oms_order o
LEFT JOIN oms_order_item ot ON o.id = ot.order_id
WHERE
o.status = 0
AND o.create_time
<
date_add(NOW(), INTERVAL -#{minute} MINUTE);
</select>
<update
id=
"updateSkuStock"
>
UPDATE pms_sku_stock
SET
stock = CASE id
<foreach
collection=
"itemList"
item=
"item"
>
WHEN #{item.productSkuId} THEN stock - #{item.productQuantity}
</foreach>
END,
lock_stock = CASE id
<foreach
collection=
"itemList"
item=
"item"
>
WHEN #{item.productSkuId} THEN lock_stock - #{item.productQuantity}
</foreach>
END
WHERE
id IN
<foreach
collection=
"itemList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item.productSkuId}
</foreach>
</update>
<update
id=
"updateOrderStatus"
>
update oms_order
set status=#{status}
where id in
<foreach
collection=
"ids"
item=
"id"
separator=
","
open=
"("
close=
")"
>
#{id}
</foreach>
</update>
<update
id=
"releaseSkuStockLock"
>
UPDATE pms_sku_stock
SET
lock_stock = CASE id
<foreach
collection=
"itemList"
item=
"item"
>
WHEN #{item.productSkuId} THEN lock_stock - #{item.productQuantity}
</foreach>
END
WHERE
id IN
<foreach
collection=
"itemList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item.productSkuId}
</foreach>
</update>
</mapper>
\ No newline at end of file
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment