修改getInfo个人信息结果集

master
冯凯 2023-11-03 16:48:46 +08:00
parent f680c43f20
commit cfabce1b23
5 changed files with 52 additions and 2 deletions

View File

@ -144,6 +144,9 @@ public class SysUserController extends BaseController
loginUserVo.setPatient(patient);
}else{
Doctor doctor=userService.selectDoctor(sysUser.getUserId());
//根据当前医生的departmentId来获取所在部门的对象
Department department=userService.searchDoctorDepartmentByDeptId(doctor.getDepartmentId());
sysUser.setDepartment(department);
System.out.println(doctor);
loginUserVo.setDoctor(doctor);
}

View File

@ -205,4 +205,13 @@ public interface SysUserMapper {
*/
Boolean updSelfAvatar(String avatar);
/**
* @description: departmentId
* @param: departmentId
* @return: Department
* @author
* @date: 2023/11/3 16:43
*/
Department searchDoctorDepartmentByDeptId(@Param("departmentId") Integer departmentId);
}

View File

@ -241,4 +241,14 @@ public interface ISysUserService
* @date: 2023/10/29 9:33
*/
Boolean updSelfInformation(SefInformationReq sefInformationReq);
/**
* @description: departmentId
* @param: departmentId
* @return: Department
* @author
* @date: 2023/11/3 16:43
*/
Department searchDoctorDepartmentByDeptId(Integer departmentId);
}

View File

@ -659,6 +659,19 @@ public class SysUserServiceImpl implements ISysUserService
return userMapper.updSelfInformation(sefInformationReq)>0;
}
/**
* @description: departmentId
* @param: departmentId
* @return: Department
* @author
* @date: 2023/11/3 16:43
*/
@Override
public Department searchDoctorDepartmentByDeptId(Integer departmentId) {
return userMapper.searchDoctorDepartmentByDeptId(departmentId);
}
//---------------注册医生---------------------------
/**
* @description:

View File

@ -3,6 +3,11 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.health.system.server.mapper.SysUserMapper">
<resultMap id="deptList" type="com.health.system.common.domain.Department">
<id column="id" property="departmentId"></id>
<result column="name" property="departmentName"></result>
<result column="parent_id" property="parentId"></result>
</resultMap>
<resultMap type="com.health.system.common.domain.SysUser" id="SysUserResult">
<id property="userId" column="user_id" />
@ -68,8 +73,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectMySelfSysUser">
select user_id,dept_id,user_name,nick_name,email,phonenumber,sex,avatar,password,status,del_flag,
login_ip,login_date,create_by,sys_user.create_time,sys_user.update_by,sys_user.update_time,remark,name
from sys_user left join tb_moreover on sys_user.dept_id=tb_moreover.id
login_ip,login_date,create_by,sys_user.create_time,sys_user.update_by,sys_user.update_time,remark
from sys_user
</sql>
<sql id="deptSql">
select id,name from tb_moreover
</sql>
<select id="selectUserList" parameterType="com.health.system.common.domain.SysUser" resultMap="SysUserResult">
@ -173,6 +182,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectMySelfSysUser"/> where email=#{email}
</select>
<!--根据当前医生的departmentId来获取所在部门的对象-->
<select id="searchDoctorDepartmentByDeptId" resultType="com.health.system.common.domain.Department">
<include refid="deptSql"/>
where id=#{departmentId}
</select>
<insert id="insertUser" parameterType="com.health.system.common.domain.SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user(