采购BI汇总,sql逻辑优化
This commit is contained in:
parent
1d001ea77f
commit
5173dccafb
@ -353,12 +353,11 @@ public class PurchaseDataSummaryServiceImpl implements DataSummaryService {
|
|||||||
" MONTH(DJRQ) AS Month " +
|
" MONTH(DJRQ) AS Month " +
|
||||||
" FROM BO_EU_DWD_ORDER_RKD_HZ " +
|
" FROM BO_EU_DWD_ORDER_RKD_HZ " +
|
||||||
" WHERE BKGS = ? " +
|
" WHERE BKGS = ? " +
|
||||||
" AND DJRQ >= DATE_SUB(?, INTERVAL 2 YEAR) " +
|
" AND DJRQ >= CONCAT(YEAR(?), '-', LPAD(MONTH(?), 2, '0'), '-01')" +
|
||||||
" GROUP BY WLMC, YEAR(DJRQ), MONTH(DJRQ),SLGC " +
|
" GROUP BY WLMC, YEAR(DJRQ), MONTH(DJRQ),SLGC " +
|
||||||
" ) c " +
|
" ) c " +
|
||||||
" WHERE c.Year IN (YEAR(?), YEAR(?) + 1) " +
|
|
||||||
" ORDER BY c.Year, c.Month";
|
" ORDER BY c.Year, c.Month";
|
||||||
List<RowMap> currentMonthData = DBSql.getMaps(currentMonthSql, bkgs, startDate,startDate,startDate);
|
List<RowMap> currentMonthData = DBSql.getMaps(currentMonthSql, bkgs, startDate,startDate);
|
||||||
if (currentMonthData==null){
|
if (currentMonthData==null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -430,12 +429,11 @@ public class PurchaseDataSummaryServiceImpl implements DataSummaryService {
|
|||||||
" MONTH(DJRQ) AS Month " +
|
" MONTH(DJRQ) AS Month " +
|
||||||
" FROM BO_EU_DWD_ORDER_RKD_HZ " +
|
" FROM BO_EU_DWD_ORDER_RKD_HZ " +
|
||||||
" WHERE BKGS = ? " +
|
" WHERE BKGS = ? " +
|
||||||
" AND DJRQ >= DATE_SUB(?, INTERVAL 2 YEAR) " +
|
" AND DJRQ >= CONCAT(YEAR(?), '-', LPAD(MONTH(?), 2, '0'), '-01')" +
|
||||||
" GROUP BY WLMC, YEAR(DJRQ), MONTH(DJRQ) " +
|
" GROUP BY WLMC, YEAR(DJRQ), MONTH(DJRQ) " +
|
||||||
" ) c " +
|
" ) c " +
|
||||||
" WHERE c.Year IN (YEAR(?), YEAR(?) + 1) " +
|
|
||||||
" ORDER BY c.Year, c.Month";
|
" ORDER BY c.Year, c.Month";
|
||||||
List<RowMap> currentMonthData = DBSql.getMaps(currentMonthSql, bkgs, startDate,startDate,startDate);
|
List<RowMap> currentMonthData = DBSql.getMaps(currentMonthSql, bkgs, startDate,startDate);
|
||||||
if (currentMonthData==null){
|
if (currentMonthData==null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user