Commit e193a5bf by 高晓磊

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

parent 978cd810
......@@ -12,14 +12,13 @@
<sql-type>SQL</sql-type>
<sql>
SELECT
bdt.dinasTypeName as typeName,sum(dtd.dinasWeight)/1000 as weight, bdt.type as type
FROM
xystOrganization AS dbo
LEFT JOIN ProductionPlanReport AS ppr
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
bdt.dinasTypeName as typeName,sum(dtd.dinasWeight)/1000 as weight, bdt.type as typeType
FROM DinasType as bdt
LEFT JOIN ProductionPlanReportAssociateddinasTypeDetail as dtd on bdt.id = dtd.dinasType
LEFT JOIN ProductionPlanReport AS ppr on dtd.master = ppr.id
LEFT JOIN xystOrganization AS dbo on ppr.regionalCompany = dbo.id
where (dbo.discard = 0 or dbo.discard is null)
and bdt.del =0
and ppr.productionPlanDate &gt;= :?startDate
and Ppr.productionPlanDate &lt;= :?endDate
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