整体修改一体化事业部BI汇总sql逻辑-2
This commit is contained in:
parent
3df164a773
commit
f02850f58b
@ -187,10 +187,8 @@ public class SaleDataSummaryServiceImpl implements DataSummaryService {
|
||||
" WHEN SQ LIKE '%西藏%' THEN '西藏' " +
|
||||
" END AS PROVINCE, " +
|
||||
" CS, " +
|
||||
" -- 条件判断:如果是轻钢龙骨则用ZSSL,否则用XSSL " +
|
||||
" SUM(CASE WHEN LB_1 = '轻钢龙骨' THEN ZSSL ELSE XSSL END) AS SALES_VOLUME, " +
|
||||
" SUM(NMNY) AS REVENUE_AMOUNT, " +
|
||||
" -- 单价计算也需要同步使用对应的数量字段 " +
|
||||
" SUM(NMNY) / SUM(CASE WHEN LB_1 = '轻钢龙骨' THEN ZSSL ELSE XSSL END) AS UNIT_PRICE " +
|
||||
"FROM " +
|
||||
" BO_EU_BNBM_DATALINKUP_XS_XSL_HZ " +
|
||||
@ -222,6 +220,7 @@ public class SaleDataSummaryServiceImpl implements DataSummaryService {
|
||||
priceBO.set("BKGS", bkgs1);
|
||||
priceBO.set("DATE", dzrq);
|
||||
priceBO.set("CITY", map.getString("CS"));
|
||||
priceBO.set("PRODUCT_TYPE", lb_1);
|
||||
priceBO.set("SALES_VOLUME", sales_volume);
|
||||
priceBO.set("REVENUE_AMOUNT", revenue_amount);
|
||||
priceBO.set("UNIT_PRICE", unit_price);
|
||||
@ -919,6 +918,7 @@ public class SaleDataSummaryServiceImpl implements DataSummaryService {
|
||||
" (SQ LIKE '%海南%' OR SQ LIKE '%新疆%' OR SQ LIKE '%西藏%') " +
|
||||
" AND DZRQ >= '" + year + "-" + monthStr + "-01' " +
|
||||
" AND BKGS = ? " +
|
||||
" AND LB_1 IN('石膏板','轻钢龙骨','涂料') " +
|
||||
" GROUP BY " +
|
||||
" LB_1, " +
|
||||
" PROVINCE, " +
|
||||
|
||||
Loading…
Reference in New Issue
Block a user