82 lines
4.0 KiB
XML
82 lines
4.0 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.customer.mapper.BasCustomerMapper">
|
|
|
|
<resultMap type="BasCustomer" id="BasCustomerResult">
|
|
<result property="customerId" column="customer_id" />
|
|
<result property="customerName" column="customer_name" />
|
|
<result property="simpleName" column="simple_name" />
|
|
<result property="useable" column="useable" />
|
|
<result property="remark" column="remark" />
|
|
<result property="contactName" column="contact_name" />
|
|
<result property="contactNumber" column="contact_number" />
|
|
</resultMap>
|
|
|
|
<sql id="selectBasCustomerVo">
|
|
select customer_id, customer_name, simple_name, useable, remark, contact_name, contact_number from bas_customer
|
|
</sql>
|
|
|
|
<select id="selectBasCustomerList" parameterType="BasCustomer" resultMap="BasCustomerResult">
|
|
<include refid="selectBasCustomerVo"/>
|
|
<where>
|
|
<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 = #{useable}</if>
|
|
<if test="contactName != null and contactName != ''"> and contact_name like concat('%', #{contactName}, '%')</if>
|
|
<if test="contactNumber != null and contactNumber != ''"> and contact_number = #{contactNumber}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectBasCustomerByCustomerId" parameterType="String" resultMap="BasCustomerResult">
|
|
<include refid="selectBasCustomerVo"/>
|
|
where customer_id = #{customerId}
|
|
</select>
|
|
|
|
<insert id="insertBasCustomer" parameterType="BasCustomer">
|
|
insert into bas_customer
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="customerId != null">customer_id,</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="contactName != null">contact_name,</if>
|
|
<if test="contactNumber != null">contact_number,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="customerId != null">#{customerId},</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="contactName != null">#{contactName},</if>
|
|
<if test="contactNumber != null">#{contactNumber},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateBasCustomer" parameterType="BasCustomer">
|
|
update bas_customer
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<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="contactName != null">contact_name = #{contactName},</if>
|
|
<if test="contactNumber != null">contact_number = #{contactNumber},</if>
|
|
</trim>
|
|
where customer_id = #{customerId}
|
|
</update>
|
|
|
|
<delete id="deleteBasCustomerByCustomerId" parameterType="String">
|
|
delete from bas_customer where customer_id = #{customerId}
|
|
</delete>
|
|
|
|
<delete id="deleteBasCustomerByCustomerIds" parameterType="String">
|
|
delete from bas_customer where customer_id in
|
|
<foreach item="customerId" collection="array" open="(" separator="," close=")">
|
|
#{customerId}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |