else concat(format(ifnull(SJCL,0)/ifnull(YGL,0),2),'T') end as LJRJCL
else concat(format(ifnull(SJCL,0)/ifnull(YGL,0),2),'T') end as LJRJCL
from (select
from (select
(select count(*) FROM hpjx.T_HPPZ014
(select sum(USER_COUNT) FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REG_DATE,6) = left(#date#,6) and REG_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode#
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,6) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as YGL,
group by FACTORY_CODE,left(REG_DATE,6)) as YGL,
0 as JHCL,
0 as JHCL,
(select sum(WEIGHT) FROM hpjx.T_HPXS001
(select sum(WEIGHT) FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,6) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode#
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,6) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as SJCL
group by FACTORY_CODE,left(REGISTER_DATE,6)) as SJCL
from dual) a
from dual) a
</select>
</select>
...
@@ -46,13 +44,15 @@
...
@@ -46,13 +44,15 @@
case when ifnull(YGL,0) = 0 then '0.00T'
case when ifnull(YGL,0) = 0 then '0.00T'
else concat(format(ifnull(SJCL,0)/ifnull(YGL,0),2),'T') end as NLJRJCL
else concat(format(ifnull(SJCL,0)/ifnull(YGL,0),2),'T') end as NLJRJCL
from (select
from (select
(select count(*) FROM hpjx.T_HPPZ014
(select
where COMPANY_CODE = #companyCode# and left(REG_DATE,4) = left(#date#,4) and REG_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode#
sum(USER_COUNT)
group by FACTORY_CODE,left(REG_DATE,4)) as YGL,
FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as YGL,
0 as JHCL,
0 as JHCL,
(select sum(WEIGHT) FROM hpjx.T_HPXS001
(select
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,4) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode#
sum(WEIGHT)
group by FACTORY_CODE,left(REGISTER_DATE,4)) as SJCL
FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as SJCL
from dual) a
from dual) a
</select>
</select>
...
@@ -245,10 +245,10 @@
...
@@ -245,10 +245,10 @@
select
select
a.PROJ_NAME,
a.PROJ_NAME,
concat(left(max(a.PLAN_COMPLETION_DATE),4),'年',substring(max(a.PLAN_COMPLETION_DATE),5,2),'月',right(max(a.PLAN_COMPLETION_DATE),2),'日') as JHDATE,
concat(left(max(a.PLAN_COMPLETION_DATE),4),'年',substring(max(a.PLAN_COMPLETION_DATE),5,2),'月',right(max(a.PLAN_COMPLETION_DATE),2),'日') as JHDATE,
concat(format(ifnull(sum(b.TOTAL_WT ),0),2),'吨') as JHCL,
concat(format(ifnull(sum(b.NUM*b.UNIT_WT ),0),2),'吨') as JHCL,
concat(format(ifnull(sum(c.WEIGHT),0),2),'吨') as SJCL,
concat(format(ifnull(sum(c.WEIGHT),0),2),'吨') as SJCL,