else concat(format(ifnull(SJCL,0)/ifnull(YGL,0),2),'T') end as RJCL
else concat(format(ifnull(SJCL,0)/ifnull(YGL,0),2),'T') end as RJCL
from (select
from (select
(select count(*) FROM hpjx.T_HPPZ014
(select sum(USER_COUNT)
where COMPANY_CODE = #companyCode# and REG_DATE = #date# and FACTORY_CODE = #factorycode#
FROM hpjx.t_hpsc008
group by FACTORY_CODE) as YGL,
where COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode# ) as YGL,
0 as JHCL,
0 as JHCL,
(select sum(WEIGHT) FROM hpjx.T_HPXS001
(select sum(WEIGHT)
where COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode#
FROM hpjx.t_hpsc008
group by FACTORY_CODE) as SJCL
where COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode# ) as SJCL
from dual) a
from dual) a
</select>
</select>
...
@@ -28,13 +28,11 @@
...
@@ -28,13 +28,11 @@
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 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