142 lines
9.1 KiB
XML
142 lines
9.1 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.BasSupplier.mapper.BasSupplierMapper">
|
|
|
|
<resultMap type="BasSupplier" id="BasSupplierResult">
|
|
<result property="id" column="id" />
|
|
<result property="supplierNo" column="supplier_no" />
|
|
<result property="supplierGroupNo" column="supplier_group_no" />
|
|
<result property="supplierName" column="supplier_name" />
|
|
<result property="simpleName" column="simple_name" />
|
|
<result property="useable" column="useable" />
|
|
<result property="remark" column="remark" />
|
|
<result property="supplierArae" column="supplier_arae" />
|
|
<result property="taxpayerRegistrationNumber" column="taxpayer_registration_number" />
|
|
<result property="country" column="country" />
|
|
<result property="timeZone" column="time_zone" />
|
|
<result property="dataFormat" column="data_format" />
|
|
<result property="receivingCountry" column="receiving_country" />
|
|
<result property="taxCategory" column="tax_category" />
|
|
<result property="legalPerson" column="legal_person" />
|
|
<result property="registeredCapital" column="registered_capital" />
|
|
<result property="address" column="address" />
|
|
<result property="contactName" column="contact_name" />
|
|
<result property="contactNumber" column="contact_number" />
|
|
</resultMap>
|
|
|
|
<sql id="selectBasSupplierVo">
|
|
select id, supplier_no, supplier_group_no, supplier_name, simple_name, useable, remark, supplier_arae, taxpayer_registration_number, country, time_zone, data_format, receiving_country, tax_category, legal_person, registered_capital, address, contact_name, contact_number from bas_supplier
|
|
</sql>
|
|
|
|
<select id="selectBasSupplierList" parameterType="BasSupplier" resultMap="BasSupplierResult">
|
|
<include refid="selectBasSupplierVo"/>
|
|
<where>
|
|
<if test="supplierNo != null and supplierNo != ''"> and supplier_no like concat('%', #{supplierNo}, '%')</if>
|
|
<if test="supplierGroupNo != null and supplierGroupNo != ''"> and supplier_group_no like concat('%', #{supplierGroupNo}, '%')</if>
|
|
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
|
|
<if test="simpleName != null and simpleName != ''"> and simple_name like concat('%', #{simpleName}, '%')</if>
|
|
<if test="useable != null and useable != ''"> and useable = #{useable}</if>
|
|
<if test="supplierArae != null and supplierArae != ''"> and supplier_arae like concat('%', #{supplierArae}, '%')</if>
|
|
<if test="taxpayerRegistrationNumber != null and taxpayerRegistrationNumber != ''"> and taxpayer_registration_number like concat('%', #{taxpayerRegistrationNumber}, '%')</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="receivingCountry != null and receivingCountry != ''"> and receiving_country like concat('%', #{receivingCountry}, '%')</if>
|
|
<if test="taxCategory != null and taxCategory != ''"> and tax_category like concat('%', #{taxCategory}, '%')</if>
|
|
<if test="legalPerson != null and legalPerson != ''"> and legal_person like concat('%', #{legalPerson}, '%')</if>
|
|
<if test="registeredCapital != null and registeredCapital != ''"> and registered_capital like concat('%', #{registeredCapital}, '%')</if>
|
|
<if test="address != null and address != ''"> and address like concat('%', #{address}, '%')</if>
|
|
<if test="contactName != null and contactName != ''"> and contact_name like concat('%', #{contactName}, '%')</if>
|
|
<if test="contactNumber != null and contactNumber != ''"> and contact_number = like concat('%',#{contactNumber}, '%')</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectBasSupplierById" parameterType="String" resultMap="BasSupplierResult">
|
|
<include refid="selectBasSupplierVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertBasSupplier" parameterType="BasSupplier">
|
|
insert into bas_supplier
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null and id != ''">id,</if>
|
|
<if test="supplierNo != null">supplier_no,</if>
|
|
<if test="supplierGroupNo != null">supplier_group_no,</if>
|
|
<if test="supplierName != null">supplier_name,</if>
|
|
<if test="simpleName != null">simple_name,</if>
|
|
<if test="useable != null and useable != ''">useable,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="supplierArae != null">supplier_arae,</if>
|
|
<if test="taxpayerRegistrationNumber != null">taxpayer_registration_number,</if>
|
|
<if test="country != null">country,</if>
|
|
<if test="timeZone != null">time_zone,</if>
|
|
<if test="dataFormat != null">data_format,</if>
|
|
<if test="receivingCountry != null">receiving_country,</if>
|
|
<if test="taxCategory != null">tax_category,</if>
|
|
<if test="legalPerson != null">legal_person,</if>
|
|
<if test="registeredCapital != null">registered_capital,</if>
|
|
<if test="address != null">address,</if>
|
|
<if test="contactName != null">contact_name,</if>
|
|
<if test="contactNumber != null">contact_number,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null and id != ''">#{id},</if>
|
|
<if test="supplierNo != null">#{supplierNo},</if>
|
|
<if test="supplierGroupNo != null">#{supplierGroupNo},</if>
|
|
<if test="supplierName != null">#{supplierName},</if>
|
|
<if test="simpleName != null">#{simpleName},</if>
|
|
<if test="useable != null and useable != ''">#{useable},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="supplierArae != null">#{supplierArae},</if>
|
|
<if test="taxpayerRegistrationNumber != null">#{taxpayerRegistrationNumber},</if>
|
|
<if test="country != null">#{country},</if>
|
|
<if test="timeZone != null">#{timeZone},</if>
|
|
<if test="dataFormat != null">#{dataFormat},</if>
|
|
<if test="receivingCountry != null">#{receivingCountry},</if>
|
|
<if test="taxCategory != null">#{taxCategory},</if>
|
|
<if test="legalPerson != null">#{legalPerson},</if>
|
|
<if test="registeredCapital != null">#{registeredCapital},</if>
|
|
<if test="address != null">#{address},</if>
|
|
<if test="contactName != null">#{contactName},</if>
|
|
<if test="contactNumber != null">#{contactNumber},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateBasSupplier" parameterType="BasSupplier">
|
|
update bas_supplier
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="supplierNo != null">supplier_no = #{supplierNo},</if>
|
|
<if test="supplierGroupNo != null">supplier_group_no = #{supplierGroupNo},</if>
|
|
<if test="supplierName != null">supplier_name = #{supplierName},</if>
|
|
<if test="simpleName != null">simple_name = #{simpleName},</if>
|
|
<if test="useable != null and useable != ''">useable = #{useable},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="supplierArae != null">supplier_arae = #{supplierArae},</if>
|
|
<if test="taxpayerRegistrationNumber != null">taxpayer_registration_number = #{taxpayerRegistrationNumber},</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="receivingCountry != null">receiving_country = #{receivingCountry},</if>
|
|
<if test="taxCategory != null">tax_category = #{taxCategory},</if>
|
|
<if test="legalPerson != null">legal_person = #{legalPerson},</if>
|
|
<if test="registeredCapital != null">registered_capital = #{registeredCapital},</if>
|
|
<if test="address != null">address = #{address},</if>
|
|
<if test="contactName != null">contact_name = #{contactName},</if>
|
|
<if test="contactNumber != null">contact_number = #{contactNumber},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteBasSupplierById" parameterType="String">
|
|
delete from bas_supplier where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteBasSupplierByIds" parameterType="String">
|
|
delete from bas_supplier where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |