|
|
@ -267,9 +267,6 @@ |
|
|
a.partNo, |
|
|
a.partNo, |
|
|
p.PartDescription AS partDesc, |
|
|
p.PartDescription AS partDesc, |
|
|
p.Spec AS spec , |
|
|
p.Spec AS spec , |
|
|
a.partNo, |
|
|
|
|
|
p.PartDescription, |
|
|
|
|
|
p.Spec, |
|
|
|
|
|
ISNULL(R.good_qty, 0) as goodQty, |
|
|
ISNULL(R.good_qty, 0) as goodQty, |
|
|
ISNULL(R.surface_loss_qty, 0) as surfaceLossQty, |
|
|
ISNULL(R.surface_loss_qty, 0) as surfaceLossQty, |
|
|
ISNULL(R.poor_performance_qty, 0) as poorPerformanceQty, |
|
|
ISNULL(R.poor_performance_qty, 0) as poorPerformanceQty, |
|
|
@ -294,13 +291,14 @@ |
|
|
from ProductionReport |
|
|
from ProductionReport |
|
|
GROUP BY Site,order_no,roll_no,seq_no) R on r.Site = a.site and r.roll_no = a.RollNo |
|
|
GROUP BY Site,order_no,roll_no,seq_no) R on r.Site = a.site and r.roll_no = a.RollNo |
|
|
<where> |
|
|
<where> |
|
|
a.CreatedDate >= #{createdDate2} |
|
|
|
|
|
|
|
|
ISNULL(A.VirtualNewRollFlag,'Y') = 'N' |
|
|
|
|
|
AND a.site in (select site from AccessSite where userID = #{userName}) |
|
|
|
|
|
<if test=" createdDate2 != null"> |
|
|
|
|
|
AND CONVERT(varchar(10), a.CreatedDate, 120) >= #{createdDate2} |
|
|
|
|
|
</if> |
|
|
<if test=" createdDate3 != null"> |
|
|
<if test=" createdDate3 != null"> |
|
|
AND #{createdDate3} >= CONVERT(varchar(10), a.CreatedDate, 120) |
|
|
AND #{createdDate3} >= CONVERT(varchar(10), a.CreatedDate, 120) |
|
|
</if> |
|
|
</if> |
|
|
<if test=" Site != null and Site != ''"> |
|
|
|
|
|
AND A.site = #{Site} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" OrderNo != null and OrderNo != ''"> |
|
|
<if test=" OrderNo != null and OrderNo != ''"> |
|
|
AND A.OrderNo like '%'+#{OrderNo}+'%' |
|
|
AND A.OrderNo like '%'+#{OrderNo}+'%' |
|
|
</if> |
|
|
</if> |
|
|
@ -319,6 +317,15 @@ |
|
|
<if test=" consumeItemNo != null and consumeItemNo != ''"> |
|
|
<if test=" consumeItemNo != null and consumeItemNo != ''"> |
|
|
AND B.ItemNo like '%'+#{consumeItemNo}+'%' |
|
|
AND B.ItemNo like '%'+#{consumeItemNo}+'%' |
|
|
</if> |
|
|
</if> |
|
|
|
|
|
<if test=" partNo != null and partNo != ''"> |
|
|
|
|
|
AND A.partNo like '%'+#{partNo}+'%' |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" partDesc != null and partDesc != ''"> |
|
|
|
|
|
AND p.PartDescription like '%'+#{partDesc}+'%' |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" spec != null and spec != ''"> |
|
|
|
|
|
AND p.Spec like '%'+#{spec}+'%' |
|
|
|
|
|
</if> |
|
|
</where> |
|
|
</where> |
|
|
ORDER BY A.CreatedDate DESC |
|
|
ORDER BY A.CreatedDate DESC |
|
|
<if test="page != null and limit != null"> |
|
|
<if test="page != null and limit != null"> |
|
|
@ -331,14 +338,16 @@ |
|
|
SELECT COUNT(*) |
|
|
SELECT COUNT(*) |
|
|
FROM SFDC_Rolls A |
|
|
FROM SFDC_Rolls A |
|
|
LEFT JOIN SFDC_MaterialHist B ON A.Site = B.SITE AND A.OrderNo = B.OrderNo AND A.RollNo = B.StartFromRollNo |
|
|
LEFT JOIN SFDC_MaterialHist B ON A.Site = B.SITE AND A.OrderNo = B.OrderNo AND A.RollNo = B.StartFromRollNo |
|
|
|
|
|
LEFT JOIN part p ON A.site = p.site AND A.partNo = p.partNo |
|
|
<where> |
|
|
<where> |
|
|
a.CreatedDate >= #{createdDate2} |
|
|
|
|
|
|
|
|
ISNULL(A.VirtualNewRollFlag,'Y') = 'N' |
|
|
|
|
|
AND a.site in (select site from AccessSite where userID = #{userName}) |
|
|
|
|
|
<if test=" createdDate2 != null"> |
|
|
|
|
|
AND CONVERT(varchar(10), a.CreatedDate, 120) >= #{createdDate2} |
|
|
|
|
|
</if> |
|
|
<if test=" createdDate3 != null"> |
|
|
<if test=" createdDate3 != null"> |
|
|
AND #{createdDate3} >= CONVERT(varchar(10), a.CreatedDate, 120) |
|
|
AND #{createdDate3} >= CONVERT(varchar(10), a.CreatedDate, 120) |
|
|
</if> |
|
|
</if> |
|
|
<if test=" Site != null and Site != ''"> |
|
|
|
|
|
AND A.site = #{Site} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" OrderNo != null and OrderNo != ''"> |
|
|
<if test=" OrderNo != null and OrderNo != ''"> |
|
|
AND A.OrderNo like '%'+#{OrderNo}+'%' |
|
|
AND A.OrderNo like '%'+#{OrderNo}+'%' |
|
|
</if> |
|
|
</if> |
|
|
@ -357,6 +366,15 @@ |
|
|
<if test=" consumeItemNo != null and consumeItemNo != ''"> |
|
|
<if test=" consumeItemNo != null and consumeItemNo != ''"> |
|
|
AND B.ItemNo like '%'+#{consumeItemNo}+'%' |
|
|
AND B.ItemNo like '%'+#{consumeItemNo}+'%' |
|
|
</if> |
|
|
</if> |
|
|
|
|
|
<if test=" partNo != null and partNo != ''"> |
|
|
|
|
|
AND A.partNo like '%'+#{partNo}+'%' |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" partDesc != null and partDesc != ''"> |
|
|
|
|
|
AND p.PartDescription like '%'+#{partDesc}+'%' |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" spec != null and spec != ''"> |
|
|
|
|
|
AND p.Spec like '%'+#{spec}+'%' |
|
|
|
|
|
</if> |
|
|
</where> |
|
|
</where> |
|
|
</select> |
|
|
</select> |
|
|
</mapper> |
|
|
</mapper> |