Files
FT546MWS/ruoyi-admin/src/main/resources/mapper/bas/BasCustomerMapper.xml
1009473166@qq.com 0a021caba6 1
2026-07-31 10:16:48 +08:00

153 lines
9.8 KiB
XML

<?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.bas.BasCustomer.mapper.BasCustomerMapper">
<resultMap type="BasCustomer" id="BasCustomerResult">
<result property="id" column="id" />
<result property="customerNo" column="customer_no" />
<result property="customerGroupNo" column="customer_group_no" />
<result property="customerName" column="customer_name" />
<result property="simpleName" column="simple_name" />
<result property="useable" column="useable" />
<result property="remark" column="remark" />
<result property="businessDepartment" column="business_department" />
<result property="salesman" column="salesman" />
<result property="mnemonicCode" column="mnemonic_code" />
<result property="type" column="type" />
<result property="taxpayerRegistrationNumber" column="taxpayer_registration_number" />
<result property="organization" column="organization" />
<result property="supCustomer" column="sup_customer" />
<result property="retailInvestor" column="retail_investor" />
<result property="country" column="country" />
<result property="timeZone" column="time_zone" />
<result property="dataFormat" column="data_format" />
<result property="contactName" column="contact_name" />
<result property="shipment" column="shipment" />
<result property="taxCategory" column="tax_category" />
</resultMap>
<sql id="selectBasCustomerVo">
select id, customer_no, customer_group_no, customer_name, simple_name, useable, remark, business_department, salesman, mnemonic_code, type, taxpayer_registration_number, organization, sup_customer, retail_investor, country, time_zone, data_format, contact_name, shipment, tax_category from bas_customer
</sql>
<select id="selectBasCustomerList" parameterType="BasCustomer" resultMap="BasCustomerResult">
<include refid="selectBasCustomerVo"/>
<where>
<if test="customerNo != null and customerNo != ''"> and customer_no like concat('%', #{customerNo}, '%')</if>
<if test="customerGroupNo != null and customerGroupNo != ''"> and customer_group_no like concat('%', #{customerGroupNo}, '%')</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="simpleName != null and simpleName != ''"> and simple_name like concat('%', #{simpleName}, '%')</if>
<if test="useable != null and useable != ''"> and useable like concat('%', #{useable}, '%')</if>
<if test="businessDepartment != null and businessDepartment != ''"> and business_department like concat('%', #{businessDepartment}, '%')</if>
<if test="salesman != null and salesman != ''"> and salesman like concat('%', #{salesman}, '%')</if>
<if test="mnemonicCode != null and mnemonicCode != ''"> and mnemonic_code like concat('%', #{mnemonicCode}, '%')</if>
<if test="type != null and type != ''"> and type like concat('%', #{type}, '%')</if>
<if test="taxpayerRegistrationNumber != null and taxpayerRegistrationNumber != ''"> and taxpayer_registration_number like concat('%', #{taxpayerRegistrationNumber}, '%')</if>
<if test="organization != null and organization != ''"> and organization like concat('%', #{organization}, '%')</if>
<if test="supCustomer != null and supCustomer != ''"> and sup_customer like concat('%', #{supCustomer}, '%')</if>
<if test="retailInvestor != null and retailInvestor != ''"> and retail_investor like concat('%', #{retailInvestor}, '%')</if>
<if test="country != null and country != ''"> and country like concat('%', #{country}, '%')</if>
<if test="timeZone != null and timeZone != ''"> and time_zone like concat('%', #{timeZone}, '%')</if>
<if test="dataFormat != null and dataFormat != ''"> and data_format like concat('%', #{dataFormat}, '%')</if>
<if test="contactName != null and contactName != ''"> and contact_name like concat('%', #{contactName}, '%')</if>
<if test="shipment != null and shipment != ''"> and shipment like concat('%', #{shipment}, '%')</if>
<if test="taxCategory != null and taxCategory != ''"> and tax_category like concat('%', #{taxCategory}, '%')</if>
</where>
</select>
<select id="selectBasCustomerById" parameterType="String" resultMap="BasCustomerResult">
<include refid="selectBasCustomerVo"/>
where id = #{id}
</select>
<insert id="insertBasCustomer" parameterType="BasCustomer">
insert into bas_customer
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">id,</if>
<if test="customerNo != null and customerNo != ''">customer_no,</if>
<if test="customerGroupNo != null">customer_group_no,</if>
<if test="customerName != null">customer_name,</if>
<if test="simpleName != null">simple_name,</if>
<if test="useable != null">useable,</if>
<if test="remark != null">remark,</if>
<if test="businessDepartment != null">business_department,</if>
<if test="salesman != null">salesman,</if>
<if test="mnemonicCode != null">mnemonic_code,</if>
<if test="type != null">type,</if>
<if test="taxpayerRegistrationNumber != null">taxpayer_registration_number,</if>
<if test="organization != null">organization,</if>
<if test="supCustomer != null">sup_customer,</if>
<if test="retailInvestor != null">retail_investor,</if>
<if test="country != null">country,</if>
<if test="timeZone != null">time_zone,</if>
<if test="dataFormat != null">data_format,</if>
<if test="contactName != null">contact_name,</if>
<if test="shipment != null">shipment,</if>
<if test="taxCategory != null">tax_category,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if>
<if test="customerNo != null and customerNo != ''">#{customerNo},</if>
<if test="customerGroupNo != null">#{customerGroupNo},</if>
<if test="customerName != null">#{customerName},</if>
<if test="simpleName != null">#{simpleName},</if>
<if test="useable != null">#{useable},</if>
<if test="remark != null">#{remark},</if>
<if test="businessDepartment != null">#{businessDepartment},</if>
<if test="salesman != null">#{salesman},</if>
<if test="mnemonicCode != null">#{mnemonicCode},</if>
<if test="type != null">#{type},</if>
<if test="taxpayerRegistrationNumber != null">#{taxpayerRegistrationNumber},</if>
<if test="organization != null">#{organization},</if>
<if test="supCustomer != null">#{supCustomer},</if>
<if test="retailInvestor != null">#{retailInvestor},</if>
<if test="country != null">#{country},</if>
<if test="timeZone != null">#{timeZone},</if>
<if test="dataFormat != null">#{dataFormat},</if>
<if test="contactName != null">#{contactName},</if>
<if test="shipment != null">#{shipment},</if>
<if test="taxCategory != null">#{taxCategory},</if>
</trim>
</insert>
<update id="updateBasCustomer" parameterType="BasCustomer">
update bas_customer
<trim prefix="SET" suffixOverrides=",">
<if test="customerNo != null and customerNo != ''">customer_no = #{customerNo},</if>
<if test="customerGroupNo != null">customer_group_no = #{customerGroupNo},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="simpleName != null">simple_name = #{simpleName},</if>
<if test="useable != null">useable = #{useable},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="businessDepartment != null">business_department = #{businessDepartment},</if>
<if test="salesman != null">salesman = #{salesman},</if>
<if test="mnemonicCode != null">mnemonic_code = #{mnemonicCode},</if>
<if test="type != null">type = #{type},</if>
<if test="taxpayerRegistrationNumber != null">taxpayer_registration_number = #{taxpayerRegistrationNumber},</if>
<if test="organization != null">organization = #{organization},</if>
<if test="supCustomer != null">sup_customer = #{supCustomer},</if>
<if test="retailInvestor != null">retail_investor = #{retailInvestor},</if>
<if test="country != null">country = #{country},</if>
<if test="timeZone != null">time_zone = #{timeZone},</if>
<if test="dataFormat != null">data_format = #{dataFormat},</if>
<if test="contactName != null">contact_name = #{contactName},</if>
<if test="shipment != null">shipment = #{shipment},</if>
<if test="taxCategory != null">tax_category = #{taxCategory},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBasCustomerById" parameterType="String">
delete from bas_customer where id = #{id}
</delete>
<delete id="deleteBasCustomerByIds" parameterType="String">
delete from bas_customer where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>