|
|
@@ -166,54 +166,7 @@ LEFT JOIN (SELECT b.Month,a.CatalogSpe from (select extract(month from CreateOn
|
|
|
from OilCatalog
|
|
|
WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=4
|
|
|
group by extract(month from CreateOn)) a
|
|
|
- RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogSpe ON AnnualAudit.Month = CatalogSpe.Month ORDER BY AnnualAudit.Month)
|
|
|
- union ALL
|
|
|
- select '合计',sum(AnnualAudit),sum(Store),sum(Append),sum(InfoChange),sum(CatalogSelf),sum(CatalogWin),sum(CatalogTrade),sum(CatalogComp),sum(CatalogSpe) from (SELECT AnnualAudit.Month,AnnualAudit,Store,Append,InfoChange,CatalogSelf,CatalogWin,CatalogTrade,CatalogComp,CatalogSpe FROM(
|
|
|
-SELECT b.Month,a.AnnualAudit from (select extract(month from ApplyTime) time ,COUNT(*) AnnualAudit
|
|
|
- from OilAnnualAudit
|
|
|
- WHERE ApplyTime >= '` + where +`' AND ApplyTime < '` + timedone +`' AND Status = '11'
|
|
|
- group by extract(month from ApplyTime)) a
|
|
|
- RIGHT JOIN OilCountMonth b ON b.Month = a.time) AnnualAudit
|
|
|
-LEFT JOIN (SELECT b.Month,a.Store from (select extract(month from ApplyTime) time ,COUNT(*) Store
|
|
|
- from OilSupplierCert
|
|
|
- WHERE ApplyTime >= '` + where +`' AND ApplyTime < '` + timedone +`' AND InFlag = '1'
|
|
|
- group by extract(month from ApplyTime)) a
|
|
|
- RIGHT JOIN OilCountMonth b ON b.Month = a.time) Store ON AnnualAudit.Month = Store.Month
|
|
|
-LEFT JOIN (SELECT b.Month,a.Append from (select extract(month from ApplyDate) time ,COUNT(*) Append
|
|
|
- from OilSupplierCertAppend
|
|
|
- WHERE ApplyDate >= '` + where +`' AND ApplyDate < '` + timedone +`' AND Status = '11'
|
|
|
- group by extract(month from ApplyDate)) a
|
|
|
- RIGHT JOIN OilCountMonth b ON b.Month = a.time) Append ON AnnualAudit.Month = Append.Month
|
|
|
-LEFT JOIN (SELECT b.Month,a.InfoChange from (select extract(month from CreateOn) time ,COUNT(*) InfoChange
|
|
|
- from OilInfoChange
|
|
|
- WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND Status = '11'
|
|
|
- group by extract(month from CreateOn)) a
|
|
|
- RIGHT JOIN OilCountMonth b ON b.Month = a.time) InfoChange ON AnnualAudit.Month = InfoChange.Month
|
|
|
-LEFT JOIN (SELECT b.Month,a.CatalogSelf from (select extract(month from CreateOn) time ,COUNT(*) CatalogSelf
|
|
|
- from OilCatalog
|
|
|
- WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=1
|
|
|
- group by extract(month from CreateOn)) a
|
|
|
- RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogSelf ON AnnualAudit.Month = CatalogSelf.Month
|
|
|
-LEFT JOIN (SELECT b.Month,a.CatalogWin from (select extract(month from CreateOn) time ,COUNT(*) CatalogWin
|
|
|
- from OilCatalog
|
|
|
- WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=2
|
|
|
- group by extract(month from CreateOn)) a
|
|
|
- RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogWin ON AnnualAudit.Month = CatalogWin.Month
|
|
|
-LEFT JOIN (SELECT b.Month,a.CatalogTrade from (select extract(month from CreateOn) time ,COUNT(*) CatalogTrade
|
|
|
- from OilCatalog
|
|
|
- WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=3
|
|
|
- group by extract(month from CreateOn)) a
|
|
|
- RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogTrade ON AnnualAudit.Month = CatalogTrade.Month
|
|
|
-LEFT JOIN (SELECT b.Month,a.CatalogComp from (select extract(month from CreateOn) time ,COUNT(*) CatalogComp
|
|
|
- from OilCatalog
|
|
|
- WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=4
|
|
|
- group by extract(month from CreateOn)) a
|
|
|
- RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogComp ON AnnualAudit.Month = CatalogComp.Month
|
|
|
-LEFT JOIN (SELECT b.Month,a.CatalogSpe from (select extract(month from CreateOn) time ,COUNT(*) CatalogSpe
|
|
|
- from OilCatalog
|
|
|
- WHERE CreateOn >= '` + where +`' AND CreateOn < '` + timedone +`' AND CatalogType=4
|
|
|
- group by extract(month from CreateOn)) a
|
|
|
- RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogSpe ON AnnualAudit.Month = CatalogSpe.Month) countTotal`
|
|
|
+ RIGHT JOIN OilCountMonth b ON b.Month = a.time) CatalogSpe ON AnnualAudit.Month = CatalogSpe.Month ORDER BY AnnualAudit.Month) `
|
|
|
|
|
|
//if asc {
|
|
|
// sql += ` order by ` + orderby + ` ASC `
|