|
|
@@ -67,11 +67,11 @@
|
|
|
<select id="getSaleData" parameterType="long" resultType="string">
|
|
|
select concat('[',five,',',other,']') from ((
|
|
|
|
|
|
- select GROUP_CONCAT(concat('{"x":"',si_custname,'","y":',IFNULL(round(si_amount/10000,2),0),'}')) five from (
|
|
|
+ select GROUP_CONCAT(concat('{"x":"',si_custname,'","y":',IFNULL(round(si_amount/10000,2),0),',"z":"',si_custshortname,'"}')) five from (
|
|
|
select * from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE' ORDER BY si_amount desc limit 0,5
|
|
|
) c)d,(
|
|
|
|
|
|
- select concat('{"x":"其它","y":',ifnull(round((all_sum - five_sum)/10000,2),0),'}') other from ( (select sum(si_amount) all_sum from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE')a,
|
|
|
+ select concat('{"x":"其它","y":',ifnull(round((all_sum - five_sum)/10000,2),0),',"z":"其它"}') other from ( (select sum(si_amount) all_sum from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE')a,
|
|
|
( select sum(si_amount) five_sum from (select si_amount from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE' ORDER BY si_amount desc limit 0,5)f)b))e)
|
|
|
</select>
|
|
|
|