交班相关代码
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
|
||||
<select id="getHandoverCashAmount" resultType="java.math.BigDecimal">
|
||||
SELECT
|
||||
ifnull(sum(pay_amount),0)
|
||||
ifnull(sum(t1.pay_amount),0)
|
||||
FROM tb_order_info t1
|
||||
<where>
|
||||
<include refid="handoverCommonWhere"/>
|
||||
@@ -42,7 +42,7 @@
|
||||
</select>
|
||||
<select id="getHandoverRefundAmount" resultType="java.math.BigDecimal">
|
||||
SELECT
|
||||
ifnull(sum(refund_amount),0)
|
||||
ifnull(sum(t1.refund_amount),0)
|
||||
FROM tb_order_info t1
|
||||
<where>
|
||||
<include refid="handoverCommonWhere"/>
|
||||
@@ -50,7 +50,7 @@
|
||||
</select>
|
||||
<select id="getHandoverTotalAmount" resultType="java.math.BigDecimal">
|
||||
SELECT
|
||||
ifnull(sum(pay_amount),0)
|
||||
ifnull(sum(t1.pay_amount),0)
|
||||
FROM tb_order_info t1
|
||||
<where>
|
||||
<include refid="handoverCommonWhere"/>
|
||||
@@ -82,4 +82,76 @@
|
||||
t2.product_id,
|
||||
t2.sku_id
|
||||
</select>
|
||||
<select id="getHandoverWechatAmount" resultType="java.math.BigDecimal">
|
||||
SELECT
|
||||
ifnull(sum(t1.pay_amount),0)
|
||||
FROM tb_order_info t1
|
||||
<where>
|
||||
<include refid="handoverCommonWhere"/>
|
||||
and t1.pay_type = 'wechat-mini'
|
||||
</where>
|
||||
</select>
|
||||
<select id="getHandoverAlipayAmount" resultType="java.math.BigDecimal">
|
||||
SELECT
|
||||
ifnull(sum(t1.pay_amount),0)
|
||||
FROM tb_order_info t1
|
||||
<where>
|
||||
<include refid="handoverCommonWhere"/>
|
||||
and t1.pay_type = 'alipay-mini'
|
||||
</where>
|
||||
</select>
|
||||
<select id="getHandoverVipPayAmount" resultType="java.math.BigDecimal">
|
||||
SELECT
|
||||
ifnull(sum(t1.pay_amount),0)
|
||||
FROM tb_order_info t1
|
||||
<where>
|
||||
<include refid="handoverCommonWhere"/>
|
||||
and t1.pay_type = 'vip-pay'
|
||||
</where>
|
||||
</select>
|
||||
<select id="getHandoverVipChargeAmount" resultType="java.math.BigDecimal">
|
||||
select ifnull(sum(t1.amount), 0)
|
||||
from tb_shop_user_flow t1
|
||||
where t1.shop_id = #{shopId}
|
||||
and t1.biz_code in ('cashIn', 'wechatIn', 'alipayIn', 'adminIn')
|
||||
and t1.recharge_id is not null
|
||||
<![CDATA[
|
||||
AND t1.create_time >= str_to_date(#{loginTime}, '%Y-%m-%d %H:%i:%s')
|
||||
AND t1.create_time <= str_to_date(#{handoverTime}, '%Y-%m-%d %H:%i:%s')
|
||||
]]>
|
||||
</select>
|
||||
<select id="getHandoverQuickPayAmount" resultType="java.math.BigDecimal">
|
||||
SELECT
|
||||
ifnull(sum(pay_amount),0)
|
||||
FROM tb_order_info t1
|
||||
<where>
|
||||
<include refid="handoverCommonWhere"/>
|
||||
and t1.pay_type in ('main-scan','back-scan')
|
||||
</where>
|
||||
</select>
|
||||
<select id="getHandoverCategoryList" resultType="com.czg.account.vo.HandoverCategoryListVo">
|
||||
SELECT case when t3.category_id is null then 0 else t3.category_id end as category_id,
|
||||
case when t4.name is null then '未分类' else t4.name end as category_name,
|
||||
count(DISTINCT t2.product_id) AS quantity,
|
||||
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
|
||||
LEFT JOIN tb_product t3 ON t3.id = t2.product_id
|
||||
LEFT JOIN tb_shop_prod_category t4 ON t4.id = t3.category_id
|
||||
<where>
|
||||
<include refid="handoverCommonWhere"/>
|
||||
</where>
|
||||
GROUP BY t3.category_id
|
||||
</select>
|
||||
<select id="getHandoverCreditAmount" resultType="java.math.BigDecimal">
|
||||
SELECT
|
||||
ifnull(sum(t1.pay_amount),0)
|
||||
FROM tb_order_info t1
|
||||
<where>
|
||||
<include refid="handoverCommonWhere"/>
|
||||
and t1.pay_type = 'credit-pay'
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user