代码优化
This commit is contained in:
@ -37,6 +37,7 @@
|
||||
and supplier_id = #{vo.supplierId}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectCoscoSupplierBankList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierBank" resultMap="CoscoSupplierBankResult">
|
||||
|
@ -150,6 +150,130 @@
|
||||
|
||||
|
||||
|
||||
<select id="selectWzrPageList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierBase" resultMap="CoscoSupplierBaseResult">
|
||||
<include refid="selectCoscoSupplierBaseVo"/>
|
||||
WHERE
|
||||
id NOT IN (
|
||||
SELECT
|
||||
cas.supplier_id
|
||||
FROM
|
||||
cosco_access_work caw
|
||||
LEFT JOIN cosco_access_supplier cas ON caw.id = cas.access_work_id
|
||||
WHERE
|
||||
(
|
||||
caw.approve_status IS NULL
|
||||
OR caw.approve_status IN ( 0, 1 ))
|
||||
<if test="vo.deptId != null and vo.deptId != ''">
|
||||
AND cas.dept_id IN (#{vo.deptId})
|
||||
</if>
|
||||
)
|
||||
<if test="vo.supplierType != null and vo.supplierType != ''">
|
||||
and supplier_type = #{vo.supplierType}
|
||||
</if>
|
||||
<if test="vo.licenceAccessory != null and vo.licenceAccessory != ''">
|
||||
and licence_accessory = #{vo.licenceAccessory}
|
||||
</if>
|
||||
<if test="vo.licenceDate != null and vo.licenceDate != ''">
|
||||
and licence_date = #{vo.licenceDate}
|
||||
</if>
|
||||
<if test="vo.enterpriseType != null and vo.enterpriseType != ''">
|
||||
and enterprise_type = #{vo.enterpriseType}
|
||||
</if>
|
||||
<if test="vo.name != null and vo.name != ''">
|
||||
and name like concat('%', #{vo.name}, '%')
|
||||
</if>
|
||||
<if test="vo.nameEn != null and vo.nameEn != ''">
|
||||
and name_en = #{vo.nameEn}
|
||||
</if>
|
||||
<if test="vo.socialCreditCode != null and vo.socialCreditCode != ''">
|
||||
and social_credit_code = #{vo.socialCreditCode}
|
||||
</if>
|
||||
<if test="vo.range != null and vo.range != ''">
|
||||
and `range` = #{vo.range}
|
||||
</if>
|
||||
<if test="vo.regAddress != null and vo.regAddress != ''">
|
||||
and reg_address = #{vo.regAddress}
|
||||
</if>
|
||||
<if test="vo.workAddress != null and vo.workAddress != ''">
|
||||
and work_address = #{vo.workAddress}
|
||||
</if>
|
||||
<if test="vo.parentCompanyInvestor != null and vo.parentCompanyInvestor != ''">
|
||||
and parent_company_investor = #{vo.parentCompanyInvestor}
|
||||
</if>
|
||||
<if test="vo.legalPerson != null and vo.legalPerson != ''">
|
||||
and legal_person = #{vo.legalPerson}
|
||||
</if>
|
||||
<if test="vo.idCard != null and vo.idCard != ''">
|
||||
and id_card = #{vo.idCard}
|
||||
</if>
|
||||
<if test="vo.capital != null ">
|
||||
and capital = #{vo.capital}
|
||||
</if>
|
||||
<if test="vo.contactsName != null and vo.contactsName != ''">
|
||||
and contacts_name like concat('%', #{vo.contactsName}, '%')
|
||||
</if>
|
||||
<if test="vo.contactsPhone != null and vo.contactsPhone != ''">
|
||||
and contacts_phone = #{vo.contactsPhone}
|
||||
</if>
|
||||
<if test="vo.contactsType != null and vo.contactsType != ''">
|
||||
and contacts_type = #{vo.contactsType}
|
||||
</if>
|
||||
<if test="vo.contactsEmail != null and vo.contactsEmail != ''">
|
||||
and contacts_email = #{vo.contactsEmail}
|
||||
</if>
|
||||
<if test="vo.telephone != null and vo.telephone != ''">
|
||||
and telephone = #{telephone}
|
||||
</if>
|
||||
<if test="vo.nation != null and vo.nation != ''">
|
||||
and nation = #{nation}
|
||||
</if>
|
||||
<if test="vo.vat != null and vo.vat != ''">
|
||||
and vat = #{vo.vat}
|
||||
</if>
|
||||
<if test="vo.taxpayerId != null and vo.taxpayerId != ''">
|
||||
and taxpayer_id = #{vo.taxpayerId}
|
||||
</if>
|
||||
<if test="vo.currency != null and vo.currency != ''">
|
||||
and currency = #{vo.currency}
|
||||
</if>
|
||||
<if test="vo.personName != null and vo.personName != ''">
|
||||
and person_name like concat('%', #{vo.personName}, '%')
|
||||
</if>
|
||||
<if test="vo.personPhone != null and vo.personPhone != ''">
|
||||
and person_phone = #{vo.personPhone}
|
||||
</if>
|
||||
<if test="vo.personBank != null and vo.personBank != ''">
|
||||
and person_bank = #{vo.personBank}
|
||||
</if>
|
||||
<if test="vo.personAccount != null and vo.personAccount != ''">
|
||||
and person_account = #{vo.personAccount}
|
||||
</if>
|
||||
<if test="vo.accessStatus != null ">
|
||||
and access_status = #{vo.accessStatus}
|
||||
</if>
|
||||
<if test="vo.blacklistStatus != null ">
|
||||
and blacklist_status = #{vo.blacklistStatus}
|
||||
</if>
|
||||
<if test="vo.greylistStatus != null ">
|
||||
and greylist_status = #{vo.greylistStatus}
|
||||
</if>
|
||||
<if test="vo.fillinStatus != null ">
|
||||
and fillin_status = #{vo.fillinStatus}
|
||||
</if>
|
||||
<if test="vo.fillinBy != null and vo.fillinBy != ''">
|
||||
and fillin_by = #{vo.fillinBy}
|
||||
</if>
|
||||
<if test="vo.sapCode != null and vo.sapCode != ''">
|
||||
and sap_code = #{vo.sapCode}
|
||||
</if>
|
||||
<if test="vo.lastUpdateTime != null ">
|
||||
and last_update_time = #{vo.lastUpdateTime}
|
||||
</if>
|
||||
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="selectPageList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierBase" resultMap="CoscoSupplierBaseResult">
|
||||
<include refid="selectCoscoSupplierBaseVo"/>
|
||||
|
@ -37,36 +37,6 @@
|
||||
<result property="supplierChangeApplyId" column="supplier_change_apply_id"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="supplierChangeDiffResultMap" type="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.SupplierChangeDiffResult">
|
||||
<result property="supplierTypeDiff" column="supplier_type_diff"/>
|
||||
<result property="licenceAccessoryDiff" column="licence_accessory_diff"/>
|
||||
<result property="licenceDateDiff" column="licence_date_diff"/>
|
||||
<result property="enterpriseTypeDiff" column="enterprise_type_diff"/>
|
||||
<result property="nameDiff" column="name_diff"/>
|
||||
<result property="nameEnDiff" column="name_en_diff"/>
|
||||
<result property="socialCreditCodeDiff" column="social_credit_code_diff"/>
|
||||
<result property="rangeDiff" column="range_diff"/>
|
||||
<result property="regAddressDiff" column="reg_address_diff"/>
|
||||
<result property="workAddressDiff" column="work_address_diff"/>
|
||||
<result property="parentCompanyInvestorDiff" column="parent_company_investor_diff"/>
|
||||
<result property="legalPersonDiff" column="legal_person_diff"/>
|
||||
<result property="idCardDiff" column="id_card_diff"/>
|
||||
<result property="capitalDiff" column="capital_diff"/>
|
||||
<result property="contactsNameDiff" column="contacts_name_diff"/>
|
||||
<result property="contactsPhoneDiff" column="contacts_phone_diff"/>
|
||||
<result property="contactsTypeDiff" column="contacts_type_diff"/>
|
||||
<result property="contactsEmailDiff" column="contacts_email_diff"/>
|
||||
<result property="telephoneDiff" column="telephone_diff"/>
|
||||
<result property="nationDiff" column="nation_diff"/>
|
||||
<result property="vatDiff" column="vat_diff"/>
|
||||
<result property="taxpayerIdDiff" column="taxpayer_id_diff"/>
|
||||
<result property="currencyDiff" column="currency_diff"/>
|
||||
<result property="personNameDiff" column="person_name_diff"/>
|
||||
<result property="personPhoneDiff" column="person_phone_diff"/>
|
||||
<result property="personBankDiff" column="person_bank_diff"/>
|
||||
<result property="personAccountDiff" column="person_account_diff"/>
|
||||
<result property="remarkDiff" column="remark_diff"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCoscoSupplierChangeBaseVo">
|
||||
select id, supplier_type, licence_accessory, licence_date, enterprise_type, name, name_en, social_credit_code, `range`, reg_address, work_address, parent_company_investor, legal_person, id_card, capital, contacts_name, contacts_phone, contacts_type, contacts_email, telephone, nation, vat, taxpayer_id, currency, person_name, person_phone, person_bank, person_account, remark, supplier_change_apply_id
|
||||
@ -164,107 +134,6 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectDiff" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierChangeBase" resultMap="supplierChangeDiffResultMap">
|
||||
SELECT
|
||||
CASE WHEN a.supplier_type != b.supplier_type OR (a.supplier_type IS NULL XOR b.supplier_type IS NULL)
|
||||
THEN CONCAT('供应商身份类型: 变更前: ', a.supplier_type, ' 变更后: ', b.supplier_type) ELSE NULL END AS supplier_type_diff,
|
||||
CASE WHEN a.licence_accessory != b.licence_accessory OR (a.licence_accessory IS NULL XOR b.licence_accessory IS NULL)
|
||||
THEN CONCAT('营业执照附件: 变更前: ', a.licence_accessory, ' 变更后: ', b.licence_accessory) ELSE NULL END AS licence_accessory_diff,
|
||||
CASE WHEN a.licence_date != b.licence_date OR (a.licence_date IS NULL XOR b.licence_date IS NULL)
|
||||
THEN CONCAT('营业执照有效期: 变更前: ', a.licence_date, ' 变更后: ', b.licence_date) ELSE NULL END AS licence_date_diff,
|
||||
CASE WHEN a.enterprise_type != b.enterprise_type OR (a.enterprise_type IS NULL XOR b.enterprise_type IS NULL)
|
||||
THEN CONCAT('企业类型: 变更前: ', a.enterprise_type, ' 变更后: ', b.enterprise_type) ELSE NULL END AS enterprise_type_diff,
|
||||
CASE WHEN a.name != b.name OR (a.name IS NULL XOR b.name IS NULL)
|
||||
THEN CONCAT('企业名称: 变更前: ', a.name, ' 变更后: ', b.name) ELSE NULL END AS name_diff,
|
||||
CASE WHEN a.name_en != b.name_en OR (a.name_en IS NULL XOR b.name_en IS NULL)
|
||||
THEN CONCAT('企业英文名称: 变更前: ', a.name_en, ' 变更后: ', b.name_en) ELSE NULL END AS name_en_diff,
|
||||
CASE WHEN a.social_credit_code != b.social_credit_code OR (a.social_credit_code IS NULL XOR b.social_credit_code IS NULL)
|
||||
THEN CONCAT('统一社会信用代码: 变更前: ', a.social_credit_code, ' 变更后: ', b.social_credit_code) ELSE NULL END AS social_credit_code_diff,
|
||||
CASE WHEN a.range != b.range OR (a.range IS NULL XOR b.range IS NULL)
|
||||
THEN CONCAT('经营范围: 变更前: ', a.range, ' 变更后: ', b.range) ELSE NULL END AS range_diff,
|
||||
CASE WHEN a.reg_address != b.reg_address OR (a.reg_address IS NULL XOR b.reg_address IS NULL)
|
||||
THEN CONCAT('注册地址: 变更前: ', a.reg_address, ' 变更后: ', b.reg_address) ELSE NULL END AS reg_address_diff,
|
||||
CASE WHEN a.work_address != b.work_address OR (a.work_address IS NULL XOR b.work_address IS NULL)
|
||||
THEN CONCAT('办公地址: 变更前: ', a.work_address, ' 变更后: ', b.work_address) ELSE NULL END AS work_address_diff,
|
||||
CASE WHEN a.parent_company_investor != b.parent_company_investor OR (a.parent_company_investor IS NULL XOR b.parent_company_investor IS NULL)
|
||||
THEN CONCAT('母公司/出资人信息: 变更前: ', a.parent_company_investor, ' 变更后: ', b.parent_company_investor) ELSE NULL END AS parent_company_investor_diff,
|
||||
CASE WHEN a.legal_person != b.legal_person OR (a.legal_person IS NULL XOR b.legal_person IS NULL)
|
||||
THEN CONCAT('法定代表人: 变更前: ', a.legal_person, ' 变更后: ', b.legal_person) ELSE NULL END AS legal_person_diff,
|
||||
CASE WHEN a.id_card != b.id_card OR (a.id_card IS NULL XOR b.id_card IS NULL)
|
||||
THEN CONCAT('身份证号: 变更前: ', a.id_card, ' 变更后: ', b.id_card) ELSE NULL END AS id_card_diff,
|
||||
CASE WHEN a.capital != b.capital OR (a.capital IS NULL XOR b.capital IS NULL)
|
||||
THEN CONCAT('注册资本(万元): 变更前: ', a.capital, ' 变更后: ', b.capital) ELSE NULL END AS capital_diff,
|
||||
CASE WHEN a.contacts_name != b.contacts_name OR (a.contacts_name IS NULL XOR b.contacts_name IS NULL)
|
||||
THEN CONCAT('联系人姓名: 变更前: ', a.contacts_name, ' 变更后: ', b.contacts_name) ELSE NULL END AS contacts_name_diff,
|
||||
CASE WHEN a.contacts_phone != b.contacts_phone OR (a.contacts_phone IS NULL XOR b.contacts_phone IS NULL)
|
||||
THEN CONCAT('联系人手机: 变更前: ', a.contacts_phone, ' 变更后: ', b.contacts_phone) ELSE NULL END AS contacts_phone_diff,
|
||||
CASE WHEN a.contacts_type != b.contacts_type OR (a.contacts_type IS NULL XOR b.contacts_type IS NULL)
|
||||
THEN CONCAT('联系人身份类别: 变更前: ', a.contacts_type, ' 变更后: ', b.contacts_type) ELSE NULL END AS contacts_type_diff,
|
||||
CASE WHEN a.contacts_email != b.contacts_email OR (a.contacts_email IS NULL XOR b.contacts_email IS NULL)
|
||||
THEN CONCAT('联系人邮箱: 变更前: ', a.contacts_email, ' 变更后: ', b.contacts_email) ELSE NULL END AS contacts_email_diff,
|
||||
CASE WHEN a.telephone != b.telephone OR (a.telephone IS NULL XOR b.telephone IS NULL)
|
||||
THEN CONCAT('固定电话: 变更前: ', a.telephone, ' 变更后: ', b.telephone) ELSE NULL END AS telephone_diff,
|
||||
CASE WHEN a.nation != b.nation OR (a.nation IS NULL XOR b.nation IS NULL)
|
||||
THEN CONCAT('国家地区: 变更前: ', a.nation, ' 变更后: ', b.nation) ELSE NULL END AS nation_diff,
|
||||
CASE WHEN a.vat != b.vat OR (a.vat IS NULL XOR b.vat IS NULL)
|
||||
THEN CONCAT('增值税号: 变更前: ', a.vat, ' 变更后: ', b.vat) ELSE NULL END AS vat_diff,
|
||||
CASE WHEN a.taxpayer_id != b.taxpayer_id OR (a.taxpayer_id IS NULL XOR b.taxpayer_id IS NULL)
|
||||
THEN CONCAT('境外纳税人ID: 变更前: ', a.taxpayer_id, ' 变更后: ', b.taxpayer_id) ELSE NULL END AS taxpayer_id_diff,
|
||||
CASE WHEN a.currency != b.currency OR (a.currency IS NULL XOR b.currency IS NULL)
|
||||
THEN CONCAT('币种: 变更前: ', a.currency, ' 变更后: ', b.currency) ELSE NULL END AS currency_diff,
|
||||
CASE WHEN a.person_name != b.person_name OR (a.person_name IS NULL XOR b.person_name IS NULL)
|
||||
THEN CONCAT('个人姓名: 变更前: ', a.person_name, ' 变更后: ', b.person_name) ELSE NULL END AS person_name_diff,
|
||||
CASE WHEN a.person_phone != b.person_phone OR (a.person_phone IS NULL XOR b.person_phone IS NULL)
|
||||
THEN CONCAT('个人联系电话: 变更前: ', a.person_phone, ' 变更后: ', b.person_phone) ELSE NULL END AS person_phone_diff,
|
||||
CASE WHEN a.person_bank != b.person_bank OR (a.person_bank IS NULL XOR b.person_bank IS NULL)
|
||||
THEN CONCAT('个人开户行: 变更前: ', a.person_bank, ' 变更后: ', b.person_bank) ELSE NULL END AS person_bank_diff,
|
||||
CASE WHEN a.person_account != b.person_account OR (a.person_account IS NULL XOR b.person_account IS NULL)
|
||||
THEN CONCAT('个人银行账号: 变更前: ', a.person_account, ' 变更后: ', b.person_account) ELSE NULL END AS person_account_diff,
|
||||
CASE WHEN a.remark != b.remark OR (a.remark IS NULL XOR b.remark IS NULL)
|
||||
THEN CONCAT('备注: 变更前: ', a.remark, ' 变更后: ', b.remark) ELSE NULL END AS remark_diff
|
||||
FROM
|
||||
(SELECT * FROM cosco_supplier_change_base
|
||||
WHERE
|
||||
<if test="supplierId != null and supplierId != ''">
|
||||
supplier_id = #{supplierId}
|
||||
</if>
|
||||
<if test="supplierChangeApplyIdOld != null and supplierChangeApplyIdOld != ''">
|
||||
supplier_change_apply_id = #{supplierChangeApplyIdOld}
|
||||
</if>
|
||||
|
||||
) a,
|
||||
(SELECT * FROM cosco_supplier_change_base
|
||||
WHERE supplier_change_apply_id = #{supplierChangeApplyId}) b
|
||||
HAVING
|
||||
supplier_type_diff IS NOT NULL OR
|
||||
licence_accessory_diff IS NOT NULL OR
|
||||
licence_date_diff IS NOT NULL OR
|
||||
enterprise_type_diff IS NOT NULL OR
|
||||
name_diff IS NOT NULL OR
|
||||
name_en_diff IS NOT NULL OR
|
||||
social_credit_code_diff IS NOT NULL OR
|
||||
range_diff IS NOT NULL OR
|
||||
reg_address_diff IS NOT NULL OR
|
||||
work_address_diff IS NOT NULL OR
|
||||
parent_company_investor_diff IS NOT NULL OR
|
||||
legal_person_diff IS NOT NULL OR
|
||||
id_card_diff IS NOT NULL OR
|
||||
capital_diff IS NOT NULL OR
|
||||
contacts_name_diff IS NOT NULL OR
|
||||
contacts_phone_diff IS NOT NULL OR
|
||||
contacts_type_diff IS NOT NULL OR
|
||||
contacts_email_diff IS NOT NULL OR
|
||||
telephone_diff IS NOT NULL OR
|
||||
nation_diff IS NOT NULL OR
|
||||
vat_diff IS NOT NULL OR
|
||||
taxpayer_id_diff IS NOT NULL OR
|
||||
currency_diff IS NOT NULL OR
|
||||
person_name_diff IS NOT NULL OR
|
||||
person_phone_diff IS NOT NULL OR
|
||||
person_bank_diff IS NOT NULL OR
|
||||
person_account_diff IS NOT NULL OR
|
||||
remark_diff IS NOT NULL;
|
||||
</select>
|
||||
|
||||
<select id="selectCoscoSupplierChangeBaseById" parameterType="String"
|
||||
resultMap="CoscoSupplierChangeBaseResult">
|
||||
|
@ -18,31 +18,6 @@
|
||||
<result property="supplierChangeApplyId" column="supplier_change_apply_id"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="InvoiceChangeDiffResultMap" type="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.InvoiceChangeDiffVo">
|
||||
<!-- 纳税人类型变更对比 -->
|
||||
<result property="taxpayerTypeDiff" column="taxpayer_type_diff" />
|
||||
|
||||
<!-- 纳税人识别号变更对比 -->
|
||||
<result property="taxpayerCodeDiff" column="taxpayer_code_diff" />
|
||||
|
||||
<!-- 开票电话变更对比 -->
|
||||
<result property="phoneDiff" column="phone_diff" />
|
||||
|
||||
<!-- 开票户行账号变更对比 -->
|
||||
<result property="accountDiff" column="account_diff" />
|
||||
|
||||
<!-- 开票抬头变更对比 -->
|
||||
<result property="headDiff" column="head_diff" />
|
||||
|
||||
<!-- 开票地址变更对比 -->
|
||||
<result property="addressDiff" column="address_diff" />
|
||||
|
||||
<!-- 开票户行变更对比 -->
|
||||
<result property="bankDiff" column="bank_diff" />
|
||||
|
||||
<!-- 一般纳税人资格证明变更对比 -->
|
||||
<result property="qualificationCertificateDiff" column="qualification_certificate_diff" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectCoscoSupplierChangeInvoiceVo">
|
||||
@ -87,39 +62,6 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectInvoiceDitt" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierChangeInvoice" resultMap="InvoiceChangeDiffResultMap">
|
||||
SELECT
|
||||
CASE WHEN a.taxpayer_type != b.taxpayer_type OR (a.taxpayer_type IS NULL XOR b.taxpayer_type IS NULL)
|
||||
THEN CONCAT('纳税人类型: 变更前: ', a.taxpayer_type, ' 变更后: ', b.taxpayer_type) ELSE NULL END AS taxpayer_type_diff,
|
||||
CASE WHEN a.taxpayer_code != b.taxpayer_code OR (a.taxpayer_code IS NULL XOR b.taxpayer_code IS NULL)
|
||||
THEN CONCAT('纳税人识别号: 变更前: ', a.taxpayer_code, ' 变更后: ', b.taxpayer_code) ELSE NULL END AS taxpayer_code_diff,
|
||||
CASE WHEN a.phone != b.phone OR (a.phone IS NULL XOR b.phone IS NULL)
|
||||
THEN CONCAT('开票电话: 变更前: ', a.phone, ' 变更后: ', b.phone) ELSE NULL END AS phone_diff,
|
||||
CASE WHEN a.account != b.account OR (a.account IS NULL XOR b.account IS NULL)
|
||||
THEN CONCAT('开票户行账号: 变更前: ', a.account, ' 变更后: ', b.account) ELSE NULL END AS account_diff,
|
||||
CASE WHEN a.head != b.head OR (a.head IS NULL XOR b.head IS NULL)
|
||||
THEN CONCAT('开票抬头: 变更前: ', a.head, ' 变更后: ', b.head) ELSE NULL END AS head_diff,
|
||||
CASE WHEN a.address != b.address OR (a.address IS NULL XOR b.address IS NULL)
|
||||
THEN CONCAT('开票地址: 变更前: ', a.address, ' 变更后: ', b.address) ELSE NULL END AS address_diff,
|
||||
CASE WHEN a.bank != b.bank OR (a.bank IS NULL XOR b.bank IS NULL)
|
||||
THEN CONCAT('开票户行: 变更前: ', a.bank, ' 变更后: ', b.bank) ELSE NULL END AS bank_diff,
|
||||
CASE WHEN a.qualification_certificate != b.qualification_certificate OR (a.qualification_certificate IS NULL XOR b.qualification_certificate IS NULL)
|
||||
THEN CONCAT('一般纳税人资格证明: 变更前: ', a.qualification_certificate, ' 变更后: ', b.qualification_certificate) ELSE NULL END AS qualification_certificate_diff
|
||||
FROM
|
||||
(SELECT * FROM cosco_supplier_change_invoice
|
||||
WHERE supplier_id = #{oldSupplierId}) a, -- 变更前供应商ID
|
||||
(SELECT * FROM cosco_supplier_change_invoice
|
||||
WHERE supplier_id = #{newSupplierId}) b -- 变更后供应商ID
|
||||
HAVING
|
||||
taxpayer_type_diff IS NOT NULL OR
|
||||
taxpayer_code_diff IS NOT NULL OR
|
||||
phone_diff IS NOT NULL OR
|
||||
account_diff IS NOT NULL OR
|
||||
head_diff IS NOT NULL OR
|
||||
address_diff IS NOT NULL OR
|
||||
bank_diff IS NOT NULL OR
|
||||
qualification_certificate_diff IS NOT NULL;
|
||||
</select>
|
||||
|
||||
<select id="selectCoscoSupplierChangeInvoiceById" parameterType="String"
|
||||
resultMap="CoscoSupplierChangeInvoiceResult">
|
||||
|
Reference in New Issue
Block a user