You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
189 lines
13 KiB
189 lines
13 KiB
2 years ago
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||
|
<!DOCTYPE mapper
|
||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||
|
<mapper namespace="com.ruoyi.system.mapper.SysSupplierMapper">
|
||
|
|
||
|
<resultMap type="SysSupplier" id="SysSupplierResult">
|
||
|
<result property="supplierId" column="supplier_id" />
|
||
|
<result property="supplierCode" column="supplier_code" />
|
||
|
<result property="supplierName" column="supplier_name" />
|
||
|
<result property="exportSales" column="export_sales" />
|
||
|
<result property="enterpriseName" column="enterprise_name" />
|
||
|
<result property="enterpriseNature" column="enterprise_nature" />
|
||
|
<result property="customerAddress" column="customer_address" />
|
||
|
<result property="manufacturerCategory" column="manufacturer_category" />
|
||
|
<result property="postalCode" column="postal_code" />
|
||
|
<result property="businessScope" column="business_scope" />
|
||
|
<result property="customerCountry" column="customer_country" />
|
||
|
<result property="establishedTime" column="established_time" />
|
||
|
<result property="legalRepresentative" column="legal_representative" />
|
||
|
<result property="customerContact" column="customer_contact" />
|
||
|
<result property="contactNumber" column="contact_number" />
|
||
|
<result property="customerFax" column="customer_fax" />
|
||
|
<result property="customerEmail" column="customer_email" />
|
||
|
<result property="website" column="website" />
|
||
|
<result property="paymentTerms" column="payment_terms" />
|
||
|
<result property="supplierDays" column="supplier_days" />
|
||
|
<result property="actualPaymentDays" column="actual_payment_days" />
|
||
|
<result property="settlementBank" column="settlement_bank" />
|
||
|
<result property="exchangeSettlementAccount" column="exchange_settlement_account" />
|
||
|
<result property="depositBank" column="deposit_bank" />
|
||
|
<result property="bankAccount" column="bank_account" />
|
||
|
<result property="rmbRegisteredCapital" column="rmb_registered_capital" />
|
||
|
<result property="industryCode" column="Industry_code" />
|
||
|
<result property="merchandiser" column="merchandiser" />
|
||
|
<result property="merchandiserTelephone" column="merchandiser_telephone" />
|
||
|
<result property="financialContact" column="financial_contact" />
|
||
|
<result property="confirmTax" column="confirm_tax" />
|
||
|
<result property="taxRate" column="tax_rate" />
|
||
|
<result property="firstAddTime" column="first_add_time" />
|
||
|
<result property="updateInfoTime" column="update_info_time" />
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id="selectSysSupplierVo">
|
||
|
select supplier_id, supplier_code, supplier_name, export_sales, enterprise_name, enterprise_nature, customer_address, manufacturer_category, postal_code, business_scope, customer_country, established_time, legal_representative, customer_contact, contact_number, customer_fax, customer_email, website, payment_terms, supplier_days, actual_payment_days, settlement_bank, exchange_settlement_account, deposit_bank, bank_account, rmb_registered_capital, Industry_code, merchandiser, merchandiser_telephone, financial_contact, confirm_tax, tax_rate, first_add_time, update_info_time from sys_supplier
|
||
|
</sql>
|
||
|
|
||
|
<select id="selectSysSupplierList" parameterType="SysSupplier" resultMap="SysSupplierResult">
|
||
|
<include refid="selectSysSupplierVo"/>
|
||
|
<where>
|
||
|
<if test="supplierCode != null and supplierCode != ''"> and supplier_code like concat('%', #{supplierCode}, '%')</if>
|
||
|
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
|
||
|
<if test="exportSales != null and exportSales != ''"> and export_sales = #{exportSales}</if>
|
||
|
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
|
||
|
<if test="customerContact != null and customerContact != ''"> and customer_contact like concat('%', #{customerContact}, '%')</if>
|
||
|
<if test="merchandiser != null and merchandiser != ''"> and merchandiser like concat('%', #{merchandiser}, '%')</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="selectSysSupplierById" parameterType="Long" resultMap="SysSupplierResult">
|
||
|
<include refid="selectSysSupplierVo"/>
|
||
|
where supplier_id = #{supplierId}
|
||
|
</select>
|
||
|
<select id="selectSysSupplierBycode" resultMap="SysSupplierResult">
|
||
|
select supplier_code,supplier_name from sys_supplier
|
||
|
</select>
|
||
|
<insert id="insertSysSupplier" parameterType="SysSupplier" useGeneratedKeys="true" keyProperty="supplierId">
|
||
|
insert into sys_supplier
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="supplierCode != null and supplierCode != ''">supplier_code,</if>
|
||
|
<if test="supplierName != null and supplierName != ''">supplier_name,</if>
|
||
|
<if test="exportSales != null and exportSales != ''">export_sales,</if>
|
||
|
<if test="enterpriseName != null">enterprise_name,</if>
|
||
|
<if test="enterpriseNature != null">enterprise_nature,</if>
|
||
|
<if test="customerAddress != null and customerAddress != ''">customer_address,</if>
|
||
|
<if test="manufacturerCategory != null">manufacturer_category,</if>
|
||
|
<if test="postalCode != null">postal_code,</if>
|
||
|
<if test="businessScope != null">business_scope,</if>
|
||
|
<if test="customerCountry != null">customer_country,</if>
|
||
|
<if test="establishedTime != null">established_time,</if>
|
||
|
<if test="legalRepresentative != null">legal_representative,</if>
|
||
|
<if test="customerContact != null and customerContact != ''">customer_contact,</if>
|
||
|
<if test="contactNumber != null and contactNumber != ''">contact_number,</if>
|
||
|
<if test="customerFax != null">customer_fax,</if>
|
||
|
<if test="customerEmail != null">customer_email,</if>
|
||
|
<if test="website != null">website,</if>
|
||
|
<if test="paymentTerms != null">payment_terms,</if>
|
||
|
<if test="supplierDays != null">supplier_days,</if>
|
||
|
<if test="actualPaymentDays != null">actual_payment_days,</if>
|
||
|
<if test="settlementBank != null">settlement_bank,</if>
|
||
|
<if test="exchangeSettlementAccount != null">exchange_settlement_account,</if>
|
||
|
<if test="depositBank != null">deposit_bank,</if>
|
||
|
<if test="bankAccount != null">bank_account,</if>
|
||
|
<if test="rmbRegisteredCapital != null">rmb_registered_capital,</if>
|
||
|
<if test="industryCode != null">Industry_code,</if>
|
||
|
<if test="merchandiser != null">merchandiser,</if>
|
||
|
<if test="merchandiserTelephone != null">merchandiser_telephone,</if>
|
||
|
<if test="financialContact != null">financial_contact,</if>
|
||
|
<if test="confirmTax != null">confirm_tax,</if>
|
||
|
<if test="taxRate != null">tax_rate,</if>
|
||
|
first_add_time,
|
||
|
</trim>
|
||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
<if test="supplierCode != null and supplierCode != ''">#{supplierCode},</if>
|
||
|
<if test="supplierName != null and supplierName != ''">#{supplierName},</if>
|
||
|
<if test="exportSales != null and exportSales != ''">#{exportSales},</if>
|
||
|
<if test="enterpriseName != null">#{enterpriseName},</if>
|
||
|
<if test="enterpriseNature != null">#{enterpriseNature},</if>
|
||
|
<if test="customerAddress != null and customerAddress != ''">#{customerAddress},</if>
|
||
|
<if test="manufacturerCategory != null">#{manufacturerCategory},</if>
|
||
|
<if test="postalCode != null">#{postalCode},</if>
|
||
|
<if test="businessScope != null">#{businessScope},</if>
|
||
|
<if test="customerCountry != null">#{customerCountry},</if>
|
||
|
<if test="establishedTime != null">#{establishedTime},</if>
|
||
|
<if test="legalRepresentative != null">#{legalRepresentative},</if>
|
||
|
<if test="customerContact != null and customerContact != ''">#{customerContact},</if>
|
||
|
<if test="contactNumber != null and contactNumber != ''">#{contactNumber},</if>
|
||
|
<if test="customerFax != null">#{customerFax},</if>
|
||
|
<if test="customerEmail != null">#{customerEmail},</if>
|
||
|
<if test="website != null">#{website},</if>
|
||
|
<if test="paymentTerms != null">#{paymentTerms},</if>
|
||
|
<if test="supplierDays != null">#{supplierDays},</if>
|
||
|
<if test="actualPaymentDays != null">#{actualPaymentDays},</if>
|
||
|
<if test="settlementBank != null">#{settlementBank},</if>
|
||
|
<if test="exchangeSettlementAccount != null">#{exchangeSettlementAccount},</if>
|
||
|
<if test="depositBank != null">#{depositBank},</if>
|
||
|
<if test="bankAccount != null">#{bankAccount},</if>
|
||
|
<if test="rmbRegisteredCapital != null">#{rmbRegisteredCapital},</if>
|
||
|
<if test="industryCode != null">#{industryCode},</if>
|
||
|
<if test="merchandiser != null">#{merchandiser},</if>
|
||
|
<if test="merchandiserTelephone != null">#{merchandiserTelephone},</if>
|
||
|
<if test="financialContact != null">#{financialContact},</if>
|
||
|
<if test="confirmTax != null">#{confirmTax},</if>
|
||
|
<if test="taxRate != null">#{taxRate},</if>
|
||
|
now(),
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<update id="updateSysSupplier" parameterType="SysSupplier">
|
||
|
update sys_supplier
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="supplierCode != null and supplierCode != ''">supplier_code = #{supplierCode},</if>
|
||
|
<if test="supplierName != null and supplierName != ''">supplier_name = #{supplierName},</if>
|
||
|
<if test="exportSales != null and exportSales != ''">export_sales = #{exportSales},</if>
|
||
|
<if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if>
|
||
|
<if test="enterpriseNature != null">enterprise_nature = #{enterpriseNature},</if>
|
||
|
<if test="customerAddress != null and customerAddress != ''">customer_address = #{customerAddress},</if>
|
||
|
<if test="manufacturerCategory != null">manufacturer_category = #{manufacturerCategory},</if>
|
||
|
<if test="postalCode != null">postal_code = #{postalCode},</if>
|
||
|
<if test="businessScope != null">business_scope = #{businessScope},</if>
|
||
|
<if test="customerCountry != null">customer_country = #{customerCountry},</if>
|
||
|
<if test="establishedTime != null">established_time = #{establishedTime},</if>
|
||
|
<if test="legalRepresentative != null">legal_representative = #{legalRepresentative},</if>
|
||
|
<if test="customerContact != null and customerContact != ''">customer_contact = #{customerContact},</if>
|
||
|
<if test="contactNumber != null and contactNumber != ''">contact_number = #{contactNumber},</if>
|
||
|
<if test="customerFax != null">customer_fax = #{customerFax},</if>
|
||
|
<if test="customerEmail != null">customer_email = #{customerEmail},</if>
|
||
|
<if test="website != null">website = #{website},</if>
|
||
|
<if test="paymentTerms != null">payment_terms = #{paymentTerms},</if>
|
||
|
<if test="supplierDays != null">supplier_days = #{supplierDays},</if>
|
||
|
<if test="actualPaymentDays != null">actual_payment_days = #{actualPaymentDays},</if>
|
||
|
<if test="settlementBank != null">settlement_bank = #{settlementBank},</if>
|
||
|
<if test="exchangeSettlementAccount != null">exchange_settlement_account = #{exchangeSettlementAccount},</if>
|
||
|
<if test="depositBank != null">deposit_bank = #{depositBank},</if>
|
||
|
<if test="bankAccount != null">bank_account = #{bankAccount},</if>
|
||
|
<if test="rmbRegisteredCapital != null">rmb_registered_capital = #{rmbRegisteredCapital},</if>
|
||
|
<if test="industryCode != null">Industry_code = #{industryCode},</if>
|
||
|
<if test="merchandiser != null">merchandiser = #{merchandiser},</if>
|
||
|
<if test="merchandiserTelephone != null">merchandiser_telephone = #{merchandiserTelephone},</if>
|
||
|
<if test="financialContact != null">financial_contact = #{financialContact},</if>
|
||
|
<if test="confirmTax != null">confirm_tax = #{confirmTax},</if>
|
||
|
<if test="taxRate != null">tax_rate = #{taxRate},</if>
|
||
|
update_info_time = CONCAT_WS(',',NOW(),update_info_time),
|
||
|
</trim>
|
||
|
where supplier_id = #{supplierId}
|
||
|
</update>
|
||
|
|
||
|
<delete id="deleteSysSupplierById" parameterType="Long">
|
||
|
delete from sys_supplier where supplier_id = #{supplierId}
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deleteSysSupplierByIds" parameterType="String">
|
||
|
delete from sys_supplier where supplier_id in
|
||
|
<foreach item="supplierId" collection="array" open="(" separator="," close=")">
|
||
|
#{supplierId}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
|
||
|
</mapper>
|