|
@@ -32,15 +32,15 @@
|
|
|
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ImGroupMember" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
- INSERT INTO im_group_member (im_group_id_,user_id_,nickname_,is_admin_,role_type_,create_time_,update_time_,tenant_id_,type_)
|
|
|
- VALUES(#{imGroupId},#{userId},#{nickname},#{isAdmin},#{roleType},NOW(),NOW(),#{tenantId},#{type})
|
|
|
+ INSERT INTO im_group_member (im_group_id_,user_id_,nickname_,is_admin_,role_type_,create_time_,update_time_,tenant_id_,type_,group_role_type_)
|
|
|
+ VALUES(#{imGroupId},#{userId},#{nickname},#{isAdmin},#{roleType},NOW(),NOW(),#{tenantId},#{type},#{groupRoleType})
|
|
|
ON DUPLICATE KEY UPDATE nickname_ = VALUES(nickname_), is_admin_ = VALUES(is_admin_), role_type_ = VALUES(role_type_), type_ = VALUES(type_)
|
|
|
</insert>
|
|
|
|
|
|
<insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.ImGroupMember" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
- INSERT INTO im_group_member (im_group_id_,user_id_,nickname_,is_admin_,role_type_,create_time_,update_time_,tenant_id_,type_) VALUES
|
|
|
+ INSERT INTO im_group_member (im_group_id_,user_id_,nickname_,is_admin_,role_type_,create_time_,update_time_,tenant_id_,type_,group_role_type_) VALUES
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
- (#{item.imGroupId},#{item.userId},#{item.nickname},#{item.isAdmin},#{item.roleType},NOW(),NOW(),#{item.tenantId},#{item.type})
|
|
|
+ (#{item.imGroupId},#{item.userId},#{item.nickname},#{item.isAdmin},#{item.roleType},NOW(),NOW(),#{item.tenantId},#{item.type},#{item.groupRoleType})
|
|
|
</foreach>
|
|
|
ON DUPLICATE KEY UPDATE nickname_ = VALUES(nickname_), is_admin_ = VALUES(is_admin_), role_type_ = VALUES(role_type_), type_ = VALUES(type_)
|
|
|
</insert>
|
|
@@ -48,6 +48,9 @@
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
<update id="update" parameterType="com.ym.mec.biz.dal.entity.ImGroupMember">
|
|
|
UPDATE im_group_member <set>
|
|
|
+ <if test="groupRoleType != null and groupRoleType != ''">
|
|
|
+ group_role_type_ = #{groupRoleType},
|
|
|
+ </if>
|
|
|
<if test="roleType != null">
|
|
|
role_type_ = #{roleType},
|
|
|
</if>
|
|
@@ -74,6 +77,9 @@
|
|
|
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
|
|
|
UPDATE im_group_member
|
|
|
<set>
|
|
|
+ <if test="item.groupRoleType != null">
|
|
|
+ group_role_type_ = #{item.groupRoleType},
|
|
|
+ </if>
|
|
|
<if test="item.roleType != null">
|
|
|
role_type_ = #{item.roleType},
|
|
|
</if>
|