| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- <?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.fs.crm.mapper.CrmCustomerPropertyMapper">
- <resultMap type="CrmCustomerProperty" id="CrmCustomerPropertyResult">
- <result property="id" column="id" />
- <result property="customerId" column="customer_id" />
- <result property="propertyId" column="property_id" />
- <result property="propertyName" column="property_name" />
- <result property="propertyValue" column="property_value" />
- <result property="propertyValueType" column="property_value_type" />
- <result property="tradeType" column="trade_type" />
- <result property="aiAnalysis" column="ai_analysis" />
- <result property="intention" column="intention" />
- <result property="likeRatio" column="like_ratio" />
- <result property="createTime" column="create_time" />
- <result property="createBy" column="create_by" />
- <result property="updateTime" column="update_time" />
- <result property="updateBy" column="update_by" />
- <result property="remark" column="remark" />
- </resultMap>
- <sql id="selectCrmCustomerPropertyVo">
- select id, customer_id, property_id, property_name, property_value, property_value_type, trade_type, ai_analysis, intention, like_ratio, create_time, create_by, update_time, update_by, remark from crm_customer_property
- </sql>
- <select id="selectCrmCustomerPropertyList" parameterType="CrmCustomerProperty" resultMap="CrmCustomerPropertyResult">
- <include refid="selectCrmCustomerPropertyVo"/>
- <where>
- <if test="customerId != null"> and customer_id = #{customerId}</if>
- <if test="propertyId != null"> and property_id = #{propertyId}</if>
- <if test="propertyName != null and propertyName != ''"> and property_name like concat('%', #{propertyName}, '%')</if>
- <if test="propertyValue != null and propertyValue != ''"> and property_value like concat('%', #{propertyValue}, '%')</if>
- <if test="propertyValueType != null and propertyValueType != ''"> and property_value_type = #{propertyValueType}</if>
- <if test="tradeType != null and tradeType != ''"> and trade_type = #{tradeType}</if>
- </where>
- order by id desc
- </select>
- <select id="selectCrmCustomerPropertyById" parameterType="Long" resultMap="CrmCustomerPropertyResult">
- <include refid="selectCrmCustomerPropertyVo"/>
- where id = #{id}
- </select>
- <insert id="insertCrmCustomerProperty" parameterType="CrmCustomerProperty" useGeneratedKeys="true" keyProperty="id">
- insert into crm_customer_property
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="customerId != null">customer_id,</if>
- <if test="propertyId != null">property_id,</if>
- <if test="propertyName != null">property_name,</if>
- <if test="propertyValue != null">property_value,</if>
- <if test="propertyValueType != null">property_value_type,</if>
- <if test="tradeType != null">trade_type,</if>
- <if test="aiAnalysis != null">ai_analysis,</if>
- <if test="intention != null">intention,</if>
- <if test="likeRatio != null">like_ratio,</if>
- <if test="createTime != null">create_time,</if>
- <if test="createBy != null">create_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="remark != null">remark,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="customerId != null">#{customerId},</if>
- <if test="propertyId != null">#{propertyId},</if>
- <if test="propertyName != null">#{propertyName},</if>
- <if test="propertyValue != null">#{propertyValue},</if>
- <if test="propertyValueType != null">#{propertyValueType},</if>
- <if test="tradeType != null">#{tradeType},</if>
- <if test="aiAnalysis != null">#{aiAnalysis},</if>
- <if test="intention != null">#{intention},</if>
- <if test="likeRatio != null">#{likeRatio},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="remark != null">#{remark},</if>
- </trim>
- </insert>
- <update id="updateCrmCustomerProperty" parameterType="CrmCustomerProperty">
- update crm_customer_property
- <trim prefix="SET" suffixOverrides=",">
- <if test="customerId != null">customer_id = #{customerId},</if>
- <if test="propertyId != null">property_id = #{propertyId},</if>
- <if test="propertyName != null">property_name = #{propertyName},</if>
- <if test="propertyValue != null">property_value = #{propertyValue},</if>
- <if test="propertyValueType != null">property_value_type = #{propertyValueType},</if>
- <if test="tradeType != null">trade_type = #{tradeType},</if>
- <if test="aiAnalysis != null">ai_analysis = #{aiAnalysis},</if>
- <if test="intention != null">intention = #{intention},</if>
- <if test="likeRatio != null">like_ratio = #{likeRatio},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="remark != null">remark = #{remark},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteCrmCustomerPropertyById" parameterType="Long">
- delete from crm_customer_property where id = #{id}
- </delete>
- <delete id="deleteCrmCustomerPropertyByIds" parameterType="String">
- delete from crm_customer_property where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="selectCrmCustomerPropertyByCustomerId" parameterType="Long" resultMap="CrmCustomerPropertyResult">
- <include refid="selectCrmCustomerPropertyVo"/>
- where customer_id = #{customerId}
- order by id desc
- </select>
- <select id="selectByCustomerIdAndPropertyId" resultMap="CrmCustomerPropertyResult">
- <include refid="selectCrmCustomerPropertyVo"/>
- where customer_id = #{customerId} and property_id = #{propertyId}
- limit 1
- </select>
- <delete id="deleteByCustomerIdAndPropertyId">
- delete from crm_customer_property where customer_id = #{customerId} and property_id = #{propertyId}
- </delete>
- </mapper>
|