|
|
|
@@ -224,8 +224,8 @@ |
|
|
|
<include refid="dynamicVoWhereConditions" /> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="sumCardSpendVo" parameterType="com.iformall.domain.vo.WxCardSpendVo" resultType="hashmap"> |
|
|
|
select cs.merchant_id, m.name as merchantName |
|
|
|
<select id="sumCardSpendVoForMerchant" parameterType="com.iformall.domain.vo.WxCardSpendVo" resultType="hashmap"> |
|
|
|
select cs.merchant_id, m.name as merchantName, |
|
|
|
IFNULL(SUM(cs.`deduction_amount`),0) as sum_deduction_amount, |
|
|
|
IFNULL(SUM(cs.`payment`),0) as sum_payment, |
|
|
|
IFNULL(SUM(cs.`real_payment`),0) as sum_real_payment, |
|
|
|
@@ -240,6 +240,23 @@ |
|
|
|
<include refid="dynamicVoWhereConditions" /> |
|
|
|
group by cs.merchant_id |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="sumCardSpendVoForOwner" parameterType="com.iformall.domain.vo.WxCardSpendVo" resultType="hashmap"> |
|
|
|
select cs.owner_id, |
|
|
|
IFNULL(SUM(cs.`deduction_amount`),0) as sum_deduction_amount, |
|
|
|
IFNULL(SUM(cs.`payment`),0) as sum_payment, |
|
|
|
IFNULL(SUM(cs.`real_payment`),0) as sum_real_payment, |
|
|
|
IFNULL(SUM(ms.`subsidy`), 0) as sum_subsidy, |
|
|
|
IFNULL(SUM(ms.`real_subsidy`), 0) as sum_real_subsidy |
|
|
|
from wx_card_spend cs |
|
|
|
left join wx_coupon_order co on co.id = cs.card_id |
|
|
|
left join wx_coupon c on c.id = co.coupon_id |
|
|
|
left join wx_merchant m on m.id = cs.merchant_id |
|
|
|
left join wx_merchant_subsidy ms on ms.order_id = cs.order_id |
|
|
|
left join wx_c_user ou on ou.id = co.owner_id |
|
|
|
<include refid="dynamicVoWhereConditions" /> |
|
|
|
group by cs.owner_id |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
</mapper> |