Commit 472f8a9f by liuyang

2024-07-18 修复app项目产量计算bug

parent 8d7543f6
......@@ -643,8 +643,8 @@
a.proj_code as projCode,
a.proj_name as projName,
a.finish_date as completeDate,
ROUND(ifnull(sum(a.total_weight),0)/1000, 4) as totalWeight,
ROUND(ifnull(sum(a.finish_weight),0)/1000, 4) as finishWeight,
ROUND(ifnull(sum(a.total_weight),0)/1000, 4) as totalWeight,
ROUND(ifnull(sum(a.finish_weight),0)/1000, 4) as finishWeight,
a.updated_time as updatedTime
from (
select
......@@ -656,8 +656,7 @@
left(h1.updated_time,8) as updated_time
from ${hggpSchema}.HGSC005a h
inner join ${hggpSchema}.HGSC005 h1 on h.company_code = h1.company_code and h.plan_code = h1.plan_code
inner join ${hggpSchema}.HGSC007 h2 on h.company_code = h2.company_code AND h.proj_code = h2.proj_code
where 1 = 1 and h1.commit_status = 2
where 1 = 1 and h1.commit_status = 2 and (h.product_code,h.process_order) in (select INVENT_CODE,max(process_order) from hggp.hgpz005a group by INVENT_CODE)
<include refid="appCondition"/>
<isNotEmpty prepend=" AND " property="accountCode">
h.account_code = #accountCode#
......@@ -668,12 +667,6 @@
<isNotEmpty prepend=" AND " property="companyName">
h.company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
h2.factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
h2.factory_name = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
left(h1.updated_time,8) = #updatedTime#
</isNotEmpty>
......@@ -687,8 +680,7 @@
left(h1.updated_time,8) as updated_time
from ${hggpSchema}.HGSC005a h
inner join ${hggpSchema}.HGSC005 h1 on h.plan_code = h1.plan_code
inner join ${hggpSchema}.HGSC007 h2 on h.company_code = h2.company_code AND h.proj_code = h2.proj_code
where 1 = 1 and h1.commit_status = 2
where 1 = 1 and h1.commit_status = 2 and (h.product_code,h.process_order) in (select INVENT_CODE,max(process_order) from hggp.hgpz005a group by INVENT_CODE)
<include refid="appCondition"/>
<isNotEmpty prepend=" AND " property="accountCode">
h.account_code = #accountCode#
......@@ -699,16 +691,18 @@
<isNotEmpty prepend=" AND " property="companyName">
h.company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
h2.factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
h2.factory_name = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
left(h1.updated_time,8) = #updatedTime#
</isNotEmpty>
)a
inner join ${hggpSchema}.HGSC007 h2 on a.proj_code = h2.proj_code
where 1=1
<isNotEmpty prepend=" AND " property="factoryCode">
h2.factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
h2.factory_name = #factoryName#
</isNotEmpty>
group by a.proj_code, a.proj_name, a.finish_date, a.updated_time
order by a.updated_time desc
</select>
......
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