|
@@ -20,15 +20,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="updateTime" column="update_time" />
|
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateBy" column="update_by" />
|
|
|
<result property="remark" column="remark" />
|
|
<result property="remark" column="remark" />
|
|
|
|
|
+ <result property="deleted" column="deleted"/>
|
|
|
|
|
+ <result property="deleteBy" column="delete_by"/>
|
|
|
|
|
+ <result property="deleteTime" column="delete_time"/>
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectCrmCustomerPropertyVo">
|
|
<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
|
|
|
|
|
|
|
+ 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, deleted, delete_by, delete_time from crm_customer_property
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectCrmCustomerPropertyList" parameterType="CrmCustomerProperty" resultMap="CrmCustomerPropertyResult">
|
|
<select id="selectCrmCustomerPropertyList" parameterType="CrmCustomerProperty" resultMap="CrmCustomerPropertyResult">
|
|
|
<include refid="selectCrmCustomerPropertyVo"/>
|
|
<include refid="selectCrmCustomerPropertyVo"/>
|
|
|
<where>
|
|
<where>
|
|
|
|
|
+ deleted = 0
|
|
|
<if test="customerId != null"> and customer_id = #{customerId}</if>
|
|
<if test="customerId != null"> and customer_id = #{customerId}</if>
|
|
|
<if test="propertyId != null"> and property_id = #{propertyId}</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="propertyName != null and propertyName != ''"> and property_name like concat('%', #{propertyName}, '%')</if>
|
|
@@ -41,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
<select id="selectCrmCustomerPropertyById" parameterType="Long" resultMap="CrmCustomerPropertyResult">
|
|
<select id="selectCrmCustomerPropertyById" parameterType="Long" resultMap="CrmCustomerPropertyResult">
|
|
|
<include refid="selectCrmCustomerPropertyVo"/>
|
|
<include refid="selectCrmCustomerPropertyVo"/>
|
|
|
- where id = #{id}
|
|
|
|
|
|
|
+ where id = #{id} and deleted = 0
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertCrmCustomerProperty" parameterType="CrmCustomerProperty" useGeneratedKeys="true" keyProperty="id">
|
|
<insert id="insertCrmCustomerProperty" parameterType="CrmCustomerProperty" useGeneratedKeys="true" keyProperty="id">
|
|
@@ -61,6 +65,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
<if test="remark != null">remark,</if>
|
|
<if test="remark != null">remark,</if>
|
|
|
|
|
+ <if test="deleted != null">deleted,</if>
|
|
|
|
|
+ <if test="deleteBy != null">delete_by,</if>
|
|
|
|
|
+ <if test="deleteTime != null">delete_time,</if>
|
|
|
</trim>
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="customerId != null">#{customerId},</if>
|
|
<if test="customerId != null">#{customerId},</if>
|
|
@@ -77,6 +84,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
|
|
|
+ <if test="deleted != null">#{deleted},</if>
|
|
|
|
|
+ <if test="deleteBy != null">#{deleteBy},</if>
|
|
|
|
|
+ <if test="deleteTime != null">#{deleteTime},</if>
|
|
|
</trim>
|
|
</trim>
|
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
|
@@ -97,6 +107,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
|
|
+ <if test="deleted != null">deleted = #{deleted},</if>
|
|
|
|
|
+ <if test="deleteBy != null">delete_by = #{deleteBy},</if>
|
|
|
|
|
+ <if test="deleteTime != null">delete_time = #{deleteTime},</if>
|
|
|
</trim>
|
|
</trim>
|
|
|
where id = #{id}
|
|
where id = #{id}
|
|
|
</update>
|
|
</update>
|
|
@@ -114,13 +127,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
<select id="selectCrmCustomerPropertyByCustomerId" parameterType="Long" resultMap="CrmCustomerPropertyResult">
|
|
<select id="selectCrmCustomerPropertyByCustomerId" parameterType="Long" resultMap="CrmCustomerPropertyResult">
|
|
|
<include refid="selectCrmCustomerPropertyVo"/>
|
|
<include refid="selectCrmCustomerPropertyVo"/>
|
|
|
- where customer_id = #{customerId}
|
|
|
|
|
|
|
+ where customer_id = #{customerId} and deleted = 0
|
|
|
order by id desc
|
|
order by id desc
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectByCustomerIdAndPropertyId" resultMap="CrmCustomerPropertyResult">
|
|
<select id="selectByCustomerIdAndPropertyId" resultMap="CrmCustomerPropertyResult">
|
|
|
<include refid="selectCrmCustomerPropertyVo"/>
|
|
<include refid="selectCrmCustomerPropertyVo"/>
|
|
|
- where customer_id = #{customerId} and property_id = #{propertyId}
|
|
|
|
|
|
|
+ where customer_id = #{customerId} and property_id = #{propertyId} and deleted = 0
|
|
|
limit 1
|
|
limit 1
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|