|
@@ -61,7 +61,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
school,
|
|
|
school_name,
|
|
|
sum(school_commission) as school_commission,
|
|
|
- sum(total) as orderTotal
|
|
|
+ sum(total) as order_total,
|
|
|
+ COUNT(DISTINCT logincode) as people_count,
|
|
|
+ COUNT(id) as order_count,
|
|
|
+ IFNULL(COUNT(DISTINCT logincode),0)*49*100 as activation_commission,
|
|
|
+ (IFNULL(COUNT(DISTINCT logincode),0)*49*100-sum(school_commission)) as subsidy_bak,
|
|
|
+ (case
|
|
|
+ when (IFNULL(COUNT(DISTINCT logincode),0)*49*100-sum(school_commission)) <![CDATA[ <= ]]> 0 then 0
|
|
|
+ when (IFNULL(COUNT(DISTINCT logincode),0)*49*100-sum(school_commission)) <![CDATA[ > ]]> 0 then (IFNULL(COUNT(DISTINCT logincode),0)*49*100-sum(school_commission))
|
|
|
+ else 0 end) as subsidy
|
|
|
from order_info
|
|
|
<where>
|
|
|
<if test="isShare != null">
|
|
@@ -92,7 +100,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
school,
|
|
|
school_name,
|
|
|
sum(school_commission)/100 as school_commission,
|
|
|
- sum(total)/100 as orderTotal
|
|
|
+ sum(total)/100 as order_total,
|
|
|
+ COUNT(DISTINCT logincode) as people_count,
|
|
|
+ COUNT(id) as order_count,
|
|
|
+ IFNULL(COUNT(DISTINCT logincode),0)*49 as activation_commission,
|
|
|
+ (IFNULL(COUNT(DISTINCT logincode),0)*49-sum(school_commission/100)) as subsidy_bak,
|
|
|
+ (case
|
|
|
+ when (IFNULL(COUNT(DISTINCT logincode),0)*49-sum(school_commission)/100) <![CDATA[ <= ]]> 0 then 0
|
|
|
+ when (IFNULL(COUNT(DISTINCT logincode),0)*49-sum(school_commission)/100) <![CDATA[ > ]]> 0 then (IFNULL(COUNT(DISTINCT logincode),0)*49-sum(school_commission)/100)
|
|
|
+ else 0 end) as subsidy
|
|
|
from order_info
|
|
|
<where>
|
|
|
<if test="isShare != null">
|