|
@@ -511,6 +511,20 @@
|
|
|
GROUP BY spo.organ_id_, spo.music_group_id_
|
|
|
]]></select>
|
|
|
|
|
|
+ <!-- 获取退货订单的收入和成本 -->
|
|
|
+ <select id="getRefundIncome" resultMap="com.ym.mec.biz.dal.dao.OperatingReportDao.OperatingReport"><![CDATA[
|
|
|
+ SELECT organ_id_,
|
|
|
+ cooperation_organ_id_,
|
|
|
+ -SUM(actual_amount_) income_total_,
|
|
|
+ -SUM(actual_amount_) sell_amount_,
|
|
|
+ -SUM(sell_cost_ * num_) sell_cost_,
|
|
|
+ SUM(actual_amount_) other_income_
|
|
|
+ FROM sell_order
|
|
|
+ WHERE status_ = 1
|
|
|
+ AND sell_time_ >= #{startTime}
|
|
|
+ AND sell_time_ <= #{endTime}
|
|
|
+ GROUP BY organ_id_, cooperation_organ_id_
|
|
|
+ ]]></select>
|
|
|
|
|
|
<select id="getSellOrders" resultMap="SellOrder">
|
|
|
SELECT * FROM sell_order WHERE id_ IN
|