Commit e193a5bf by 高晓磊

砂石类型生产统计,修改一下主表和关联表顺序

parent 978cd810
...@@ -12,14 +12,13 @@ ...@@ -12,14 +12,13 @@
<sql-type>SQL</sql-type> <sql-type>SQL</sql-type>
<sql> <sql>
SELECT SELECT
bdt.dinasTypeName as typeName,sum(dtd.dinasWeight)/1000 as weight, bdt.type as type bdt.dinasTypeName as typeName,sum(dtd.dinasWeight)/1000 as weight, bdt.type as typeType
FROM FROM DinasType as bdt
xystOrganization AS dbo LEFT JOIN ProductionPlanReportAssociateddinasTypeDetail as dtd on bdt.id = dtd.dinasType
LEFT JOIN ProductionPlanReport AS ppr LEFT JOIN ProductionPlanReport AS ppr on dtd.master = ppr.id
on ppr.regionalCompany = dbo.id LEFT JOIN xystOrganization AS dbo on ppr.regionalCompany = dbo.id
LEFT JOIN ProductionPlanReportAssociateddinasTypeDetail as dtd on dtd.master = ppr.id
LEFT JOIN DinasType as bdt on bdt.id = dtd.dinasType
where (dbo.discard = 0 or dbo.discard is null) where (dbo.discard = 0 or dbo.discard is null)
and bdt.del =0
and ppr.productionPlanDate &gt;= :?startDate and ppr.productionPlanDate &gt;= :?startDate
and Ppr.productionPlanDate &lt;= :?endDate and Ppr.productionPlanDate &lt;= :?endDate
GROUP BY bdt.id GROUP BY bdt.id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment