陈裕财 2 years ago
parent
commit
9e3419ca12
  1. 24
      xm-core/src/main/java/com/xm/core/ctrl/XmIterationController.java
  2. 26
      xm-core/src/main/java/com/xm/core/mapper/XmIterationMapper.xml
  3. 6
      xm-core/src/main/java/com/xm/core/mapper/XmTaskMapper.xml

24
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<XmIteration> 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<XmIteration> qw = QueryTools.initQueryWrapper(XmIteration.class , params);
List<Map<String,Object>> datas = xmIterationService.selectListMapByWhere(page,qw,params);
List<Map<String,Object>> 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<XmIteration> 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<XmIteration> qw=QueryTools.initQueryWrapper(XmIteration.class,params);
List<Map<String,Object>> datas = xmIterationService.selectListMapByWhereWithState(page,qw,params); //列出XmIteration列表
return Result.ok().setData(datas);
return Result.ok().setData(datas).setTotal(page.getTotal());
}

26
xm-core/src/main/java/com/xm/core/mapper/XmIterationMapper.xml

@ -16,27 +16,27 @@
</select>
<sql id="whereForMap">
<if test=" createTimeStart !=null "> and res.ctime &gt; #{createTimeStart} </if>
<if test=" createTimeEnd !=null "> and res.ctime &lt; #{createTimeEnd} </if>
<if test=" onlineTimeStart !=null "> and res.online_time &gt; #{onlineTimeStart} </if>
<if test=" onlineTimeEnd !=null "> and res.online_time &lt; #{onlineTimeEnd} </if>
<if test=" ( menuId != null and menuId !='')">
and exists ( select 1 from xm_menu im where im.iteration_id=res.id and im.menu_id=#{menuId}
<if test="productId != null and productId !='' "> and im.product_id=#{productId} </if>
<if test="ext.createTimeStart !=null "> and res.ctime &gt; #{ext.createTimeStart} </if>
<if test="ext.createTimeEnd !=null "> and res.ctime &lt; #{ext.createTimeEnd} </if>
<if test="ext.onlineTimeStart !=null "> and res.online_time &gt; #{ext.onlineTimeStart} </if>
<if test="ext.onlineTimeEnd !=null "> and res.online_time &lt; #{ext.onlineTimeEnd} </if>
<if test="ext.menuId != null and ext.menuId !=''">
and exists ( select 1 from xm_menu im where im.iteration_id=res.id and im.menu_id=#{ext.menuId}
<if test="ext.productId != null and ext.productId !='' "> and im.product_id=#{ext.productId} </if>
)
</if>
<if test=" linkProjectId !=null and linkProjectId!=''">
<if test="ext.linkProjectId !=null and ext.linkProjectId!=''">
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
)
</if>
<if test="compete !=null and compete!=''">
and ( res.admin_userid=#{compete}
or exists (select 1 from xm_menu m where m.mm_userid=#{compete} and m.iteration_id=res.id)
<if test="ext.compete !=null and ext.compete!=''">
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)
)
</if>
<if test="key != null and key !='' "> and res.iteration_name like #{key} </if>
<if test="ext.key != null and ext.key !='' "> and res.iteration_name like #{ext.key} </if>
</sql>

6
xm-core/src/main/java/com/xm/core/mapper/XmTaskMapper.xml

@ -53,7 +53,7 @@
</if>
<!-- 我参与的-->
<if test="(ext.myExecuserStatus != null and ext.myExecuserStatus) != '' or ( ext.isMy !=null and ext.isMy !='' )">
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})
<if test='ext.myExecuserStatus != "all" and ext.myExecuserStatus!=null and ext.myExecuserStatus !="" '>
and exe.status=#{ext.myExecuserStatus}
</if>
@ -71,9 +71,7 @@
)
</if>
<if test="ext.compete !=null and ext.compete!=''">
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}))
</if>
<if test="ext.iterationId!=null and ext.iterationId!=''">

Loading…
Cancel
Save