Commit 478b85e5 by liuyang

产品成材率

parent bb6803fa
......@@ -68,8 +68,8 @@
k.INV_UNIT_WEIGHT ,
k.INV_WEIGHT
from
hggp.hgsc004a h
left join hggp.hgkc003 k on
${hggpSchema}.hgsc004a h
left join ${hggpSchema}.hgkc003 k on
h.company_code = k.COMPANY_CODE
and h.proj_code = k.PROJ_CODE
and h.material_id = k.MAT_ID
......@@ -77,6 +77,15 @@
and k.DELETE_FLAG = 0
and h.lv = 3
and h.product_status = 1
and (k.PRDT_CODE, k.PROCESS_ORDER) in (
select INVENT_CODE, MAX(PROCESS_ORDER)
from ${hggpSchema}.hgpz005a
where 1=1
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
group by INVENT_CODE
)
where 1=1
<isNotEmpty prepend=" AND " property="accountCode">
h.ACCOUNT_CODE = #accountCode#
......@@ -131,7 +140,7 @@
k.INV_QTY ,
k.INV_WEIGHT
from
hggp.hgsc004a h
${hggpSchema}.hgsc004a h
left join (
select
k.COMPANY_CODE ,
......@@ -143,8 +152,8 @@
sum(k.INV_QTY) as INV_QTY,
sum(k.INV_WEIGHT) as INV_WEIGHT
from
hggp.hgkc008a k
join hggp.hgkc008 k1 on
${hggpSchema}.hgkc008a k
join ${hggpSchema}.hgkc008 k1 on
k.RECEIVE_ID = k1.id
where
k.DELETE_FLAG = 0
......
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