@ -2,7 +2,7 @@
<mapper namespace= "com.heai.modules.production.dao.PrintLabelRecordMapper" >
<mapper namespace= "com.heai.modules.production.dao.PrintLabelRecordMapper" >
<select id= "handlerPrintBoxLabel" resultType= "java.util.Map" >
<select id= "handlerPrintBoxLabel" resultType= "java.util.Map" >
Select D.DelNotifyNo as batchNo
Select D.DelNotifyNo as batchNo
, '' as printerName
, '' as printerName
, 'N' as status
, 'N' as status
, D.DelnotifyNo as orderRef1
, D.DelnotifyNo as orderRef1
@ -18,19 +18,15 @@
, Convert(Integer, #{printTotalBoxCount}) as keyInfoInt1
, Convert(Integer, #{printTotalBoxCount}) as keyInfoInt1
, Convert(Integer, H.SeqNo - 1 + #{printBoxSeqNo}) as keyInfoInt2
, Convert(Integer, H.SeqNo - 1 + #{printBoxSeqNo}) as keyInfoInt2
, 'N/A' as keyInfoStr1
, 'N/A' as keyInfoStr1
, '' as keyInfoStr2
, C.ShortCustomerName as keyInfoStr2
, -1 as keyInfoFloat1
, -1 as keyInfoFloat1
, -1 as keyInfoFloat2
, -1 as keyInfoFloat2
, 1 as printQty
, 1 as printQty
, REPLACE(Address_E + ' Phone:' + S.PhoneNo + ' Email:' + S.Email, CHAR(13) + CHAR(10),
'') as siteDetail
, SiteName_E as siteName
, (case
when C.CustomerGroup = 'TBC' then CA.EndCustOurVendorCode
else C.OurVendorCode end) as endCustVendorCode
, REPLACE(Address_E + ' Phone:' + S.PhoneNo + ' Email:' + S.Email, CHAR(13) + CHAR(10),'') as siteDetail
, SiteName_E as siteName
, (case when C.CustomerGroup = 'TBC' then CA.EndCustOurVendorCode else C.OurVendorCode end) as endCustVendorCode
from CODelNotifyHeader as T
from CODelNotifyHeader as T
Left Join CustomerAddress as CA
On T.Site = CA.Site and T.CustomerID = CA.CustomerID and T.DelAddID = CA.AddressID
Left Join CustomerAddress as CA On T.Site = CA.Site and T.CustomerID = CA.CustomerID and T.DelAddID = CA.AddressID
Left join Customer as C on C.Site = T.Site and C.CustomerID = T.CustomerID
Left join Customer as C on C.Site = T.Site and C.CustomerID = T.CustomerID
, CODelNotifyDetail as D
, CODelNotifyDetail as D
, Dual as H
, Dual as H
@ -45,7 +41,7 @@
and H.SeqNo < = #{boxNum}
and H.SeqNo < = #{boxNum}
and #{boxNum} > 0
and #{boxNum} > 0
Union all
Union all
Select D.DelNotifyNo as batchNo
Select D.DelNotifyNo as batchNo
, '' as printerName
, '' as printerName
, 'N' as status
, 'N' as status
, D.DelnotifyNo as orderRef1
, D.DelnotifyNo as orderRef1
@ -61,22 +57,17 @@
, Convert(Integer, #{printTotalBoxCount}) as keyInfoInt1
, Convert(Integer, #{printTotalBoxCount}) as keyInfoInt1
, Convert(Integer, H.SeqNo - 1 + #{scatteredBoxNo}) as keyInfoInt2
, Convert(Integer, H.SeqNo - 1 + #{scatteredBoxNo}) as keyInfoInt2
, 'N/A' as keyInfoStr1
, 'N/A' as keyInfoStr1
, '' as keyInfoStr2
, C.ShortCustomerName as keyInfoStr2
, -1 as keyInfoFloat1
, -1 as keyInfoFloat1
, -1 as keyInfoFloat2
, -1 as keyInfoFloat2
, 1 as printQty
, 1 as printQty
, REPLACE(Address_E + ' Phone:' + S.PhoneNo + ' Email:' + S.Email, CHAR(13) + CHAR(10),
'') as siteDetail
, SiteName_E as siteName
, (case
when C.CustomerGroup = 'TBC' then CA.EndCustOurVendorCode
else C.OurVendorCode end) as endCustVendorCode
, REPLACE(Address_E + ' Phone:' + S.PhoneNo + ' Email:' + S.Email, CHAR(13) + CHAR(10),'') as siteDetail
, SiteName_E as siteName
, (case when C.CustomerGroup = 'TBC' then CA.EndCustOurVendorCode else C.OurVendorCode end) as endCustVendorCode
from CODelNotifyHeader as T
from CODelNotifyHeader as T
Left Join CustomerAddress as CA
On T.Site = CA.Site and T.CustomerID = CA.CustomerID and T.DelAddID = CA.AddressID
Left Join CustomerAddress as CA On T.Site = CA.Site and T.CustomerID = CA.CustomerID and T.DelAddID = CA.AddressID
Left join Customer as C on C.Site = T.Site and C.CustomerID = T.CustomerID
Left join Customer as C on C.Site = T.Site and C.CustomerID = T.CustomerID
, CODelNotifyDetail
as D
, CODelNotifyDetail as D
, Dual as H
, Dual as H
, Site as S
, Site as S
Where T.Site = D.Site
Where T.Site = D.Site