|
|
|
@ -178,42 +178,51 @@ |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="getOrderView" resultType="OrderViewData"> |
|
|
|
SELECT site,a.OrderNo,dbo.Get_Part_Spec(a.site,a.PartNo) partSpec,dbo.Get_orderView_liuhuaReportTime(a.site,a.OrderNo) as firstReportDate, |
|
|
|
Round(isnull(dbo.Get_orderView_liuhuaReport(a.site,a.OrderNo),0),3) as liuhuaReport , |
|
|
|
Round(isnull(dbo.Get_orderView_liuhuaFinish(a.site,a.OrderNo),0),3) as liuhuaFinish , |
|
|
|
Round(isnull(dbo.Get_orderView_routeReport(a.site,a.OrderNo,'修边'),0),3) as xiubianReport, |
|
|
|
Round(isnull(dbo.Get_orderView_routeReport(a.site,a.OrderNo,'烘烤'),0),3) as hongkaoReport, |
|
|
|
Round(isnull(dbo.Get_orderView_routeReport(a.site,a.OrderNo,'检验'),0),3) as jianyanReport, |
|
|
|
Round(isnull(dbo.Get_orderView_routeReport(a.site,a.OrderNo,'加工'),0),3) as jiagongReport, |
|
|
|
Round(isnull(dbo.Get_orderView_routeReport(a.site,a.OrderNo,'包装'),0),3) as baozhuangReport, |
|
|
|
Round(FinishedQty,3) FinishedQty , |
|
|
|
LotSize,NeedDate |
|
|
|
SELECT site, |
|
|
|
a.OrderNo, |
|
|
|
dbo.Get_Part_Spec(a.site, a.PartNo) partSpec, |
|
|
|
dbo.Get_orderView_liuhuaReportTime(a.site, a.OrderNo) as firstReportDate, |
|
|
|
Round(isnull(dbo.Get_orderView_liuhuaReport(a.site, a.OrderNo), 0), 3) as liuhuaReport, |
|
|
|
Round(isnull(dbo.Get_orderView_liuhuaFinish(a.site, a.OrderNo), 0), 3) as liuhuaFinish, |
|
|
|
Round(isnull(dbo.Get_orderView_routeReport(a.site, a.OrderNo, '修边'), 0), 3) as xiubianReport, |
|
|
|
Round(isnull(dbo.Get_orderView_routeReport(a.site, a.OrderNo, '烘烤'), 0), 3) as hongkaoReport, |
|
|
|
Round(isnull(dbo.Get_orderView_routeReport(a.site, a.OrderNo, '检验'), 0), 3) as jianyanReport, |
|
|
|
Round(isnull(dbo.Get_orderView_routeReport(a.site, a.OrderNo, '加工'), 0), 3) as jiagongReport, |
|
|
|
Round(isnull(dbo.Get_orderView_routeReport(a.site, a.OrderNo, '包装'), 0), 3) as baozhuangReport, |
|
|
|
Round(FinishedQty, 3) as FinishedQty, |
|
|
|
dbo.Get_CustomerDesc(a.Site, a.CustomerID) as customerDesc, |
|
|
|
LotSize, |
|
|
|
NeedDate |
|
|
|
FROM ShopOrder a |
|
|
|
<where> |
|
|
|
<where> |
|
|
|
AND a.PartNo like 'FP%' |
|
|
|
AND a.status != '已取消' and a.status != '已计划' |
|
|
|
AND a.status != '已取消' |
|
|
|
and a.status != '已计划' |
|
|
|
<if test="partNo != null and partNo != ''"> |
|
|
|
and a.partNo like #{partNo} |
|
|
|
and a.partNo like #{partNo} |
|
|
|
</if> |
|
|
|
<if test="site != null and site != ''"> |
|
|
|
and site=#{site} |
|
|
|
<if test="site != null and site != ''"> |
|
|
|
and site = #{site} |
|
|
|
</if> |
|
|
|
<if test="orderNo != null and orderNo != ''"> |
|
|
|
and a.orderNo like #{orderNo} |
|
|
|
<if test="orderNo != null and orderNo != ''"> |
|
|
|
and a.orderNo like #{orderNo} |
|
|
|
</if> |
|
|
|
<if test="closedFlag != null and closedFlag != ''"> |
|
|
|
and a.status != '已关闭' |
|
|
|
<if test="closedFlag != null and closedFlag != ''"> |
|
|
|
and a.status != '已关闭' |
|
|
|
</if> |
|
|
|
<if test="partSpec != null and partSpec != ''"> |
|
|
|
and dbo.Get_Part_Spec(a.site,a.PartNo) like #{partSpec} |
|
|
|
<if test="partSpec != null and partSpec != ''"> |
|
|
|
and dbo.Get_Part_Spec(a.site, a.PartNo) like #{partSpec} |
|
|
|
</if> |
|
|
|
<if test="startDate != null "> |
|
|
|
AND a.EnterDate >= #{startDate} |
|
|
|
<if test="startDate != null"> |
|
|
|
AND a.EnterDate >= #{startDate} |
|
|
|
</if> |
|
|
|
<if test="endDate != null "> |
|
|
|
AND #{endDate} >= DATEADD(dd, -1, a.EnterDate) |
|
|
|
<if test="endDate != null"> |
|
|
|
AND #{endDate} >= DATEADD(dd, -1, a.EnterDate) |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
<if test="customerId != null and customerId != ''"> |
|
|
|
AND a.CustomerID like #{customerId} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|