diff --git a/src/main/java/com/example/meetingroom/controller/EmployeeInfoController.java b/src/main/java/com/example/meetingroom/controller/EmployeeInfoController.java index 29c5717bf06f4f93f4988f227b993db8b8846a16..4d959e127b56dd5a580c5bd4d99c82ec132301d0 100644 --- a/src/main/java/com/example/meetingroom/controller/EmployeeInfoController.java +++ b/src/main/java/com/example/meetingroom/controller/EmployeeInfoController.java @@ -1,5 +1,7 @@ package com.example.meetingroom.controller; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.example.meetingroom.entity.EmployeeInfo; import com.example.meetingroom.service.EmployeeInfoService; import com.example.meetingroom.service.RoleService; @@ -79,13 +81,13 @@ public class EmployeeInfoController { * @return * 根据员工姓名和编号查询员工信息 */ - @GetMapping("/employeeInfo/{str}") - public ResultVo selectNameOrNunberObtainEmployeeInfo(@PathVariable("str") String str){ + @GetMapping("/employeeInfoNameNumber") + public ResultVo selectNameOrNumberObtainEmployeeInfo(@RequestBody JSONObject str){ // 授权 Integer role = roleService.superOrCommon(); - List employeeInfoVoList = employeeInfoService.selectNameOrNunberObtainEmployeeInfo(str, role); + List employeeInfoVoList = employeeInfoService.selectNameOrNumberObtainEmployeeInfo(str.getString("str"), role); Map map = new HashMap<>(); diff --git a/src/main/java/com/example/meetingroom/dao/EmployeeInfoDao.java b/src/main/java/com/example/meetingroom/dao/EmployeeInfoDao.java index b81ee66417900856c6ed4818d97f6d57fe9efc41..59cf47d21dd9c2dc4090c04eaedcc9f2e6b195af 100644 --- a/src/main/java/com/example/meetingroom/dao/EmployeeInfoDao.java +++ b/src/main/java/com/example/meetingroom/dao/EmployeeInfoDao.java @@ -88,7 +88,7 @@ public interface EmployeeInfoDao { * @return * 根据员工姓名和编号查询员工信息 */ - List selectNameOrNunberObtainEmployeeInfo(@Param("str")String str, @Param("role")Integer role); + List selectNameOrNumberObtainEmployeeInfo(@Param("str")String str, @Param("role")Integer role); /** * 根据账号和密码得到EmployeeInfo diff --git a/src/main/java/com/example/meetingroom/service/EmployeeInfoService.java b/src/main/java/com/example/meetingroom/service/EmployeeInfoService.java index fae991b06c8fc85fb4cd48061d9e081ccfc758bc..b833789447f37da50459c1f235ce9c17ad9b9b0d 100644 --- a/src/main/java/com/example/meetingroom/service/EmployeeInfoService.java +++ b/src/main/java/com/example/meetingroom/service/EmployeeInfoService.java @@ -27,7 +27,7 @@ public interface EmployeeInfoService { * @return * 根据员工姓名和编号查询员工信息 */ - List selectNameOrNunberObtainEmployeeInfo(String str,Integer role); + List selectNameOrNumberObtainEmployeeInfo(String str,Integer role); /** * @function: 联表查询返回的数据 diff --git a/src/main/java/com/example/meetingroom/service/impl/EmployeeInfoServiceImpl.java b/src/main/java/com/example/meetingroom/service/impl/EmployeeInfoServiceImpl.java index 64cfbd62cad40a48d58cdb896c4e36e0f7a1d032..f02d39b4ec650b5b46cb773991fd8d1c941a77d6 100644 --- a/src/main/java/com/example/meetingroom/service/impl/EmployeeInfoServiceImpl.java +++ b/src/main/java/com/example/meetingroom/service/impl/EmployeeInfoServiceImpl.java @@ -60,8 +60,8 @@ public class EmployeeInfoServiceImpl implements EmployeeInfoService { * 根据员工姓名和编号查询员工信息 */ @Override - public List selectNameOrNunberObtainEmployeeInfo(String str, Integer role){ - return employeeInfoDao.selectNameOrNunberObtainEmployeeInfo(str, role); + public List selectNameOrNumberObtainEmployeeInfo(String str, Integer role){ + return employeeInfoDao.selectNameOrNumberObtainEmployeeInfo(str, role); } /** diff --git a/src/main/resources/mapper/EmployeeInfoMapper.xml b/src/main/resources/mapper/EmployeeInfoMapper.xml index f2597466248b03164b2ec29cb56713bdc9fb1ad5..4895abfcb5423ec52fadacb0b01a2251b0d07526 100644 --- a/src/main/resources/mapper/EmployeeInfoMapper.xml +++ b/src/main/resources/mapper/EmployeeInfoMapper.xml @@ -101,7 +101,7 @@ - select role.name as roleName,depart.name as departName,e.id,e.number,e.name,e.phone,if(e.sex=1,'男','女') as sexString,e.sex,e.password