|
@@ -351,7 +351,7 @@
|
|
|
</select>
|
|
|
<select id="selectNowYearPlanGetOrderNum" resultType="com.rongwei.bsentity.domain.ApsReportYearAndMonth">
|
|
|
select
|
|
|
- aop.TENANTID AS 'tenantid',IFNULL(sum(PLANACCEPTORDERSUM),0) AS 'planordernumyear'
|
|
|
+ aop.TENANTID AS 'tenantid',IFNULL(ROUND(sum(PLANACCEPTORDERSUM),2),0) AS 'planordernumyear'
|
|
|
from
|
|
|
aps_accept_order_plan aop
|
|
|
join aps_accept_order_plan_detail aopd on aop.id=aopd.MAINID
|
|
@@ -363,7 +363,7 @@
|
|
|
<select id="selectNowYearActualGetOrderNum" resultType="com.rongwei.bsentity.domain.ApsReportYearAndMonth">
|
|
|
select
|
|
|
apro.TENANTID AS 'tenantid',
|
|
|
- IFNULL(sum((apope.PLANPROCESSRALL-apope.CANCELROLL)*apoom.PLANPRODROLLNUM/apo.PLANPROCESSRALL*apoom.SINGLEROLLWEIGHT),0) AS 'actualordernumyear' -- 实际接单量
|
|
|
+ IFNULL(ROUND(sum((apope.PLANPROCESSRALL-apope.CANCELROLL)*apoom.PLANPRODROLLNUM/apo.PLANPROCESSRALL*apoom.SINGLEROLLWEIGHT),2),0) AS 'actualordernumyear' -- 实际接单量
|
|
|
from
|
|
|
aps_process_operation_process_equ apope
|
|
|
join aps_process_operation apo on apo.ID = apope.PROCESSID
|
|
@@ -371,11 +371,11 @@
|
|
|
join aps_blank_order abo on apo.BLANKID = abo.id
|
|
|
join aps_production_order apro on apro.ID = abo.PRODUCTIONORDERID
|
|
|
join aps_product_detail apd on apoom.ORDERDETAILID = apd.id -- 订单产品明细
|
|
|
- left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS <= aps.THICKEND
|
|
|
+ left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS <= aps.THICKEND and aps.DELETED='0'
|
|
|
left join aps_production_merge_order apmd on apmd.ID = apd.MERGEORDERNUMBER and apmd.DELETED='0'
|
|
|
where
|
|
|
apope.deleted='0' and apo.DELETED='0' and abo.DELETED='0' and apro.deleted='0'
|
|
|
- and apd.DELETED='0' and apoom.DELETED='0' and aps.DELETED='0'
|
|
|
+ and apd.DELETED='0' and apoom.DELETED='0'
|
|
|
and (ifnull(apmd.ORDERTYPE, apro.ORDERTYPE) in ('客户订单','')) -- 订单类型为空默认为客户订单
|
|
|
and abo.PRODUCTSTATUS in ('30','40','50')
|
|
|
and (apope.PLANPROCESSRALL-apope.CANCELROLL)>0
|
|
@@ -386,7 +386,7 @@
|
|
|
<select id="selectNowYearActualProduceNum" resultType="com.rongwei.bsentity.domain.ApsReportYearAndMonth">
|
|
|
select
|
|
|
apro.TENANTID AS 'tenantid',
|
|
|
- IFNULL(sum(aro.WEIGHT),0) AS 'actualfinishnumyear'
|
|
|
+ IFNULL(ROUND(sum(aro.WEIGHT),2),0) AS 'actualfinishnumyear'
|
|
|
from
|
|
|
aps_process_operation_process_equ apope
|
|
|
join aps_process_operation apo on apo.ID = apope.PROCESSID
|
|
@@ -410,7 +410,7 @@
|
|
|
<select id="selectNowMonthPlanGetOrderNum" resultType="com.rongwei.bsentity.domain.ApsReportYearAndMonth">
|
|
|
select
|
|
|
aop.TENANTID AS 'tenantid',
|
|
|
- ifnull(sum(
|
|
|
+ ifnull(ROUND(sum(
|
|
|
CASE MONTH(CURRENT_DATE)
|
|
|
WHEN '1' THEN ONEM
|
|
|
WHEN '2' THEN TWOM
|
|
@@ -426,7 +426,7 @@
|
|
|
WHEN '12' THEN TWELVEM
|
|
|
ELSE null
|
|
|
END
|
|
|
- ),0) AS 'planordernummonth'
|
|
|
+ ),2),0) AS 'planordernummonth'
|
|
|
from
|
|
|
aps_accept_order_plan aop
|
|
|
join aps_accept_order_plan_detail aopd on aop.id=aopd.MAINID
|
|
@@ -447,11 +447,11 @@
|
|
|
join aps_blank_order abo on apo.BLANKID = abo.id
|
|
|
join aps_production_order apro on apro.ID = abo.PRODUCTIONORDERID
|
|
|
join aps_product_detail apd on apoom.ORDERDETAILID = apd.id -- 订单产品明细
|
|
|
- left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS <= aps.THICKEND
|
|
|
+ left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS <= aps.THICKEND and aps.DELETED='0'
|
|
|
left join aps_production_merge_order apmd on apmd.ID = apd.MERGEORDERNUMBER and apmd.DELETED='0'
|
|
|
where
|
|
|
apope.deleted='0' and apo.DELETED='0' and abo.DELETED='0' and apro.deleted='0'
|
|
|
- and apd.DELETED='0' and apoom.DELETED='0' and aps.DELETED='0'
|
|
|
+ and apd.DELETED='0' and apoom.DELETED='0'
|
|
|
and (ifnull(apmd.ORDERTYPE, apro.ORDERTYPE) in ('客户订单','')) -- 订单类型为空默认为客户订单
|
|
|
and abo.PRODUCTSTATUS in ('30','40','50')
|
|
|
and (apope.PLANPROCESSRALL-apope.CANCELROLL)>0
|
|
@@ -499,11 +499,11 @@
|
|
|
join aps_blank_order abo on apo.BLANKID = abo.id
|
|
|
join aps_production_order apro on apro.ID = abo.PRODUCTIONORDERID
|
|
|
join aps_product_detail apd on apoom.ORDERDETAILID = apd.id -- 订单产品明细
|
|
|
- left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS <= aps.THICKEND
|
|
|
+ left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS <= aps.THICKEND and aps.DELETED='0'
|
|
|
left join aps_production_merge_order apmd on apmd.ID = apd.MERGEORDERNUMBER and apmd.DELETED='0'
|
|
|
where
|
|
|
apope.deleted='0' and apo.DELETED='0' and abo.DELETED='0' and apro.deleted='0'
|
|
|
- and apd.DELETED='0' and apoom.DELETED='0' and aps.DELETED='0'
|
|
|
+ and apd.DELETED='0' and apoom.DELETED='0'
|
|
|
and (ifnull(apmd.ORDERTYPE, apro.ORDERTYPE) in ('客户订单','')) -- 订单类型为空默认为客户订单
|
|
|
and abo.PRODUCTSTATUS in ('30','40','50')
|
|
|
and (apope.PLANPROCESSRALL-apope.CANCELROLL)>0
|
|
@@ -585,11 +585,11 @@
|
|
|
join aps_blank_order abo on apo.BLANKID = abo.id
|
|
|
join aps_production_order apro on apro.ID = abo.PRODUCTIONORDERID
|
|
|
join aps_product_detail apd on apoom.ORDERDETAILID = apd.id -- 订单产品明细
|
|
|
- left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS <= aps.THICKEND
|
|
|
+ left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS <= aps.THICKEND and aps.DELETED='0'
|
|
|
left join aps_production_merge_order apmd on apmd.ID = apd.MERGEORDERNUMBER and apmd.DELETED='0'
|
|
|
where
|
|
|
apope.deleted='0' and apo.DELETED='0' and abo.DELETED='0' and apro.deleted='0'
|
|
|
- and apd.DELETED='0' and apoom.DELETED='0' and aps.DELETED='0'
|
|
|
+ and apd.DELETED='0' and apoom.DELETED='0'
|
|
|
and (ifnull(apmd.ORDERTYPE, apro.ORDERTYPE) in ('客户订单','')) -- 订单类型为空默认为客户订单
|
|
|
and abo.PRODUCTSTATUS in ('30','40','50')
|
|
|
and (apope.PLANPROCESSRALL-apope.CANCELROLL)>0
|
|
@@ -653,11 +653,11 @@
|
|
|
join aps_blank_order abo on apo.BLANKID = abo.id
|
|
|
join aps_production_order apro on apro.ID = abo.PRODUCTIONORDERID
|
|
|
join aps_product_detail apd on apoom.ORDERDETAILID = apd.id -- 订单产品明细
|
|
|
- left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS <= aps.THICKEND
|
|
|
+ left join aps_product_specs aps on apoom.THICKNESS > aps.THICKSTR and apoom.THICKNESS <= aps.THICKEND and aps.DELETED='0'
|
|
|
left join aps_production_merge_order apmd on apmd.ID = apd.MERGEORDERNUMBER and apmd.DELETED='0'
|
|
|
where
|
|
|
apope.deleted='0' and apo.DELETED='0' and abo.DELETED='0' and apro.deleted='0'
|
|
|
- and apd.DELETED='0' and apoom.DELETED='0' and aps.DELETED='0'
|
|
|
+ and apd.DELETED='0' and apoom.DELETED='0'
|
|
|
and (ifnull(apmd.ORDERTYPE, apro.ORDERTYPE) in ('客户订单','')) -- 订单类型为空默认为客户订单
|
|
|
and abo.PRODUCTSTATUS in ('30','40','50')
|
|
|
and (apope.PLANPROCESSRALL-apope.CANCELROLL)>0
|