123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <?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.miniapp.bus.mapper.BasicCustomerMapper">
-
- <resultMap type="com.miniapp.bus.domain.BasicCustomer" id="BasicCustomerResult">
- <result property="id" column="id" />
- <result property="parentid" column="parentid" />
- <result property="customerNo" column="customer_no" />
- <result property="customerName" column="customer_name" />
- <result property="customerContact" column="customer_contact" />
- <result property="customerInformation" column="customer_information" />
- <result property="customerType" column="customer_type" />
- <result property="deltag" column="deltag" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="remark" column="remark" />
- </resultMap>
- <sql id="selectBasicCustomerVo">
- select id, parentid, customer_no, customer_name, customer_contact, customer_information, customer_type, deltag, create_by, create_time, update_by, update_time, remark from basic_customer
- </sql>
- <select id="selectBasicCustomerList" parameterType="BasicCustomer" resultMap="BasicCustomerResult">
- <include refid="selectBasicCustomerVo"/>
- <where>
- <if test="parentid != null "> and parentid = #{parentid}</if>
- <if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo}</if>
- <if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
- <if test="customerContact != null and customerContact != ''"> and customer_contact = #{customerContact}</if>
- <if test="customerInformation != null and customerInformation != ''"> and customer_information = #{customerInformation}</if>
- <if test="customerType != null and customerType != ''"> and customer_type = #{customerType}</if>
- <if test="deltag != null and deltag != ''"> and deltag = #{deltag}</if>
- </where>
- </select>
-
- <select id="selectBasicCustomerById" parameterType="Long" resultMap="BasicCustomerResult">
- <include refid="selectBasicCustomerVo"/>
- where id = #{id}
- </select>
- <insert id="insertBasicCustomer" parameterType="BasicCustomer" useGeneratedKeys="true" keyProperty="id">
- insert into basic_customer
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="parentid != null">parentid,</if>
- <if test="customerNo != null">customer_no,</if>
- <if test="customerName != null">customer_name,</if>
- <if test="customerContact != null">customer_contact,</if>
- <if test="customerInformation != null">customer_information,</if>
- <if test="customerType != null">customer_type,</if>
- <if test="deltag != null">deltag,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="remark != null">remark,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="parentid != null">#{parentid},</if>
- <if test="customerNo != null">#{customerNo},</if>
- <if test="customerName != null">#{customerName},</if>
- <if test="customerContact != null">#{customerContact},</if>
- <if test="customerInformation != null">#{customerInformation},</if>
- <if test="customerType != null">#{customerType},</if>
- <if test="deltag != null">#{deltag},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="remark != null">#{remark},</if>
- </trim>
- </insert>
- <update id="updateBasicCustomer" parameterType="BasicCustomer">
- update basic_customer
- <trim prefix="SET" suffixOverrides=",">
- <if test="parentid != null">parentid = #{parentid},</if>
- <if test="customerNo != null">customer_no = #{customerNo},</if>
- <if test="customerName != null">customer_name = #{customerName},</if>
- <if test="customerContact != null">customer_contact = #{customerContact},</if>
- <if test="customerInformation != null">customer_information = #{customerInformation},</if>
- <if test="customerType != null">customer_type = #{customerType},</if>
- <if test="deltag != null">deltag = #{deltag},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="remark != null">remark = #{remark},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteBasicCustomerById" parameterType="Long">
- delete from basic_customer where id = #{id}
- </delete>
- <delete id="deleteBasicCustomerByIds" parameterType="String">
- delete from basic_customer where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|