|
|
@@ -117,6 +117,59 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
+ <update id="markActiveMembersOutByChatId">
|
|
|
+ update qw_group_chat_user
|
|
|
+ set is_out = 2
|
|
|
+ where chat_id = #{chatId} and corp_id = #{corpId} and (is_out = 1 or is_out is null)
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <insert id="insertOrUpdateSyncGroupChatUser" parameterType="QwGroupChatUser" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into qw_group_chat_user
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="chatId != null">chat_id,</if>
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="type != null">type,</if>
|
|
|
+ <if test="unionid != null">unionid,</if>
|
|
|
+ <if test="joinTime != null">join_time,</if>
|
|
|
+ <if test="joinScene != null">join_scene,</if>
|
|
|
+ <if test="invitor != null">invitor,</if>
|
|
|
+ <if test="groupNickname != null">group_nickname,</if>
|
|
|
+ <if test="name != null">name,</if>
|
|
|
+ <if test="companyId != null">company_id,</if>
|
|
|
+ is_out,
|
|
|
+ <if test="corpId != null">corp_id,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="chatId != null">#{chatId},</if>
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="type != null">#{type},</if>
|
|
|
+ <if test="unionid != null">#{unionid},</if>
|
|
|
+ <if test="joinTime != null">#{joinTime},</if>
|
|
|
+ <if test="joinScene != null">#{joinScene},</if>
|
|
|
+ <if test="invitor != null">#{invitor},</if>
|
|
|
+ <if test="groupNickname != null">#{groupNickname},</if>
|
|
|
+ <if test="name != null">#{name},</if>
|
|
|
+ <if test="companyId != null">#{companyId},</if>
|
|
|
+ 1,
|
|
|
+ <if test="corpId != null">#{corpId},</if>
|
|
|
+ </trim>
|
|
|
+ on duplicate key update
|
|
|
+ <trim suffixOverrides=",">
|
|
|
+ <if test="type != null">type = #{type},</if>
|
|
|
+ <if test="unionid != null">unionid = #{unionid},</if>
|
|
|
+ <if test="joinTime != null">join_time = #{joinTime},</if>
|
|
|
+ <if test="joinScene != null">join_scene = #{joinScene},</if>
|
|
|
+ <if test="invitor != null">invitor = #{invitor},</if>
|
|
|
+ <if test="groupNickname != null">group_nickname = #{groupNickname},</if>
|
|
|
+ <if test="name != null">name = #{name},</if>
|
|
|
+ <if test="companyId != null">company_id = #{companyId},</if>
|
|
|
+ is_out = 1,
|
|
|
+ out_time = null,
|
|
|
+ quit_scene = null,
|
|
|
+ <if test="corpId != null">corp_id = #{corpId},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
<insert id="insertQwGroupChatUser" parameterType="QwGroupChatUser" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into qw_group_chat_user
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|