|
|
@@ -45,10 +45,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="lastWatchTime" column="last_watch_time" />
|
|
|
<result property="registerTime" column="register_time" />
|
|
|
<result property="isReply" column="is_reply" />
|
|
|
+ <result property="applicationExternalUserId" column="application_external_user_id" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectQwExternalContactVo">
|
|
|
- select id,qw_user_id,register_time,state,way_id,qw_open_user_id,stage_status,first_time,open_id,is_interact,level, unionid, user_id,transfer_time,loss_time,del_time,transfer_num, external_user_id,transfer_status,status,create_time, name, avatar, type, gender, remark, description, tag_ids, remark_mobiles, remark_corp_name, add_way, oper_userid, corp_id, company_id, company_user_id, customer_id, fs_user_id,is_reply from qw_external_contact
|
|
|
+ select id,qw_user_id,register_time,state,way_id,qw_open_user_id,stage_status,first_time,open_id,is_interact,level,
|
|
|
+ unionid, user_id,transfer_time,loss_time,del_time,transfer_num, external_user_id,transfer_status,status,
|
|
|
+ create_time, name, avatar, type, gender, remark, description, tag_ids, remark_mobiles,
|
|
|
+ remark_corp_name, add_way, oper_userid, corp_id, company_id, company_user_id, customer_id,
|
|
|
+ fs_user_id,is_reply,application_external_user_id from qw_external_contact
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectQwExternalContactList" parameterType="QwExternalContact" resultMap="QwExternalContactResult">
|
|
|
@@ -72,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="customerId != null "> and customer_id = #{customerId}</if>
|
|
|
<if test="fsUserId != null "> and fs_user_id = #{fsUserId}</if>
|
|
|
<if test="unionid != null "> and unionid = #{unionid}</if>
|
|
|
+ <if test="applicationExternalUserId != null and applicationExternalUserId != '' "> and application_external_user_id = #{applicationExternalUserId}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
@@ -277,6 +283,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="levelType != null">level_type,</if>
|
|
|
<if test="firstTime != null">first_time,</if>
|
|
|
<if test="registerTime != null">register_time,</if>
|
|
|
+ <if test="applicationExternalUserId != null">application_external_user_id,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null">#{id},</if>
|
|
|
@@ -317,6 +324,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="levelType != null">#{levelType},</if>
|
|
|
<if test="firstTime != null">#{firstTime},</if>
|
|
|
<if test="registerTime != null">#{registerTime},</if>
|
|
|
+ <if test="applicationExternalUserId != null">#{applicationExternalUserId},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
@@ -820,4 +828,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
and t1.corp_id = #{corpId}
|
|
|
and t1.status = 0
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="selectQwExternalByApplicationExternalUserId" resultMap="QwExternalContactResult">
|
|
|
+ <include refid="selectQwExternalContactVo"/>
|
|
|
+ where application_external_user_id = #{externalUserid} and corp_id = #{corpId}
|
|
|
+ <if test="qwUserId != null and qwUserId != ''">
|
|
|
+ user_id = #{qwUserId}
|
|
|
+ </if>
|
|
|
+ order by create_time desc limit 1
|
|
|
+ </select>
|
|
|
</mapper>
|