Browse Source

2025-12-26

订单产出标签报表优化
master
fengyuan_yang 3 weeks ago
parent
commit
7d430d054c
  1. 9
      src/main/java/com/gaotao/modules/rollNoReview/data/SFDCRollsOutData.java
  2. 40
      src/main/resources/mapper/shopOrder/ProductionReportMapper.xml

9
src/main/java/com/gaotao/modules/rollNoReview/data/SFDCRollsOutData.java

@ -69,6 +69,15 @@ public class SFDCRollsOutData {
private Integer defectQty; private Integer defectQty;
private Integer totalQty; private Integer totalQty;
private BigDecimal yieldRate; private BigDecimal yieldRate;
private String userName;
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public Integer getGoodQty() { public Integer getGoodQty() {
return goodQty; return goodQty;

40
src/main/resources/mapper/shopOrder/ProductionReportMapper.xml

@ -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>
Loading…
Cancel
Save