|
|
|
@ -5,22 +5,52 @@ |
|
|
|
<!-- 基础字段映射 --> |
|
|
|
<sql id="Base_Column_List"> |
|
|
|
id,site,supplier_no,supplier_name,supplier_group,create_date,create_by,update_date,update_by,supplier_doc_type, |
|
|
|
TaxCode,tax,FaxNo,PhoneNo,PhoneNo2,PhoneNo3,Contact,Address,PaymentTerm,DeliveryTerm,Buyer,SourcingStaff, |
|
|
|
Currency,ABC,Active,BankName,BankAccount,TaxNo,Email,Email2,Other_contact1,Other_contact2,Other_contact3,Memo |
|
|
|
TaxCode,FaxNo,PhoneNo,Contact,Address,PaymentTerm,DeliveryTerm,Buyer,Currency,ABC,Active,CreateDate,BankName,BankAccount, |
|
|
|
TaxNo,Email,Memo,CustomerAddress,Tax,Email2,PhoneNo2,PhoneNo3,SourcingStaff,Other_contact1,Other_contact2,Other_contact3, |
|
|
|
c_short_office,c_short_npc |
|
|
|
</sql> |
|
|
|
|
|
|
|
|
|
|
|
<select id="searchSrmSupplierList" resultType="SrmSupplierData"> |
|
|
|
SELECT |
|
|
|
s.id,s.site,s.supplier_no,s.supplier_name,s.supplier_group,sg.GroupDesc AS groupDesc,s.supplier_doc_type, |
|
|
|
s.create_date,s.create_by,s.update_date,s.update_by,s.Buyer,s.SourcingStaff AS sourcingStaff,s.PhoneNo, |
|
|
|
s.PhoneNo2,s.PhoneNo3,s.FaxNo,s.Contact,s.Address,s.Email,s.Email2, |
|
|
|
s.PaymentTerm,pt.payment_term AS paymentTermDesc, |
|
|
|
s.DeliveryTerm,dt.delivery_term AS deliveryTermDesc, |
|
|
|
s.Currency, s.TaxCode,t.tax_desc AS taxDesc,s.tax AS taxRate, |
|
|
|
s.ABC,s.Active,s.BankName,s.BankAccount,s.TaxNo, |
|
|
|
s.Other_contact1,s.Other_contact2,s.Other_contact3, |
|
|
|
s.Memo |
|
|
|
s.id AS id, |
|
|
|
s.site AS site, |
|
|
|
s.supplier_no AS supplierNo, |
|
|
|
s.supplier_name AS supplierName, |
|
|
|
s.supplier_group AS supplierGroup, |
|
|
|
sg.GroupDesc AS groupDesc, |
|
|
|
s.supplier_doc_type AS supplierDocType, |
|
|
|
s.create_date AS createDate, |
|
|
|
s.create_by AS createBy, |
|
|
|
s.update_date AS updateDate, |
|
|
|
s.update_by AS updateBy, |
|
|
|
s.Buyer AS buyer, |
|
|
|
s.SourcingStaff AS sourcingStaff, |
|
|
|
s.PhoneNo AS phoneNo, |
|
|
|
s.PhoneNo2 AS phoneNo2, |
|
|
|
s.PhoneNo3 AS phoneNo3, |
|
|
|
s.FaxNo AS faxNo, |
|
|
|
s.Contact AS contact, |
|
|
|
s.Address AS address, |
|
|
|
s.Email AS email, |
|
|
|
s.Email2 AS email2, |
|
|
|
s.PaymentTerm AS paymentTerm, |
|
|
|
pt.payment_term AS paymentTermDesc, |
|
|
|
s.DeliveryTerm AS deliveryTerm, |
|
|
|
dt.delivery_term AS deliveryTermDesc, |
|
|
|
s.Currency AS currency, |
|
|
|
s.TaxCode AS taxCode, |
|
|
|
t.tax_desc AS taxDesc, |
|
|
|
s.tax AS tax, |
|
|
|
s.ABC AS abc, |
|
|
|
s.Active AS active, |
|
|
|
s.BankName AS bankName, |
|
|
|
s.BankAccount AS bankAccount, |
|
|
|
s.TaxNo AS taxNo, |
|
|
|
s.Other_contact1 AS otherContact1, |
|
|
|
s.Other_contact2 AS otherContact2, |
|
|
|
s.Other_contact3 AS otherContact3, |
|
|
|
s.Memo AS memo, s.c_short_office,s.c_short_npc |
|
|
|
FROM srm_supplier s LEFT JOIN SupplierGroup sg ON sg.supplier_group = s.supplier_group |
|
|
|
AND sg.Site = s.site LEFT JOIN Currency c ON c.Currency = s.Currency |
|
|
|
AND c.Site = s.site LEFT JOIN Tax t ON t.tax_code = s.TaxCode |
|
|
|
@ -58,7 +88,7 @@ |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
ORDER BY id |
|
|
|
ORDER BY s.id |
|
|
|
</select> |
|
|
|
<select id="checkSrmSupplierList" resultType="SrmSupplierData"> |
|
|
|
SELECT |
|
|
|
@ -312,7 +342,7 @@ |
|
|
|
Other_contact1, |
|
|
|
Other_contact2, |
|
|
|
Other_contact3, |
|
|
|
Memo |
|
|
|
Memo,c_short_office,c_short_npc |
|
|
|
) VALUES ( |
|
|
|
#{site}, |
|
|
|
#{supplierNo}, |
|
|
|
@ -334,7 +364,7 @@ |
|
|
|
#{paymentTerm}, |
|
|
|
#{deliveryTerm}, |
|
|
|
#{buyer}, |
|
|
|
#{sourcingstaff}, |
|
|
|
#{sourcingStaff}, |
|
|
|
#{currency}, |
|
|
|
#{abc}, |
|
|
|
#{active}, |
|
|
|
@ -346,87 +376,17 @@ |
|
|
|
#{otherContact1}, |
|
|
|
#{otherContact2}, |
|
|
|
#{otherContact3}, |
|
|
|
#{memo} |
|
|
|
#{memo},#{cShortOffice},#{cShortNpc} |
|
|
|
) |
|
|
|
</insert> |
|
|
|
|
|
|
|
<!-- 更新供应商 --> |
|
|
|
<update id="updateSrmSupplier" parameterType="com.xujie.modules.srm.entity.SrmSupplier"> |
|
|
|
UPDATE srm_supplier |
|
|
|
<set> |
|
|
|
<if test="supplierNo != null and supplierNo != ''"> |
|
|
|
supplier_no = #{supplierNo}, |
|
|
|
</if> |
|
|
|
<if test="supplierName != null and supplierName != ''"> |
|
|
|
supplier_name = #{supplierName}, |
|
|
|
</if> |
|
|
|
<if test="supplierGroup != null and supplierGroup != ''"> |
|
|
|
supplier_group = #{supplierGroup}, |
|
|
|
</if> |
|
|
|
<if test="active != null and active != ''"> |
|
|
|
active = #{active}, |
|
|
|
</if> |
|
|
|
<if test="supplierDocType != null and supplierDocType != ''"> |
|
|
|
supplier_doc_type = #{supplierDocType}, |
|
|
|
</if> |
|
|
|
<if test="taxCode != null and taxCode != ''"> |
|
|
|
taxCode = #{taxCode}, |
|
|
|
</if> |
|
|
|
<if test="abc != null and abc != ''"> |
|
|
|
abc = #{abc}, |
|
|
|
</if> |
|
|
|
<if test="sourcingstaff != null and sourcingstaff != ''"> |
|
|
|
sourcingStaff = #{sourcingstaff}, |
|
|
|
</if> |
|
|
|
<if test="currency != null and currency != ''"> |
|
|
|
currency = #{currency}, |
|
|
|
</if> |
|
|
|
<if test="paymentTerm != null and paymentTerm != ''"> |
|
|
|
paymentTerm = #{paymentTerm}, |
|
|
|
</if> |
|
|
|
<if test="deliveryTerm != null and deliveryTerm != ''"> |
|
|
|
deliveryTerm = #{deliveryTerm}, |
|
|
|
</if> |
|
|
|
<if test="phoneNo != null and phoneNo != ''"> |
|
|
|
phoneNo = #{phoneNo}, |
|
|
|
</if> |
|
|
|
<if test="phoneNo2 != null and phoneNo2 != ''"> |
|
|
|
phoneNo2 = #{phoneNo2}, |
|
|
|
</if> |
|
|
|
<if test="phoneNo3 != null and phoneNo3 != ''"> |
|
|
|
phoneNo3 = #{phoneNo3}, |
|
|
|
</if> |
|
|
|
<if test="email != null and email != ''"> |
|
|
|
email = #{email}, |
|
|
|
</if> |
|
|
|
<if test="email2 != null and email2 != ''"> |
|
|
|
email2 = #{email2}, |
|
|
|
</if> |
|
|
|
<if test="faxNo != null and faxNo != ''"> |
|
|
|
faxNo = #{faxNo}, |
|
|
|
</if> |
|
|
|
<if test="otherContact1 != null and otherContact1 != ''"> |
|
|
|
otherContact1 = #{otherContact1}, |
|
|
|
</if> |
|
|
|
<if test="otherContact2 != null and otherContact2 != ''"> |
|
|
|
otherContact2 = #{otherContact2}, |
|
|
|
</if> |
|
|
|
<if test="otherContact3 != null and otherContact3 != ''"> |
|
|
|
otherContact3 = #{otherContact3}, |
|
|
|
</if> |
|
|
|
<if test="bankName != null and bankName != ''"> |
|
|
|
bankName = #{bankName}, |
|
|
|
</if> |
|
|
|
<if test="bankAccount != null and bankAccount != ''"> |
|
|
|
bankAccount = #{bankAccount}, |
|
|
|
</if> |
|
|
|
<if test="address != null and address != ''"> |
|
|
|
address = #{address}, |
|
|
|
</if> |
|
|
|
<if test="memo != null and memo != ''"> |
|
|
|
memo = #{memo}, |
|
|
|
</if> |
|
|
|
</set> |
|
|
|
UPDATE srm_supplier set supplier_name = #{supplierName}, supplier_group = #{supplierGroup}, active = #{active}, supplier_doc_type = #{supplierDocType}, |
|
|
|
taxCode = #{taxCode}, abc = #{abc}, sourcingStaff = #{sourcingStaff}, currency = #{currency}, paymentTerm = #{paymentTerm}, deliveryTerm = #{deliveryTerm}, |
|
|
|
phoneNo = #{phoneNo},phoneNo2 = #{phoneNo2},phoneNo3 = #{phoneNo3},email = #{email}, email2 = #{email2},faxNo = #{faxNo},Other_contact1 = #{otherContact1},Other_contact2 = #{otherContact2}, |
|
|
|
Other_contact3 = #{otherContact3},bankName= #{bankName},bankAccount = #{bankAccount}, address = #{address},memo = #{memo},c_short_office=#{cShortOffice},c_short_npc=#{cShortNpc} |
|
|
|
|
|
|
|
WHERE id = #{id} |
|
|
|
</update> |
|
|
|
|
|
|
|
|