Compare commits
2 Commits
cd8d2cb6bb
...
fbb6b4f976
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbb6b4f976 | ||
|
|
b14b28fbee |
@@ -1161,12 +1161,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
|
||||
<select id="selectNewGrBiSaAggGroupHZList" resultType="java.util.Map">
|
||||
select t.* from (
|
||||
SELECT
|
||||
'自营品种' as bk,
|
||||
IF(GROUPING (saler_name, zone_name) = 2, CONCAT(zone_name, "总计"), IFNULL(zone_name, '省区合计')) AS zone_name,
|
||||
c.position,
|
||||
saler_name,
|
||||
-- GROUPING (saler_name, zone_name, c.position),
|
||||
-- GROUPING (saler_name, zone_name, c.position),
|
||||
ROUND(SUM(IF(`use_month` = '1', this_month_sa_money, null)) / 10000, 2) AS month_sa_money_1,
|
||||
ROUND(SUM(IF(`use_month` = '2', this_month_sa_money, null)) / 10000, 2) AS month_sa_money_2,
|
||||
ROUND(SUM(IF(`use_month` = '3', this_month_sa_money, null)) / 10000, 2) AS month_sa_money_3,
|
||||
@@ -1192,7 +1193,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
saler_name,
|
||||
c.position WITH ROLLUP
|
||||
|
||||
HAVING GROUPING (saler_name, zone_name, c.position) != 1
|
||||
HAVING GROUPING (saler_name, zone_name, c.position) != 1 ORDER BY a.zone_name DESC, zone_name ASC, c.position IS NULL , c.position DESC
|
||||
) t
|
||||
UNION ALL
|
||||
|
||||
SELECT
|
||||
|
||||
Reference in New Issue
Block a user