文件结构修改,以及新增方法根据岗位查询用户,用于技术员等查询(未完成)
This commit is contained in:
parent
11ede5a585
commit
f81cdcc18e
@ -3,6 +3,7 @@ package com.zhyc.module.biosafety.controller;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhyc.common.utils.SecurityUtils;
|
||||
import com.zhyc.module.biosafety.service.IHealthService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -97,7 +98,7 @@ public class HealthController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biosafety:health:remove')")
|
||||
@Log(title = "保健", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(healthService.deleteHealthByIds(ids));
|
||||
|
@ -0,0 +1,27 @@
|
||||
package com.zhyc.module.common.controller;
|
||||
|
||||
import com.zhyc.common.core.domain.AjaxResult;
|
||||
import com.zhyc.module.common.domain.UserPost;
|
||||
|
||||
import com.zhyc.module.common.service.UserPostService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
//人员用户
|
||||
@RestController
|
||||
@RequestMapping("/user")
|
||||
public class UserController {
|
||||
@Autowired
|
||||
UserPostService userPostService;
|
||||
|
||||
@GetMapping()
|
||||
public AjaxResult getUserPost(String postCode){
|
||||
List<UserPost> list = userPostService.getUserPostListByCode(postCode);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.zhyc.module.common.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UserPost {
|
||||
// 用户名
|
||||
private String nickName;
|
||||
// 用户
|
||||
private String postName;
|
||||
// 岗位编码
|
||||
private String postCode;
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.zhyc.module.common.mapper;
|
||||
|
||||
import com.zhyc.module.common.domain.UserPost;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface UserPostMapper {
|
||||
|
||||
List<UserPost> getUserPostListByCode(String postCode);
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.zhyc.module.common.service;
|
||||
|
||||
import com.zhyc.module.common.domain.UserPost;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UserPostService {
|
||||
List<UserPost> getUserPostListByCode(String postCode);
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.zhyc.module.common.service.impl;
|
||||
|
||||
import com.zhyc.module.common.domain.UserPost;
|
||||
import com.zhyc.module.common.mapper.UserPostMapper;
|
||||
import com.zhyc.module.common.service.UserPostService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class UserPostServiceImpl implements UserPostService {
|
||||
@Autowired
|
||||
UserPostMapper userPostMapper;
|
||||
@Override
|
||||
public List<UserPost> getUserPostListByCode(String postCode) {
|
||||
return userPostMapper.getUserPostListByCode(postCode);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhyc.module.common.mapper.UserPostMapper">
|
||||
|
||||
<resultMap type="UserPost" id="UserPostResult">
|
||||
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="postName" column="post_name"/>
|
||||
<result property="postCode" column="post_code" />
|
||||
</resultMap>
|
||||
|
||||
<select id="getUserPostListByCode" resultMap="UserPostResult">
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user