定制版修复-0.2

master
mzh820631607 4 years ago
parent fab7ae885b
commit 2f156cf27a
  1. 35
      src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java
  2. 6
      src/main/java/com/yipin/liuwanr/service/ProjectManagementService.java

@ -47,14 +47,10 @@ public interface ProjectManagementMapper {
*/ */
@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 (roleId NOT LIKE '%3%' AND isdel = 0)",
" <if test='userId!=null'>OR ( isdel = 0 AND userId = #{userId} )</if>",//教师端,一开始进入项目管理,看见自己创建的和其他人看见的
" <if test='projectPermissions!=null'> and projectPermissions=#{projectPermissions}</if>", " <if test='projectPermissions!=null'> and projectPermissions=#{projectPermissions}</if>",
// " <if test='founder!=null'> and founder=#{founder}</if>",
// " <if test='userId!=null'> and (userId=#{userId} or founder = 0)</if>",
// " <if test='userId==null and founder!=null '> and founder=#{founder}</if>",//服务端跳项目管理
" <if test='userId!=null'> and (userId=#{userId} or roleId not like '%3%')</if>",//教师端,一开始进入项目管理,看见自己创建的和其他人看见的
" <if test='founder!=null'> and founder=#{founder}</if>",//教师选择创建人为系统 " <if test='founder!=null'> and founder=#{founder}</if>",//教师选择创建人为系统
// " <if test='userId!=null and founder==1'> and userId=#{userId}</if>",//教师选则创建人为老师
" <if test='state!=null'> and state=#{state}</if>", " <if test='state!=null'> and state=#{state}</if>",
" <if test='systemId!=null'> and systemId=#{systemId}</if>", " <if test='systemId!=null'> and systemId=#{systemId}</if>",
" <if test='projectName!=null'> and projectName like concat('%',#{projectName},'%')</if>", " <if test='projectName!=null'> and projectName like concat('%',#{projectName},'%')</if>",
@ -79,8 +75,8 @@ public interface ProjectManagementMapper {
// List<ProjectManagement> queryManagements(ProjectManagement management); // List<ProjectManagement> queryManagements(ProjectManagement management);
@Select({"<script>", @Select({"<script>",
"select * from hr_project_management where isdel=0 and projectPermissions !=0", "select * from hr_project_management where (roleId NOT LIKE '%3%' AND isdel = 0 AND projectPermissions != 0)",
" <if test='userId!=null'> and (userId=#{userId} or roleId not like '%3%')</if>",//教师端,一开始进入项目管理,看见自己创建的和其他人看见的 " <if test='userId!=null'>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>",
" ORDER BY creationTime desc", " ORDER BY creationTime desc",
"</script>"}) "</script>"})
@ -111,9 +107,21 @@ public interface ProjectManagementMapper {
* @param projectId * @param projectId
*/ */
@Update("<script>" @Update("<script>"
+ "update hr_project_management set isdel=1 where projectId=#{projectId}" + "update hr_project_management hpm ,tms_experimental_teaching tet " +
"set hpm.isdel=1 ,tet.is_del = 1 " +
"where hpm.projectId=#{projectId} and hpm.projectId = tet.project_id"
+ "</script>") + "</script>")
void deleteProjectManagement(Integer projectId); void deleteProjectManagement(Integer projectId);
// 202.10.29 标准版
// /**
// * 批量删除
// *
// * @param projectId
// */
// @Update("<script>"
// + "update hr_project_management set isdel=1 where projectId=#{projectId}"
// + "</script>")
// void deleteProjectManagement(Integer projectId);
/** /**
@ -308,4 +316,13 @@ public interface ProjectManagementMapper {
Integer queryRoleId(Integer userId); Integer queryRoleId(Integer userId);
@Select("SELECT id FROM tms_experimental_teaching WHERE project_id =#{projectId}")
List<Integer> queryproject(Integer projectId);
@Update("<script>"
+ "update hr_project_management " +
"set isdel=1 " +
"where projectId=#{projectId}"
+ "</script>")
void daleteManegement(Integer id);
} }

@ -180,6 +180,12 @@ public class ProjectManagementService {
int size = projectId.size(); int size = projectId.size();
for (int i = 0;i<size;i++){ for (int i = 0;i<size;i++){
Integer id = projectId.get(i); Integer id = projectId.get(i);
List<Integer> result = mapper.queryproject(id);
if (result.size()==0){
mapper.daleteManegement(id);
}
mapper.deleteProjectManagement(id); mapper.deleteProjectManagement(id);
} }
resp.put("retcode", 200); resp.put("retcode", 200);

Loading…
Cancel
Save