更改角色id查询字段

master
rong.liu 4 years ago
parent 0816c9168b
commit 7d251fcfb3
  1. 20
      src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java
  2. 9
      src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java

@ -155,6 +155,7 @@ public class ProjectManagementController {
// } // }
// return resp; // return resp;
// } // }
/** /**
* 页面查询,排除练习 * 页面查询,排除练习
* <p> * <p>
@ -169,7 +170,7 @@ public class ProjectManagementController {
@ApiParam(name = "userId", value = "用户id", required = true) @RequestParam(required = false) Integer userId, @ApiParam(name = "userId", value = "用户id", required = true) @RequestParam(required = false) Integer userId,
@ApiParam(name = "pageNo", value = "第几页,页码", required = true) @RequestParam Integer pageNo, @ApiParam(name = "pageNo", value = "第几页,页码", required = true) @RequestParam Integer pageNo,
@ApiParam(name = "pageSize", value = "每页展示的数据条数", required = true) @RequestParam Integer pageSize, @ApiParam(name = "pageSize", value = "每页展示的数据条数", required = true) @RequestParam Integer pageSize,
@ApiParam(name = "projectName", value = "项目名称", required = false) @RequestParam String projectName) { @ApiParam(name = "projectName", value = "项目名称", required = false) @RequestParam(required = false) String projectName) {
Response resp = new Response(); Response resp = new Response();
ProjectManagement vo = new ProjectManagement(); ProjectManagement vo = new ProjectManagement();
if (null != systemId) { if (null != systemId) {
@ -178,8 +179,15 @@ public class ProjectManagementController {
if (null != userId) { if (null != userId) {
vo.setUserId(userId); vo.setUserId(userId);
} }
if (null != projectName) {
/*if (null != projectName) {
vo.setQueryName(projectName); vo.setQueryName(projectName);
}*/
if (org.apache.commons.lang3.StringUtils.equals("", projectName)) {
projectName = null;
} }
HashMap<String, Object> ret = service.queryManagements(vo, pageNo, pageSize); HashMap<String, Object> ret = service.queryManagements(vo, pageNo, pageSize);
int status = (int) ret.get("retcode"); int status = (int) ret.get("retcode");
@ -194,12 +202,6 @@ public class ProjectManagementController {
} }
/** /**
* 批量删除 * 批量删除
* *
@ -660,6 +662,7 @@ public class ProjectManagementController {
/** /**
* 判断项目名称是否存在 * 判断项目名称是否存在
*
* @param projectName * @param projectName
* @return * @return
*/ */
@ -759,6 +762,7 @@ public class ProjectManagementController {
/** /**
* 是否启用 * 是否启用
*
* @param enable 0:启用,1:禁用 * @param enable 0:启用,1:禁用
* @param id 项目id * @param id 项目id
*/ */

@ -25,8 +25,7 @@ public interface ProjectManagementMapper {
* 分页查询+条件查询 * 分页查询+条件查询
* *
* @param management * @param management
* @return * @return "select projectId,projectName,projectPermissions,founder,creationTime,state from hr_project_management where isdel=0",
* "select projectId,projectName,projectPermissions,founder,creationTime,state from hr_project_management where isdel=0",
* " <if test='projectPermissions!=null'> and projectPermissions=#{projectPermissions}</if>", * " <if test='projectPermissions!=null'> and projectPermissions=#{projectPermissions}</if>",
* " <if test='founder!=null and userId==null'> and founder=#{founder}</if>",//服务端跳项目管理 * " <if test='founder!=null and userId==null'> and founder=#{founder}</if>",//服务端跳项目管理
* " <if test='founder==null and userId!=null'> and (userId=#{userId} or founder = 0)</if>",//教师端,一开始进入项目管理,看见自己创建的和其他人看见的 * " <if test='founder==null and userId!=null'> and (userId=#{userId} or founder = 0)</if>",//教师端,一开始进入项目管理,看见自己创建的和其他人看见的
@ -69,8 +68,9 @@ public interface ProjectManagementMapper {
@Select({"<script>", @Select({"<script>",
"select * from hr_project_management where enable = 0",//(roleId NOT LIKE '%3%' AND isdel = 0 AND projectPermissions != 0)", "select * from hr_project_management where enable = 0",//(roleId NOT LIKE '%3%' AND isdel = 0 AND projectPermissions != 0)",
"<if test='userId==null'>AND roleId NOT LIKE '%3%' AND isdel = 0 AND projectPermissions != 0</if>", "<if test='userId==null'>AND founder != 14 AND isdel = 0 AND projectPermissions != 0</if>",
" <if test='userId!=null'>AND ((roleId NOT LIKE '%3%' AND isdel = 0 AND projectPermissions != 0) OR ( isdel = 0 AND projectPermissions != 0 AND userId = #{userId} ))</if>",//教师端,一开始进入项目管理,看见自己创建的和其他人看见的 " <if test='userId!=null'>AND ((AND founder != 14 AND isdel = 0 AND projectPermissions != 0) " +
" OR ( isdel = 0 AND projectPermissions != 0 AND userId = #{userId} ))</if>",//教师端,一开始进入项目管理,看见自己创建的和其他人看见的
" <if test='systemId!=null'> and systemId=#{systemId}</if>", " <if test='systemId!=null'> and systemId=#{systemId}</if>",
" <if test='queryName!=null'> and projectName LIKE '%' #{queryName} '%'</if>", " <if test='queryName!=null'> and projectName LIKE '%' #{queryName} '%'</if>",
" ORDER BY creationTime desc", " ORDER BY creationTime desc",
@ -310,6 +310,7 @@ public interface ProjectManagementMapper {
/** /**
* 修改判分点绑定的项目 * 修改判分点绑定的项目
*
* @param projectId * @param projectId
* @param judgmentPointsId * @param judgmentPointsId
*/ */

Loading…
Cancel
Save