feat: 会议提交剩余时间+解冻 + 会务/劳务材料批量下载 + 多角色人员/账号模块完善
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -53,6 +53,14 @@ public interface SysUserMapper
|
||||
*/
|
||||
public SysUser selectUserByUserName(String userName);
|
||||
|
||||
/**
|
||||
* 通过邮箱查询用户 (登录支持邮箱+密码)
|
||||
*
|
||||
* @param email 邮箱
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
public SysUser selectUserByEmail(String email);
|
||||
|
||||
/**
|
||||
* 通过用户ID查询用户
|
||||
*
|
||||
@@ -96,6 +104,22 @@ public interface SysUserMapper
|
||||
public int updateUserStatus(@Param("userId") Long userId, @Param("status") String status);
|
||||
public int updateRoleType(@Param("userId") Long userId, @Param("roleType") String roleType);
|
||||
|
||||
/**
|
||||
* 更换机构管理员: 改账号类型 + 主账号指向
|
||||
* parentUserId 传 null = 晋升主账号 (account_type='MAIN', parent_user_id=NULL)
|
||||
*
|
||||
* @param userId 目标 sys_user.user_id
|
||||
* @param accountType 'MAIN' / 'SUB'
|
||||
* @param parentUserId 子账号指向的主账号 user_id (MAIN 传 null)
|
||||
*/
|
||||
public int updateAccountType(@Param("userId") Long userId, @Param("accountType") String accountType, @Param("parentUserId") Long parentUserId);
|
||||
|
||||
/**
|
||||
* 把原管理员的所有子账号 re-point 到新管理员 (更换管理员时, 避免出现三层树)
|
||||
* 排除新管理员自己 (其 parent_user_id 当前仍指向原管理员)
|
||||
*/
|
||||
public int updateParentUserId(@Param("oldParentUserId") Long oldParentUserId, @Param("newParentUserId") Long newParentUserId);
|
||||
|
||||
/**
|
||||
* 更新用户登录信息(IP和登录时间)
|
||||
*
|
||||
|
||||
@@ -52,6 +52,14 @@ public interface ISysUserService
|
||||
*/
|
||||
public SysUser selectUserByUserName(String userName);
|
||||
|
||||
/**
|
||||
* 通过邮箱查询用户 (登录支持邮箱+密码)
|
||||
*
|
||||
* @param email 邮箱
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
public SysUser selectUserByEmail(String email);
|
||||
|
||||
/**
|
||||
* 通过用户ID查询用户
|
||||
*
|
||||
|
||||
+9
@@ -131,6 +131,15 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
return userMapper.selectUserByUserName(userName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过邮箱查询用户 (登录支持邮箱+密码)
|
||||
*/
|
||||
@Override
|
||||
public SysUser selectUserByEmail(String email)
|
||||
{
|
||||
return userMapper.selectUserByEmail(email);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过用户ID查询用户
|
||||
*
|
||||
|
||||
@@ -170,6 +170,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<include refid="selectUserVo"/>
|
||||
where u.user_name = #{userName} and u.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectUserByEmail" parameterType="String" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.email = #{email} and u.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
@@ -275,6 +280,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
update sys_user set role_type = #{roleType} where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<!-- 更换管理员: 改 account_type + parent_user_id (parentUserId 为 null 时显式写 NULL = 晋升主账号) -->
|
||||
<update id="updateAccountType">
|
||||
update sys_user
|
||||
set account_type = #{accountType},
|
||||
<choose>
|
||||
<when test="parentUserId != null">parent_user_id = #{parentUserId},</when>
|
||||
<otherwise>parent_user_id = null,</otherwise>
|
||||
</choose>
|
||||
update_time = sysdate()
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<!-- 更换管理员: 原管理员的所有子账号 re-point 到新管理员 (排除新管理员自己) -->
|
||||
<update id="updateParentUserId">
|
||||
update sys_user
|
||||
set parent_user_id = #{newParentUserId}, update_time = sysdate()
|
||||
where parent_user_id = #{oldParentUserId}
|
||||
and user_id != #{newParentUserId}
|
||||
and del_flag = '0'
|
||||
</update>
|
||||
|
||||
<update id="updateUserStatus" parameterType="SysUser">
|
||||
update sys_user set status = #{status}, update_time = sysdate() where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
Reference in New Issue
Block a user