diff --git a/xm-core/src/main/java/com/xm/core/ctrl/XmIterationController.java b/xm-core/src/main/java/com/xm/core/ctrl/XmIterationController.java index 5dedc010..8db8e90a 100644 --- a/xm-core/src/main/java/com/xm/core/ctrl/XmIterationController.java +++ b/xm-core/src/main/java/com/xm/core/ctrl/XmIterationController.java @@ -107,23 +107,24 @@ public class XmIterationController { String linkProjectId=(String) params.get("linkProjectId"); User user = LoginUtils.getCurrentUserInfo(); params.put("userid",user.getUserid()); + params.remove("branchId"); + QueryWrapper qw=QueryTools.initQueryWrapper(XmIteration.class,params); if( !( StringUtils.hasText(branchId)|| StringUtils.hasText(id) || StringUtils.hasText(productId)|| StringUtils.hasText(menuId)||ids!=null || StringUtils.hasText(adminUserid) ) ){ if(LoginUtils.isBranchAdmin()){ - params.put("branchId",user.getBranchId()); + qw.eq("res.branch_id",user.getBranchId()); }else{ if(!StringUtils.hasText(productId) && !StringUtils.hasText(linkProjectId)){ params.put("compete",user.getUserid()); }else{ - params.put("branchId",user.getBranchId()); + qw.eq("res.branch_id",user.getBranchId()); } } } if("branchId".equals(queryScope)){ - params.put("branchId",user.getBranchId()); + qw.eq("res.branch_id",user.getBranchId()); } - QueryWrapper qw = QueryTools.initQueryWrapper(XmIteration.class , params); - List> datas = xmIterationService.selectListMapByWhere(page,qw,params); + List> datas = xmIterationService.selectListMapByWhere(page,qw,params); return Result.ok("query-ok","查询成功").setData(datas).setTotal(page.getTotal()); //列出XmIteration列表 } @@ -148,25 +149,26 @@ public class XmIterationController { String linkProjectId=(String) params.get("linkProjectId"); User user = LoginUtils.getCurrentUserInfo(); params.put("userid",user.getUserid()); + params.remove("branchId"); + QueryWrapper qw=QueryTools.initQueryWrapper(XmIteration.class,params); if( !(StringUtils.hasText(branchId)|| StringUtils.hasText(id) || StringUtils.hasText(productId)|| StringUtils.hasText(menuId)||ids!=null || StringUtils.hasText(adminUserid) ) ){ if(LoginUtils.isBranchAdmin()){ - params.put("branchId",user.getBranchId()); + qw.eq("res.branch_id",user.getBranchId()); }else{ if(!StringUtils.hasText(productId) && !StringUtils.hasText(linkProjectId)){ params.put("compete",user.getUserid()); }else{ - params.put("branchId",user.getBranchId()); - } + qw.eq("res.branch_id",user.getBranchId()); + } } } if("branchId".equals(queryScope)){ - params.put("branchId",user.getBranchId()); + qw.eq("res.branch_id",user.getBranchId()); } - QueryWrapper qw=QueryTools.initQueryWrapper(XmIteration.class,params); List> datas = xmIterationService.selectListMapByWhereWithState(page,qw,params); //列出XmIteration列表 - return Result.ok().setData(datas); + return Result.ok().setData(datas).setTotal(page.getTotal()); } diff --git a/xm-core/src/main/java/com/xm/core/mapper/XmIterationMapper.xml b/xm-core/src/main/java/com/xm/core/mapper/XmIterationMapper.xml index 43a43405..518873f6 100644 --- a/xm-core/src/main/java/com/xm/core/mapper/XmIterationMapper.xml +++ b/xm-core/src/main/java/com/xm/core/mapper/XmIterationMapper.xml @@ -16,27 +16,27 @@ - and res.ctime > #{createTimeStart} - and res.ctime < #{createTimeEnd} - and res.online_time > #{onlineTimeStart} - and res.online_time < #{onlineTimeEnd} - - and exists ( select 1 from xm_menu im where im.iteration_id=res.id and im.menu_id=#{menuId} - and im.product_id=#{productId} + and res.ctime > #{ext.createTimeStart} + and res.ctime < #{ext.createTimeEnd} + and res.online_time > #{ext.onlineTimeStart} + and res.online_time < #{ext.onlineTimeEnd} + + and exists ( select 1 from xm_menu im where im.iteration_id=res.id and im.menu_id=#{ext.menuId} + and im.product_id=#{ext.productId} ) - + and exists( select 1 from xm_product_project_link ppl - where ppl.project_id=#{linkProjectId} and ppl.product_id =res.product_id + where ppl.project_id=#{ext.linkProjectId} and ppl.product_id =res.product_id ) - - and ( res.admin_userid=#{compete} - or exists (select 1 from xm_menu m where m.mm_userid=#{compete} and m.iteration_id=res.id) + + and ( res.admin_userid=#{ext.compete} + or exists (select 1 from xm_menu m where m.mm_userid=#{ext.compete} and m.iteration_id=res.id) ) - and res.iteration_name like #{key} + and res.iteration_name like #{ext.key} diff --git a/xm-core/src/main/java/com/xm/core/mapper/XmTaskMapper.xml b/xm-core/src/main/java/com/xm/core/mapper/XmTaskMapper.xml index 286c3fe9..af16a5fc 100644 --- a/xm-core/src/main/java/com/xm/core/mapper/XmTaskMapper.xml +++ b/xm-core/src/main/java/com/xm/core/mapper/XmTaskMapper.xml @@ -53,7 +53,7 @@ - and exists ( select 1 from xm_task_execuser exe where exe.task_id=res.id and exe.userid=#{ext.userid} + and exists ( select 1 from xm_task_execuser exe where exe.task_id=res.id and (exe.prj_userid=#{ext.userid} or exe.bid_userid=#{ext.userid}) and exe.status=#{ext.myExecuserStatus} @@ -71,9 +71,7 @@ ) - and ( exists ( select 1 from xm_group_user gu where gu.userid=#{ext.compete} and gu.project_id=res.project_id ) - or exists ( select 1 from xm_task_execuser exe where exe.project_id=res.project_id and exe.userid=#{ext.compete}) - ) + and exists ( select 1 from xm_task_execuser exe where exe.project_id=res.project_id and (exe.prj_userid=#{ext.compete} or exe.bid_userid=#{ext.compete}))