交班相关代码

This commit is contained in:
Tankaikai
2025-02-27 19:01:31 +08:00
parent 166634e3f0
commit 8cbfbe265f
22 changed files with 888 additions and 17 deletions

View File

@@ -4,4 +4,82 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.czg.service.order.mapper.OrderInfoMapper">
<sql id="handoverCommonWhere">
AND t1.shop_id =
#{shopId}
<![CDATA[
AND
t1
.
paid_time
>=
str_to_date
(
#{loginTime},
'%Y-%m-%d %H:%i:%s'
)
AND
t1
.
paid_time
<=
str_to_date
(
#{handoverTime},
'%Y-%m-%d %H:%i:%s'
)
]]>
</sql>
<select id="getHandoverCashAmount" resultType="java.math.BigDecimal">
SELECT
ifnull(sum(pay_amount),0)
FROM tb_order_info t1
<where>
<include refid="handoverCommonWhere"/>
and t1.pay_type = 'cash-pay'
</where>
</select>
<select id="getHandoverRefundAmount" resultType="java.math.BigDecimal">
SELECT
ifnull(sum(refund_amount),0)
FROM tb_order_info t1
<where>
<include refid="handoverCommonWhere"/>
</where>
</select>
<select id="getHandoverTotalAmount" resultType="java.math.BigDecimal">
SELECT
ifnull(sum(pay_amount),0)
FROM tb_order_info t1
<where>
<include refid="handoverCommonWhere"/>
</where>
</select>
<select id="getHandoverOrderNum" resultType="java.lang.Integer">
SELECT
count(*)
FROM tb_order_info t1
<where>
<include refid="handoverCommonWhere"/>
</where>
</select>
<select id="getHandoverDetailList" resultType="com.czg.account.vo.HandoverProductListVo">
SELECT
t2.product_id,
t2.sku_id,
GROUP_CONCAT( DISTINCT t2.product_name ) AS product_name,
GROUP_CONCAT( DISTINCT t2.sku_name ) AS sku_name,
sum( ifnull(t2.num,0) ) AS num,
sum( ifnull(t2.pay_amount,0) ) amount
FROM
tb_order_detail t2
LEFT JOIN tb_order_info t1 ON t1.id = t2.order_id
<where>
<include refid="handoverCommonWhere"/>
</where>
GROUP BY
t2.product_id,
t2.sku_id
</select>
</mapper>