| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <?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.yunfeiyun.agmp.fms.mapper.SysCustomerMapper">
- <sql id="selectSysCustomerVo">
- select customerId, customerRealname, customerProvince, customerCity, customerArea, customerContactaddress, customerContanctway, customerContancts, customerRemark from SysCustomer
- </sql>
- <select id="selectSysCustomerList" parameterType="SysCustomer" resultType="SysCustomerResVo">
- select c.customerId, c.customerRealname, c.customerProvince, c.customerCity, c.customerArea,
- c.customerContactaddress, c.customerContanctway, c.customerContancts, c.customerRemark,
- (select GROUP_CONCAT(resUrl) from SysRes r where r.resBusId = c.customerId) customerPreview,
- (select GROUP_CONCAT(resId) from SysRes r where r.resBusId = c.customerId) resIds
- from SysCustomer c
- <where>
- <if test="customerRealname != null and customerRealname != ''"> and customerRealname like concat('%', #{customerRealname}, '%')</if>
- <if test="customerProvince != null and customerProvince != ''"> and customerProvince = #{customerProvince}</if>
- <if test="customerCity != null and customerCity != ''"> and customerCity = #{customerCity}</if>
- <if test="customerArea != null and customerArea != ''"> and customerArea = #{customerArea}</if>
- <if test="customerContactaddress != null and customerContactaddress != ''"> and customerContactaddress = #{customerContactaddress}</if>
- <if test="customerContanctway != null and customerContanctway != ''"> and customerContanctway = #{customerContanctway}</if>
- <if test="customerContancts != null and customerContancts != ''"> and customerContancts = #{customerContancts}</if>
- <if test="customerRemark != null and customerRemark != ''"> and customerRemark = #{customerRemark}</if>
- <if test="customerDelstatus != null ">and customerDelstatus = #{customerDelstatus}</if>
- <if test="tid != null and tid !='' and tid != '-1'">
- and tid = #{tid}
- </if>
- </where>
- </select>
-
- <select id="selectSysCustomerByCustomerId" parameterType="String" resultType="SysCustomer">
- <include refid="selectSysCustomerVo"/>
- where customerId = #{customerId}
- <if test="tid != null and tid !='' and tid != '-1'">
- and tid = #{tid}
- </if>
- </select>
-
- <insert id="insertSysCustomer" parameterType="SysCustomer">
- insert into SysCustomer
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="customerId != null">customerId,</if>
- <if test="customerRealname != null">customerRealname,</if>
- <if test="customerProvince != null">customerProvince,</if>
- <if test="customerCity != null">customerCity,</if>
- <if test="customerArea != null">customerArea,</if>
- <if test="customerContactaddress != null">customerContactaddress,</if>
- <if test="customerContanctway != null">customerContanctway,</if>
- <if test="customerContancts != null">customerContancts,</if>
- <if test="customerRemark != null">customerRemark,</if>
- <if test="customerDelstatus != null"> customerDelstatus,</if>
- <if test="tid != null">tid,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="customerId != null">#{customerId},</if>
- <if test="customerRealname != null">#{customerRealname},</if>
- <if test="customerProvince != null">#{customerProvince},</if>
- <if test="customerCity != null">#{customerCity},</if>
- <if test="customerArea != null">#{customerArea},</if>
- <if test="customerContactaddress != null">#{customerContactaddress},</if>
- <if test="customerContanctway != null">#{customerContanctway},</if>
- <if test="customerContancts != null">#{customerContancts},</if>
- <if test="customerRemark != null">#{customerRemark},</if>
- <if test="customerDelstatus != null"> #{customerDelstatus},</if>
- <if test="tid != null">#{tid},</if>
- </trim>
- </insert>
- <update id="updateSysCustomer" parameterType="SysCustomer">
- update SysCustomer
- <trim prefix="SET" suffixOverrides=",">
- <if test="customerRealname != null">customerRealname = #{customerRealname},</if>
- <if test="customerProvince != null">customerProvince = #{customerProvince},</if>
- <if test="customerCity != null">customerCity = #{customerCity},</if>
- <if test="customerArea != null">customerArea = #{customerArea},</if>
- <if test="customerContactaddress != null">customerContactaddress = #{customerContactaddress},</if>
- <if test="customerContanctway != null">customerContanctway = #{customerContanctway},</if>
- <if test="customerContancts != null">customerContancts = #{customerContancts},</if>
- <if test="customerRemark != null">customerRemark = #{customerRemark},</if>
- <if test="customerDelstatus != null">customerDelstatus = #{customerDelstatus},</if>
- <if test="tid != null">tid = #{tid},</if>
- </trim>
- where customerId = #{customerId}
- <if test="tid != null and tid !='' and tid != '-1'">
- and tid = #{tid}
- </if>
- </update>
- <delete id="deleteSysCustomerByCustomerId" parameterType="String">
- UPDATE SysCustomer set customerDelstatus = '1' where customerId = #{customerId}
- <if test="tid != null and tid !='' and tid != '-1'">
- and tid = #{tid}
- </if>
- </delete>
- <delete id="deleteSysCustomerByCustomerIds" parameterType="String">
- UPDATE SysCustomer set customerDelstatus = '1' where customerId in
- <foreach item="customerId" collection="array" open="(" separator="," close=")">
- #{customerId}
- </foreach>
- <if test="tid != null and tid !='' and tid != '-1'">
- and tid = #{tid}
- </if>
- </delete>
- </mapper>
|