|
@@ -445,28 +445,43 @@
|
|
|
<select id="getRepairGoodsSellGroupMonthReport"
|
|
|
resultMap="com.ym.mec.biz.dal.dao.OperatingReportDao.OperatingReport"><![CDATA[
|
|
|
SELECT spo.organ_id_,
|
|
|
- so.cooperation_organ_id_,
|
|
|
SUM(so.actual_amount_) sell_amount_,
|
|
|
SUM(so.sell_cost_ * so.num_) sell_cost_
|
|
|
FROM student_payment_order spo
|
|
|
LEFT JOIN sell_order so on so.order_id_ = spo.id_
|
|
|
WHERE spo.status_ = 'SUCCESS'
|
|
|
- AND spo.group_type_ IN ('REPAIR', 'GOODS_SELL')
|
|
|
+ AND spo.group_type_ = 'REPAIR'
|
|
|
AND spo.create_time_ >= #{startTime}
|
|
|
AND spo.create_time_ <= #{endTime}
|
|
|
- GROUP BY spo.organ_id_, so.cooperation_organ_id_
|
|
|
+ GROUP BY spo.organ_id_
|
|
|
]]></select>
|
|
|
|
|
|
<!-- 获取分部学校的收入支出(维修、商品销售订单) -->
|
|
|
<select id="getRepairGoodsSellGroupIncome"
|
|
|
resultMap="com.ym.mec.biz.dal.dao.OperatingReportDao.OperatingReport"><![CDATA[
|
|
|
SELECT spo.organ_id_,
|
|
|
- so.cooperation_organ_id_,
|
|
|
SUM(spo.actual_amount_) income_total_
|
|
|
FROM student_payment_order spo
|
|
|
LEFT JOIN sell_order so on so.order_id_ = spo.id_
|
|
|
WHERE spo.status_ = 'SUCCESS'
|
|
|
- AND spo.group_type_ IN ('REPAIR', 'GOODS_SELL')
|
|
|
+ AND spo.group_type_ = 'REPAIR'
|
|
|
+ AND spo.create_time_ >= #{startTime}
|
|
|
+ AND spo.create_time_ <= #{endTime}
|
|
|
+ GROUP BY spo.organ_id_
|
|
|
+ ]]></select>
|
|
|
+
|
|
|
+ <!-- 获取分部学校的收入支出(商品销售订单) -->
|
|
|
+ <select id="getGoodsSellGroupMonthReport"
|
|
|
+ resultMap="com.ym.mec.biz.dal.dao.OperatingReportDao.OperatingReport"><![CDATA[
|
|
|
+ SELECT spo.organ_id_,
|
|
|
+ so.cooperation_organ_id_,
|
|
|
+ SUM(so.actual_amount_) income_total_,
|
|
|
+ SUM(so.actual_amount_) sell_amount_,
|
|
|
+ SUM(so.sell_cost_ * so.num_) sell_cost_
|
|
|
+ FROM student_payment_order spo
|
|
|
+ LEFT JOIN sell_order so on so.order_id_ = spo.id_
|
|
|
+ WHERE spo.status_ = 'SUCCESS'
|
|
|
+ AND spo.group_type_ ='GOODS_SELL'
|
|
|
AND spo.create_time_ >= #{startTime}
|
|
|
AND spo.create_time_ <= #{endTime}
|
|
|
GROUP BY spo.organ_id_, so.cooperation_organ_id_
|