用户导入导出根据当前用户医院id

This commit is contained in:
yy 2024-06-03 10:17:50 +08:00
parent 29a0abce70
commit 56adadb7b6
2 changed files with 9 additions and 1 deletions

View File

@ -276,6 +276,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
*/ */
@Override @Override
public List<UserExcelVO> listUser(UserDTO userDTO) { public List<UserExcelVO> listUser(UserDTO userDTO) {
String hosptital = sysHospitalService.getCurrentHospital();
if (StringUtils.hasText(hosptital) && !"null".equals(hosptital)) {
userDTO.setHospitalId(Long.valueOf(hosptital));
}
// 根据数据权限查询全部的用户信息 // 根据数据权限查询全部的用户信息
List<UserVO> voList = baseMapper.selectVoList(userDTO); List<UserVO> voList = baseMapper.selectVoList(userDTO);
// 转换成execl 对象输出 // 转换成execl 对象输出

View File

@ -193,7 +193,7 @@
FROM sys_user u FROM sys_user u
LEFT JOIN sys_dept d ON d.dept_id = u.dept_id LEFT JOIN sys_dept d ON d.dept_id = u.dept_id
<where> <where>
u.del_flag = '0' u.del_flag = '0' and u.user_id != '1'
<if test="query.username != null and query.username != ''"> <if test="query.username != null and query.username != ''">
<bind name="usernameLike" value="'%' + query.username + '%'"/> <bind name="usernameLike" value="'%' + query.username + '%'"/>
AND u.username LIKE #{usernameLike} AND u.username LIKE #{usernameLike}
@ -201,6 +201,10 @@
<if test="query.deptId != null and query.deptId != ''"> <if test="query.deptId != null and query.deptId != ''">
AND u.dept_id = #{query.deptId} AND u.dept_id = #{query.deptId}
</if> </if>
<if test="query.hospitalId != null and query.hospitalId != ''">
and u.hospital_id = #{query.hospitalId}
</if>
</where> </where>
<if test="_databaseId != 'mssql'"> <if test="_databaseId != 'mssql'">