万材erp项目
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.
 
 
 
 

247 lines
17 KiB

<?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.SysCustomerMapper">
<resultMap type="SysCustomer" id="SysCustomerResult">
<result property="customerId" column="customer_id" />
<result property="enterpriseCode" column="enterprise_code" />
<result property="exportSales" column="export_sales" />
<result property="enterpriseName" column="enterprise_name" />
<result property="englishName" column="english_name" />
<result property="customerAddress" column="customer_address" />
<result property="deliveryAddress" column="delivery_address" />
<result property="postalCode" column="postal_code" />
<result property="customerCountry" column="customer_country" />
<result property="commonCurrency" column="common_currency" />
<result property="customerRemarks" column="customer_remarks" />
<result property="legalRepresentative" column="legal_representative" />
<result property="invoicingCustomerName" column="invoicing_customer_name" />
<result property="invoicingCompanyName" column="invoicing_company_name" />
<result property="creditLimit" column="credit_limit" />
<result property="integrityRating" column="integrity_rating" />
<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="customerAbbreviation" column="customer_abbreviation" />
<result property="customsCode" column="customs_code" />
<result property="paymentTerms" column="payment_terms" />
<result property="invoiceCode" column="invoice_code" />
<result property="portOfDestination" column="port_of_destination" />
<result property="establishedTime" column="established_time" />
<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="registeredCapital" column="registered_capital" />
<result property="orderLength" column="order_length" />
<result property="shippingTemplate" column="shipping_template" />
<result property="businessMembers" column="business_members" />
<result property="destinationPortCode" column="destination_port_code" />
<result property="departurePotentialName" column="departure_potential_name" />
<result property="departurePotentialCode" column="departure_potential_code" />
<result property="unifiedNumbering" column="unified_numbering" />
<result property="shipmentUsage" column="shipment_usage" />
<result property="voucherPreparation" column="voucher_preparation" />
<result property="identifyingPeople" column="identifying_people" />
<result property="confirmTax" column="confirm_tax" />
<result property="taxRate" column="tax_rate" />
<result property="countryNumber" column="country_number" />
<result property="firstAddTime" column="first_add_time" />
<result property="updateInfoTime" column="update_info_time" />
</resultMap>
<sql id="selectSysCustomerVo">
select customer_id, enterprise_code, export_sales, enterprise_name, english_name, customer_address, delivery_address, postal_code, customer_country, common_currency, customer_remarks, legal_representative, invoicing_customer_name, invoicing_company_name, credit_limit, integrity_rating, customer_contact, contact_number, customer_fax, customer_email, customer_abbreviation, customs_code, payment_terms, invoice_code, port_of_destination, established_time, settlement_bank, exchange_settlement_account, deposit_bank, bank_account, rmb_registered_capital, registered_capital, order_length, shipping_template, business_members, destination_port_code, departure_potential_name, departure_potential_code, unified_numbering, shipment_usage, voucher_preparation, identifying_people, confirm_tax, tax_rate, country_number, first_add_time, update_info_time from sys_customer
</sql>
<select id="selectSysCustomerList" parameterType="SysCustomer" resultMap="SysCustomerResult">
<include refid="selectSysCustomerVo"/>
<where>
<if test="enterpriseCode != null and enterpriseCode != ''"> and enterprise_code like concat('%', #{enterpriseCode}, '%')</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="deliveryAddress != null and deliveryAddress != ''"> and delivery_address like concat('%', #{deliveryAddress}, '%')</if>
</where>
</select>
<select id="selectSysCustomerById" parameterType="Long" resultMap="SysCustomerResult">
<include refid="selectSysCustomerVo"/>
where customer_id = #{customerId}
</select>
<select id="selectSysCustomerBycode" resultMap="SysCustomerResult">
select enterprise_code,enterprise_name from sys_customer
</select>
<select id="selectSysCustomerByEnterpriseCode" parameterType="String" resultMap="SysCustomerResult">
<include refid="selectSysCustomerVo"/>
where enterprise_code = #{enterpriseCode}
</select>
<insert id="insertSysCustomer" parameterType="SysCustomer" useGeneratedKeys="true" keyProperty="customerId">
insert into sys_customer
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="enterpriseCode != null and enterpriseCode != ''">enterprise_code,</if>
<if test="exportSales != null">export_sales,</if>
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name,</if>
<if test="englishName != null">english_name,</if>
<if test="customerAddress != null">customer_address,</if>
<if test="deliveryAddress != null">delivery_address,</if>
<if test="postalCode != null">postal_code,</if>
<if test="customerCountry != null">customer_country,</if>
<if test="commonCurrency != null">common_currency,</if>
<if test="customerRemarks != null">customer_remarks,</if>
<if test="legalRepresentative != null">legal_representative,</if>
<if test="invoicingCustomerName != null">invoicing_customer_name,</if>
<if test="invoicingCompanyName != null">invoicing_company_name,</if>
<if test="creditLimit != null">credit_limit,</if>
<if test="integrityRating != null">integrity_rating,</if>
<if test="customerContact != null">customer_contact,</if>
<if test="contactNumber != null">contact_number,</if>
<if test="customerFax != null">customer_fax,</if>
<if test="customerEmail != null">customer_email,</if>
<if test="customerAbbreviation != null">customer_abbreviation,</if>
<if test="customsCode != null">customs_code,</if>
<if test="paymentTerms != null">payment_terms,</if>
<if test="invoiceCode != null">invoice_code,</if>
<if test="portOfDestination != null">port_of_destination,</if>
<if test="establishedTime != null">established_time,</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="registeredCapital != null">registered_capital,</if>
<if test="orderLength != null">order_length,</if>
<if test="shippingTemplate != null">shipping_template,</if>
<if test="businessMembers != null">business_members,</if>
<if test="destinationPortCode != null">destination_port_code,</if>
<if test="departurePotentialName != null">departure_potential_name,</if>
<if test="departurePotentialCode != null">departure_potential_code,</if>
<if test="unifiedNumbering != null">unified_numbering,</if>
<if test="shipmentUsage != null">shipment_usage,</if>
<if test="voucherPreparation != null">voucher_preparation,</if>
<if test="identifyingPeople != null">identifying_people,</if>
<if test="confirmTax != null">confirm_tax,</if>
<if test="taxRate != null">tax_rate,</if>
<if test="countryNumber != null">country_number,</if>
first_add_time,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="enterpriseCode != null and enterpriseCode != ''">#{enterpriseCode},</if>
<if test="exportSales != null">#{exportSales},</if>
<if test="enterpriseName != null and enterpriseName != ''">#{enterpriseName},</if>
<if test="englishName != null">#{englishName},</if>
<if test="customerAddress != null">#{customerAddress},</if>
<if test="deliveryAddress != null">#{deliveryAddress},</if>
<if test="postalCode != null">#{postalCode},</if>
<if test="customerCountry != null">#{customerCountry},</if>
<if test="commonCurrency != null">#{commonCurrency},</if>
<if test="customerRemarks != null">#{customerRemarks},</if>
<if test="legalRepresentative != null">#{legalRepresentative},</if>
<if test="invoicingCustomerName != null">#{invoicingCustomerName},</if>
<if test="invoicingCompanyName != null">#{invoicingCompanyName},</if>
<if test="creditLimit != null">#{creditLimit},</if>
<if test="integrityRating != null">#{integrityRating},</if>
<if test="customerContact != null">#{customerContact},</if>
<if test="contactNumber != null">#{contactNumber},</if>
<if test="customerFax != null">#{customerFax},</if>
<if test="customerEmail != null">#{customerEmail},</if>
<if test="customerAbbreviation != null">#{customerAbbreviation},</if>
<if test="customsCode != null">#{customsCode},</if>
<if test="paymentTerms != null">#{paymentTerms},</if>
<if test="invoiceCode != null">#{invoiceCode},</if>
<if test="portOfDestination != null">#{portOfDestination},</if>
<if test="establishedTime != null">#{establishedTime},</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="registeredCapital != null">#{registeredCapital},</if>
<if test="orderLength != null">#{orderLength},</if>
<if test="shippingTemplate != null">#{shippingTemplate},</if>
<if test="businessMembers != null">#{businessMembers},</if>
<if test="destinationPortCode != null">#{destinationPortCode},</if>
<if test="departurePotentialName != null">#{departurePotentialName},</if>
<if test="departurePotentialCode != null">#{departurePotentialCode},</if>
<if test="unifiedNumbering != null">#{unifiedNumbering},</if>
<if test="shipmentUsage != null">#{shipmentUsage},</if>
<if test="voucherPreparation != null">#{voucherPreparation},</if>
<if test="identifyingPeople != null">#{identifyingPeople},</if>
<if test="confirmTax != null">#{confirmTax},</if>
<if test="taxRate != null">#{taxRate},</if>
<if test="countryNumber != null">#{countryNumber},</if>
now(),
</trim>
</insert>
<update id="updateSysCustomer" parameterType="SysCustomer">
update sys_customer
<trim prefix="SET" suffixOverrides=",">
<if test="enterpriseCode != null and enterpriseCode != ''">enterprise_code = #{enterpriseCode},</if>
<if test="exportSales != null">export_sales = #{exportSales},</if>
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name = #{enterpriseName},</if>
<if test="englishName != null">english_name = #{englishName},</if>
<if test="customerAddress != null">customer_address = #{customerAddress},</if>
<if test="deliveryAddress != null">delivery_address = #{deliveryAddress},</if>
<if test="postalCode != null">postal_code = #{postalCode},</if>
<if test="customerCountry != null">customer_country = #{customerCountry},</if>
<if test="commonCurrency != null">common_currency = #{commonCurrency},</if>
<if test="customerRemarks != null">customer_remarks = #{customerRemarks},</if>
<if test="legalRepresentative != null">legal_representative = #{legalRepresentative},</if>
<if test="invoicingCustomerName != null">invoicing_customer_name = #{invoicingCustomerName},</if>
<if test="invoicingCompanyName != null">invoicing_company_name = #{invoicingCompanyName},</if>
<if test="creditLimit != null">credit_limit = #{creditLimit},</if>
<if test="integrityRating != null">integrity_rating = #{integrityRating},</if>
<if test="customerContact != null">customer_contact = #{customerContact},</if>
<if test="contactNumber != null">contact_number = #{contactNumber},</if>
<if test="customerFax != null">customer_fax = #{customerFax},</if>
<if test="customerEmail != null">customer_email = #{customerEmail},</if>
<if test="customerAbbreviation != null">customer_abbreviation = #{customerAbbreviation},</if>
<if test="customsCode != null">customs_code = #{customsCode},</if>
<if test="paymentTerms != null">payment_terms = #{paymentTerms},</if>
<if test="invoiceCode != null">invoice_code = #{invoiceCode},</if>
<if test="portOfDestination != null">port_of_destination = #{portOfDestination},</if>
<if test="establishedTime != null">established_time = #{establishedTime},</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="registeredCapital != null">registered_capital = #{registeredCapital},</if>
<if test="orderLength != null">order_length = #{orderLength},</if>
<if test="shippingTemplate != null">shipping_template = #{shippingTemplate},</if>
<if test="businessMembers != null">business_members = #{businessMembers},</if>
<if test="destinationPortCode != null">destination_port_code = #{destinationPortCode},</if>
<if test="departurePotentialName != null">departure_potential_name = #{departurePotentialName},</if>
<if test="departurePotentialCode != null">departure_potential_code = #{departurePotentialCode},</if>
<if test="unifiedNumbering != null">unified_numbering = #{unifiedNumbering},</if>
<if test="shipmentUsage != null">shipment_usage = #{shipmentUsage},</if>
<if test="voucherPreparation != null">voucher_preparation = #{voucherPreparation},</if>
<if test="identifyingPeople != null">identifying_people = #{identifyingPeople},</if>
<if test="confirmTax != null">confirm_tax = #{confirmTax},</if>
<if test="taxRate != null">tax_rate = #{taxRate},</if>
<if test="countryNumber != null">country_number = #{countryNumber},</if>
update_info_time = CONCAT_WS(',',NOW(),update_info_time),
</trim>
where customer_id = #{customerId}
</update>
<delete id="deleteSysCustomerById" parameterType="Long">
delete from sys_customer where customer_id = #{customerId}
</delete>
<delete id="deleteSysCustomerByIds" parameterType="String">
delete from sys_customer where customer_id in
<foreach item="customerId" collection="array" open="(" separator="," close=")">
#{customerId}
</foreach>
</delete>
</mapper>