提交修改
This commit is contained in:
parent
a376c46294
commit
c91e8e1607
@ -50,4 +50,6 @@ public interface StaffRoleMapper extends BaseMapper<StaffRole> {
|
||||
List<StaffRole> selectByRoleLevel(@Param("name") String name);
|
||||
|
||||
List<StaffRole> selectPageByRoleLevel(@Param("page") IPage page, @Param("name") String name);
|
||||
|
||||
StaffRole selectStaffRolesByStaffIdDepartmentLevel(@Param("staffId") Long staffId, @Param("departmentLevel") String departmentLevel);
|
||||
}
|
||||
@ -407,6 +407,10 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
||||
return R.ok("更新成功");
|
||||
}
|
||||
} else if (roleModel.getStaffId() != null) { // 员工不为空
|
||||
StaffRole data = staffRoleMapper.selectStaffRolesByStaffIdDepartmentLevel(roleModel.getStaffId(),roleModel.getDepartmentLevel());
|
||||
if(data !=null ){
|
||||
return R.error("该管理员己经存在");
|
||||
}
|
||||
staffRole = new StaffRole();
|
||||
com.lz.modules.app.utils.BeanUtils.copyProperty(staffRole, roleModel);
|
||||
staffRole.setStaffName(staffEntity.getName());
|
||||
|
||||
@ -153,6 +153,9 @@
|
||||
<select id="selectPageByRoleLevel" resultType="com.lz.modules.flow.entity.StaffRole">
|
||||
select * from lz_staff_role where is_delete = 0 and department_level = #{name}
|
||||
</select>
|
||||
<select id="selectStaffRolesByStaffIdDepartmentLevel" resultType="com.lz.modules.flow.entity.StaffRole">
|
||||
select * from lz_staff_role where is_delete = 0 and department_level = #{departmentLevel} and staff_id =#{staffId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user