Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java
master
mzh820631607 4 years ago
commit d190715ffa
  1. 31
      src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java
  2. 18
      src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java
  3. 15
      src/main/java/com/yipin/liuwanr/service/ProjectManagementService.java

@ -524,4 +524,35 @@ public class ProjectManagementController {
} }
return resp; return resp;
} }
/**
* 川大查询项目管理
* <p>
*
* @param projectPermissions:权限
* @return
*/
@ApiOperation(value = "川大查询项目管理列表", notes = "川大查询项目管理列表")
@GetMapping("/getManagements")
Response getManagements(
@ApiParam(name = "projectPermissions", value = "项目权限(0、练习 1、考核 2、竞赛)", required = true) @RequestParam(required = true) Integer projectPermissions){
Response resp = new Response();
ProjectManagement vo = new ProjectManagement();
if (null == projectPermissions) {
resp.setStatus(300);
resp.setErrmessage("项目权限不能为空!");
}else {
HashMap<String, Object> ret = service.getManagements(projectPermissions);
int status = (int) ret.get("retcode");
if (status == 200) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
}
}
return resp;
}
} }

@ -63,16 +63,6 @@ public interface ProjectManagementMapper {
" ORDER BY creationTime desc", " ORDER BY creationTime desc",
"</script>"}) "</script>"})
List<ProjectManagement> queryManagements(ProjectManagement management); List<ProjectManagement> queryManagements(ProjectManagement management);
@Select({"<script>",
"select * from hr_project_management where isdel = 0 AND userId = #{userId}",
" <if test='projectPermissions!=null'> and projectPermissions=#{projectPermissions}</if>",
" <if test='founder!=null'> and founder=#{founder}</if>",//教师选择创建人为系统
" <if test='state!=null'> and state=#{state}</if>",
" <if test='systemId!=null'> and systemId=#{systemId}</if>",
" <if test='projectName!=null'> and projectName like concat('%',#{projectName},'%')</if>",
" ORDER BY creationTime desc",
"</script>"})
List<ProjectManagement> queryUserManagements(ProjectManagement vo);
// @Select({"<script>", // @Select({"<script>",
//// "select projectId,projectName,projectPermissions,founder,creationTime,state,knowledgePoints,experimentIntroduction from hr_project_management where isdel=0", //// "select projectId,projectName,projectPermissions,founder,creationTime,state,knowledgePoints,experimentIntroduction from hr_project_management where isdel=0",
// "select * from hr_project_management where isdel=0", // "select * from hr_project_management where isdel=0",
@ -349,6 +339,14 @@ public interface ProjectManagementMapper {
String queryRoleIds(Integer userId); String queryRoleIds(Integer userId);
/**
* 查询项目名称
*
* @param projectPermissions
* @return
*/
@Select("select * from hr_project_management where projectPermissions=#{projectPermissions}")
List<ProjectManagement> getManagements(Integer projectPermissions);
@Select("SELECT id FROM tms_experimental_teaching WHERE project_id =#{projectId}") @Select("SELECT id FROM tms_experimental_teaching WHERE project_id =#{projectId}")
List<Integer> queryproject(Integer projectId); List<Integer> queryproject(Integer projectId);

@ -688,4 +688,19 @@ public class ProjectManagementService {
return resp; return resp;
} }
public HashMap<String, Object> getManagements(Integer projectPermissions){
HashMap<String, Object> resp = new HashMap<String, Object>();
try{
List<ProjectManagement> projectManagements = mapper.getManagements(projectPermissions);
resp.put("retcode", 200);
resp.put("retvalue",projectManagements);
}catch (RuntimeException e){
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "数据有误,查询失败!");
throw new RuntimeException();
}
return resp;
}
} }

Loading…
Cancel
Save