t.id as id,
t.group_id as groupId,
t.user_id as userId,
t.is_admin as isAdmin,
t.is_use as isUse
t.group_id = #{groupId} AND
t.user_id = #{userId} AND
t.is_admin = #{isAdmin} AND
t.is_use = #{isUse} AND
insert into sys_group_user
id,
group_id,
user_id,
is_admin,
is_use,
#{id},
#{groupId},
#{userId},
#{isAdmin},
#{isUse},
update sys_group_user
group_id=#{groupId},
user_id=#{userId},
is_admin=#{isAdmin},
is_use=#{isUse},
where id=#{id}
update sys_group_user
SET is_use = 0
where group_id = #{groupId} and user_id = #{userId}
update sys_group_user
SET is_use = 0
where group_id = #{groupId}
delete from sys_group_user
where id=#{id}
update sys_group_user
SET is_admin = 0
where group_id = #{groupId} and is_use = 1
update sys_group_user
SET is_admin = 0
where group_id = #{groupId} and user_id = #{userId} and is_use = 1
update sys_group_user
SET is_admin = 1
where group_id = #{groupId} and user_id = #{userId} and is_use = 1