serv-权限+文件下载
This commit is contained in:
@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.xyzh.common.dto.user.TbSysUser;
|
||||
import org.xyzh.common.dto.user.TbSysUserInfo;
|
||||
import org.xyzh.common.vo.UserVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -123,4 +124,13 @@ public interface UserMapper extends BaseMapper<TbSysUser> {
|
||||
* @since 2025-10-06
|
||||
*/
|
||||
int updateUserInfo(@Param("userInfo") TbSysUserInfo userInfo);
|
||||
|
||||
/**
|
||||
* @description 获取用户信息总览
|
||||
* @param userId 用户ID
|
||||
* @return UserVO 用户信息总览
|
||||
* @author yslg
|
||||
* @since 2025-10-18
|
||||
*/
|
||||
UserVO selectUserInfoTotal(@Param("userId") String userId);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.xyzh.common.dto.user.TbSysUserDeptRole;
|
||||
import org.xyzh.common.dto.user.TbSysUserInfo;
|
||||
import org.xyzh.common.utils.IDUtils;
|
||||
import org.xyzh.common.vo.UserDeptRoleVO;
|
||||
import org.xyzh.common.vo.UserVO;
|
||||
import org.xyzh.system.mapper.UserMapper;
|
||||
import org.xyzh.system.mapper.UserInfoMapper;
|
||||
import org.xyzh.system.mapper.UserDeptRoleMapper;
|
||||
@@ -713,4 +714,19 @@ public class SysUserServiceImpl implements SysUserService {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultDomain<UserVO> getUserInfoTotal(String userId) {
|
||||
ResultDomain<UserVO> resultDomain = new ResultDomain<>();
|
||||
try {
|
||||
logger.info("开始获取用户信息总览:{}", userId);
|
||||
UserVO userVO = userMapper.selectUserInfoTotal(userId);
|
||||
|
||||
resultDomain.success("获取用户信息总览成功", userVO);
|
||||
return resultDomain;
|
||||
} catch (Exception e) {
|
||||
logger.error("获取用户信息总览失败:{}", userId, e);
|
||||
resultDomain.fail("获取用户信息总览失败:" + e.getMessage());
|
||||
return resultDomain;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
<result column="family_name" property="familyName" />
|
||||
<result column="given_name" property="givenName" />
|
||||
<result column="full_name" property="fullName" />
|
||||
<result column="level" property="level" />
|
||||
<result column="id_card" property="idCard" />
|
||||
<result column="address" property="address" />
|
||||
<result column="create_time" property="createTime" />
|
||||
@@ -18,7 +19,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, avatar, gender, family_name, given_name, full_name, id_card, address, create_time, update_time, delete_time, deleted
|
||||
id, user_id, avatar, gender, family_name, given_name, full_name, level, id_card, address, create_time, update_time, delete_time, deleted
|
||||
</sql>
|
||||
<!-- insertUserInfo -->
|
||||
|
||||
@@ -37,6 +38,7 @@
|
||||
<if test="userInfo.familyName != null">family_name = #{userInfo.familyName},</if>
|
||||
<if test="userInfo.givenName != null">given_name = #{userInfo.givenName},</if>
|
||||
<if test="userInfo.fullName != null">full_name = #{userInfo.fullName},</if>
|
||||
<if test="userInfo.level != null">level = #{userInfo.level},</if>
|
||||
<if test="userInfo.idCard != null">id_card = #{userInfo.idCard},</if>
|
||||
<if test="userInfo.address != null">address = #{userInfo.address},</if>
|
||||
<if test="userInfo.updater != null">updater = #{userInfo.updater},</if>
|
||||
|
||||
@@ -32,6 +32,22 @@
|
||||
<result column="delete_time" property="deleteTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="deleted" property="deleted" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
<resultMap id="UserInfoTotalResultMap" type="org.xyzh.common.vo.UserVO">
|
||||
<result column="user_id" property="userID" jdbcType="VARCHAR"/>
|
||||
<result column="avatar" property="avatar" jdbcType="VARCHAR"/>
|
||||
<result column="gender" property="gender" jdbcType="INTEGER"/>
|
||||
<result column="phone" property="phone" jdbcType="VARCHAR"/>
|
||||
<result column="email" property="email" jdbcType="VARCHAR"/>
|
||||
<result column="dept_name" property="deptName" jdbcType="VARCHAR"/>
|
||||
<result column="role_name" property="roleName" jdbcType="VARCHAR"/>
|
||||
<result column="level" property="level" jdbcType="INTEGER"/>
|
||||
<result column="id_card" property="idCard" jdbcType="VARCHAR"/>
|
||||
<result column="address" property="address" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="delete_time" property="deleteTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="deleted" property="deleted" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, username, password, email, phone, wechat_id,
|
||||
@@ -228,4 +244,27 @@
|
||||
</set>
|
||||
WHERE user_id = #{userInfo.userID} AND deleted = 0
|
||||
</update>
|
||||
|
||||
<!-- selectUserInfoTotal -->
|
||||
|
||||
<select id="selectUserInfoTotal" resultMap="UserInfoTotalResultMap">
|
||||
SELECT
|
||||
tus.id as user_id,
|
||||
tus.username,
|
||||
tus.phone,
|
||||
tus.email,
|
||||
tsui.avatar,
|
||||
tsui.gender,
|
||||
tsd.name as dept_name,
|
||||
tsr.name as role_name,
|
||||
tsui.level,
|
||||
tsui.id_card,
|
||||
tsui.address
|
||||
FROM tb_sys_user_info tsui
|
||||
INNER JOIN tb_sys_user tus ON tsui.user_id = tus.id
|
||||
INNER JOIN tb_sys_user_dept_role tsudr ON tsui.user_id = tsudr.user_id
|
||||
INNER JOIN tb_sys_dept tsd ON tsudr.dept_id = tsd.dept_id
|
||||
INNER JOIN tb_sys_role tsr ON tsudr.role_id = tsr.role_id
|
||||
WHERE tsui.user_id = #{userId} AND tsui.deleted = 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user