Browse Source

优化查询条件,查询范围

master
陈裕财 5 years ago
parent
commit
3e3d33b898
  1. 15
      .idea/xm-backend.iml
  2. 15
      xm-bootstrap/xm-bootstrap.iml
  3. 28
      xm-core/src/main/java/com/xm/core/ctrl/XmIterationController.java
  4. 15
      xm-core/src/main/java/com/xm/core/ctrl/XmMenuController.java
  5. 59
      xm-core/src/main/java/com/xm/core/ctrl/XmProductController.java
  6. 14
      xm-core/src/main/java/com/xm/core/ctrl/XmProjectController.java
  7. 9
      xm-core/src/main/java/com/xm/core/ctrl/XmQuestionController.java
  8. 19
      xm-core/src/main/java/com/xm/core/ctrl/XmTaskController.java
  9. 8
      xm-core/src/main/java/com/xm/core/service/XmProjectService.java
  10. 22
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmIterationMapper.xml
  11. 16
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMenuMapper.xml
  12. 22
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml
  13. 8
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectMapper.xml
  14. 14
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmQuestionMapper.xml
  15. 10
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskMapper.xml
  16. 17
      xm-core/xm-core.iml

15
.idea/xm-backend.iml

@ -54,8 +54,15 @@
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-oauth2-resource-server:5.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-oauth2-core:5.4.2" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-audit-log-client:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-tpa-client:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-micro-client:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.3.2" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-audit-log-client:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.59" level="project" />
<orderEntry type="library" name="Maven: net.coobird:thumbnailator:0.4.8" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.17" level="project" />
@ -94,11 +101,6 @@
<orderEntry type="library" name="Maven: com.mdp:mdp-msg-client:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-boot-starter:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-redis:1.4.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.3.2" level="project" />
<orderEntry type="library" name="Maven: redis.clients:jedis:3.3.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.9.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework.session:spring-session-data-redis:2.4.1" level="project" />
@ -121,7 +123,6 @@
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.41" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-spring-enhance:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.2" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-dao-mybatis:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-mybatis-enhance:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.2.0" level="project" />

15
xm-bootstrap/xm-bootstrap.iml

@ -98,7 +98,6 @@
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-loadbalancer:3.0.0" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor.addons:reactor-extra:3.4.1" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.4.1" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.3.2" level="project" />
<orderEntry type="library" name="Maven: com.stoyanr:evictor:1.0.0" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-oauth2-client-cloud:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-oauth2-client:2.4.1" level="project" />
@ -121,10 +120,6 @@
<orderEntry type="module" module-name="xm-core" />
<orderEntry type="library" name="Maven: com.mdp:mdp-boot-starter:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-redis:1.4.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.3.2" level="project" />
<orderEntry type="library" name="Maven: redis.clients:jedis:3.3.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.9.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework.session:spring-session-data-redis:2.4.1" level="project" />
@ -165,8 +160,15 @@
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.4.1" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-oauth2-resource-server:5.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-oauth2-core:5.4.2" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-audit-log-client:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-tpa-client:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-micro-client:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.3.2" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-audit-log-client:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: net.coobird:thumbnailator:0.4.8" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.17" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.15" level="project" />
@ -209,7 +211,6 @@
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.41" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-spring-enhance:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.2" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-dao-mybatis:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-mybatis-enhance:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.2.0" level="project" />

28
xm-core/src/main/java/com/xm/core/ctrl/XmIterationController.java

@ -74,13 +74,25 @@ public class XmIterationController {
})
@RequestMapping(value="/list",method=RequestMethod.GET)
public Map<String,Object> listXmIteration( @RequestParam Map<String,Object> xmIteration){
Map<String,Object> m = new HashMap<>();
Map<String,Object> m = new HashMap<>();
Tips tips=new Tips("查询成功");
RequestUtils.transformArray(xmIteration, "ids");
PageUtils.startPage(xmIteration);
String id= (String) xmIteration.get("id");
Object ids= xmIteration.get("ids");
String productId= (String) xmIteration.get("productId");
String adminUserid= (String) xmIteration.get("adminUserid");
String menuId= (String) xmIteration.get("menuId");
User user = LoginUtils.getCurrentUserInfo();
xmIteration.put("userid",user.getUserid());
if( !(StringUtils.hasText(id) || StringUtils.hasText(productId)|| StringUtils.hasText(menuId)||ids!=null
|| StringUtils.hasText(adminUserid) ) ){
xmIteration.put("compete",user.getUserid());
}
List<Map<String,Object>> xmIterationList = xmIterationService.selectListMapByWhere(xmIteration); //列出XmIteration列表
PageUtils.responePage(m, xmIterationList);
m.put("data",xmIterationList);
Tips tips=new Tips("查询成功");
m.put("tips", tips);
return m;
}
@ -94,6 +106,18 @@ public class XmIterationController {
Map<String,Object> m = new HashMap<>();
RequestUtils.transformArray(xmIteration, "ids");
PageUtils.startPage(xmIteration);
String id= (String) xmIteration.get("id");
Object ids= xmIteration.get("ids");
String productId= (String) xmIteration.get("productId");
String adminUserid= (String) xmIteration.get("adminUserid");
String menuId= (String) xmIteration.get("menuId");
User user = LoginUtils.getCurrentUserInfo();
xmIteration.put("userid",user.getUserid());
if( !(StringUtils.hasText(id) || StringUtils.hasText(productId)|| StringUtils.hasText(menuId)||ids!=null
|| StringUtils.hasText(adminUserid) ) ){
xmIteration.put("compete",user.getUserid());
}
List<Map<String,Object>> xmIterationList = xmIterationService.selectListMapByWhereWithState(xmIteration); //列出XmIteration列表
PageUtils.responePage(m, xmIterationList);
m.put("data",xmIterationList);

15
xm-core/src/main/java/com/xm/core/ctrl/XmMenuController.java

@ -83,6 +83,21 @@ public class XmMenuController {
RequestUtils.transformArray(xmMenu, "menuIds");
PageUtils.startPage(xmMenu);
Tips tips=new Tips("查询成功");
String menuId= (String) xmMenu.get("menuId");
Object menuIds= xmMenu.get("menuIds");
String projectId= (String) xmMenu.get("projectId");
String mmUserid= (String) xmMenu.get("mmUserid");
String pmenuId= (String) xmMenu.get("pmenuId");
String productId= (String) xmMenu.get("productId");
String excludeIterationId= (String) xmMenu.get("excludeIterationId");
User user = LoginUtils.getCurrentUserInfo();
xmMenu.put("userid",user.getUserid());
if( !StringUtils.hasText(menuId) && !(StringUtils.hasText(projectId) || StringUtils.hasText(mmUserid)|| StringUtils.hasText(pmenuId)||menuIds!=null
|| StringUtils.hasText(productId) || StringUtils.hasText(excludeIterationId) ) ){
xmMenu.put("compete",user.getUserid());
}
List<Map<String,Object>> xmMenuList = xmMenuService.selectListMapByWhereWithState(xmMenu); //列出XmMenu列表
PageUtils.responePage(m, xmMenuList);
m.put("data",xmMenuList);

59
xm-core/src/main/java/com/xm/core/ctrl/XmProductController.java

@ -59,13 +59,39 @@ public class XmProductController {
})
@RequestMapping(value="/list",method=RequestMethod.GET)
public Map<String,Object> listXmProduct( @RequestParam Map<String,Object> xmProduct){
Map<String,Object> m = new HashMap<>();
Map<String,Object> m = new HashMap<>();
Tips tips=new Tips("查询成功");
RequestUtils.transformArray(xmProduct, "ids");
PageUtils.startPage(xmProduct);
String id= (String) xmProduct.get("id");
Object ids= xmProduct.get("ids");
String projectId= (String) xmProduct.get("projectId");
String pmUserid= (String) xmProduct.get("pmUserid");
String queryScope= (String) xmProduct.get("queryScope");
User user = LoginUtils.getCurrentUserInfo();
if("branchId".equals(queryScope)){
xmProduct.put("branchId",user.getBranchId());
}else if("compete".equals(queryScope)){
xmProduct.put("branchId",null);
xmProduct.put("compete",user.getUserid());
}else if("productId".equals(queryScope)){
if(!StringUtils.hasText(id)){
tips.setFailureMsg("产品编号id必输");
m.put("tips", tips);
return m;
}
}
xmProduct.put("userid",user.getUserid());
if( !StringUtils.hasText(queryScope) && !(StringUtils.hasText(id) || StringUtils.hasText(projectId)|| StringUtils.hasText(pmUserid)||ids!=null
||ids!=null ) ){
xmProduct.put("compete",user.getUserid());
}
List<Map<String,Object>> xmProductList = xmProductService.selectListMapByWhere(xmProduct); //列出XmProduct列表
PageUtils.responePage(m, xmProductList);
m.put("data",xmProductList);
Tips tips=new Tips("查询成功");
m.put("tips", tips);
return m;
}
@ -75,13 +101,38 @@ public class XmProductController {
})
@RequestMapping(value="/listWithState",method=RequestMethod.GET)
public Map<String,Object> listWithState( @RequestParam Map<String,Object> xmProduct){
Map<String,Object> m = new HashMap<>();
Map<String,Object> m = new HashMap<>();
Tips tips=new Tips("查询成功");
RequestUtils.transformArray(xmProduct, "ids");
PageUtils.startPage(xmProduct);
String id= (String) xmProduct.get("id");
Object ids= xmProduct.get("ids");
String projectId= (String) xmProduct.get("projectId");
String pmUserid= (String) xmProduct.get("pmUserid");
String queryScope= (String) xmProduct.get("queryScope");
User user = LoginUtils.getCurrentUserInfo();
if("branchId".equals(queryScope)){
xmProduct.put("branchId",user.getBranchId());
}else if("compete".equals(queryScope)){
xmProduct.put("branchId",null);
xmProduct.put("compete",user.getUserid());
}else if("productId".equals(queryScope)){
if(!StringUtils.hasText(id)){
tips.setFailureMsg("产品编号id必输");
m.put("tips", tips);
return m;
}
}
xmProduct.put("userid",user.getUserid());
if( !StringUtils.hasText(queryScope) && !(StringUtils.hasText(id) || StringUtils.hasText(projectId)|| StringUtils.hasText(pmUserid)||ids!=null
||ids!=null ) ){
xmProduct.put("compete",user.getUserid());
}
List<Map<String,Object>> xmProductList = xmProductService.selectListMapByWhereWithState(xmProduct); //列出XmProduct列表
PageUtils.responePage(m, xmProductList);
m.put("data",xmProductList);
Tips tips=new Tips("查询成功");
m.put("tips", tips);
return m;
}

14
xm-core/src/main/java/com/xm/core/ctrl/XmProjectController.java

@ -82,6 +82,20 @@ public class XmProjectController {
RequestUtils.transformArray(xmProject, "ids");
RequestUtils.transformArray(xmProject, "pgTypeIds");
PageUtils.startPage(xmProject);
String id= (String) xmProject.get("id");
Object ids= xmProject.get("ids");
String productId= (String) xmProject.get("productId");
String myFocus= (String) xmProject.get("myFocus");
String myExecuserStatus= (String) xmProject.get("myExecuserStatus");
Object pgTypeIds= xmProject.get("pgTypeIds");
String createUserid= (String) xmProject.get("createUserid");
User user = LoginUtils.getCurrentUserInfo();
xmProject.put("userid",user.getUserid());
if( !(StringUtils.hasText(id) || StringUtils.hasText(myFocus)|| StringUtils.hasText(productId)||ids!=null
|| StringUtils.hasText(myExecuserStatus)||pgTypeIds!=null|| StringUtils.hasText(createUserid)) ){
xmProject.put("compete",user.getUserid());
}
List<Map<String,Object>> xmProjectList = xmProjectService.getProject(xmProject); //列出XmProject列表
PageUtils.responePage(m, xmProjectList);
m.put("data",xmProjectList);

9
xm-core/src/main/java/com/xm/core/ctrl/XmQuestionController.java

@ -99,7 +99,11 @@ public class XmQuestionController {
public Map<String,Object> listXmQuestion( @RequestParam Map<String,Object> xmQuestion){
Map<String,Object> m = new HashMap<>();
RequestUtils.transformArray(xmQuestion, "ids");
RequestUtils.transformArray(xmQuestion, "menuIds");
PageUtils.startPage(xmQuestion);
User user = LoginUtils.getCurrentUserInfo();
xmQuestion.put("compete",user.getUserid());
List<Map<String,Object>> xmQuestionList = xmQuestionService.getQuestion(xmQuestion); //列出XmQuestion列表
PageUtils.responePage(m, xmQuestionList);
m.put("data",xmQuestionList);
@ -120,6 +124,11 @@ public class XmQuestionController {
Map<String,Object> m = new HashMap<>();
Tips tips=new Tips("成功新增一条数据");
try{
if(StringUtils.hasText(xmQuestionVo.getProjectId())){
tips.setFailureMsg("项目编号projectId必传");
m.put("tips", tips);
return m;
}
User user=LoginUtils.getCurrentUserInfo();
if(!StringUtils.hasText(xmQuestionVo.getQtype())){
xmQuestionVo.setQtype("bug");

19
xm-core/src/main/java/com/xm/core/ctrl/XmTaskController.java

@ -117,10 +117,21 @@ public class XmTaskController {
if(!"1".equals(taskOut)){
String projectId= (String) xmTask.get("projectId");
String projectPhaseId= (String) xmTask.get("projectPhaseId");
String userid= (String) xmTask.get("userid");
if( !(StringUtils.hasText(projectId) || StringUtils.hasText(projectPhaseId)|| StringUtils.hasText(userid) ) ){
User user = LoginUtils.getCurrentUserInfo();
xmTask.put("cbranchId",user.getBranchId());
String myExecuserStatus= (String) xmTask.get("myExecuserStatus");
String isMy= (String) xmTask.get("isMy");
String myFocus= (String) xmTask.get("myFocus");
String createUserid= (String) xmTask.get("createUserid");
String executorUserid= (String) xmTask.get("executorUserid");
String menuId= (String) xmTask.get("menuId");
String productId= (String) xmTask.get("productId");
String iterationId= (String) xmTask.get("iterationId");
User user = LoginUtils.getCurrentUserInfo();
xmTask.put("userid",user.getUserid());
if( !(StringUtils.hasText(projectId) || StringUtils.hasText(projectPhaseId)
|| StringUtils.hasText(myExecuserStatus)|| StringUtils.hasText(isMy)|| StringUtils.hasText(myFocus)|| StringUtils.hasText(createUserid)
|| StringUtils.hasText(executorUserid) || StringUtils.hasText(menuId) || StringUtils.hasText(productId)|| StringUtils.hasText(iterationId)) ){
xmTask.put("compete",user.getUserid());
}
}
List<Map<String,Object>> xmTaskVoList = xmTaskService.getTask(xmTask); //列出XmTask列表

8
xm-core/src/main/java/com/xm/core/service/XmProjectService.java

@ -79,13 +79,7 @@ public class XmProjectService extends BaseService {
/** 请在此类添加自定义函数 */
public List<Map<String,Object>> getProject(Map<String,Object> params) {
List<Map<String,Object>> xmProjectList = null;
if(params.containsKey("compete")){
params.put("userid", LoginUtils.getCurrentUserInfo().getUserid());
xmProjectList = this.selectListMapByWhere(params);
}else{
xmProjectList = this.selectListMapByWhere(params); //列出XmProject列表
}
List<Map<String,Object>> xmProjectList = this.selectListMapByWhere(params); //列出XmProject列表
return xmProjectList;
}

22
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmIterationMapper.xml

@ -20,14 +20,19 @@
</foreach>
</if>
<include refid="where"/>
<if test="key != null and key !='' "> </if>
<if test="( productId != null and productId !='') or ( menuId != null and menuId !='')">
and exists ( select 1 from XM.xm_iteration_menu im where im.iteration_id=res.id
<if test="productId != null and productId !='' "> and im.product_id=#{productId} </if>
<if test="menuId != null and menuId !='' "> and im.menu_id=#{menuId} </if>
)
</if>
</if>
<if test="compete !=null and compete!=''">
and ( res.admin_userid=#{compete}
or exists (select 1 from XM.xm_iteration_menu im left join xm.xm_menu m on im.product_id=m.product_id where m.mm_userid=#{compete} and im.iteration_id=res.id)
)
</if>
<if test="key != null and key !='' "> and res.iteration_name like #{key} </if>
</where>
</select>
<!--结束 自定义sql函数区域-->
@ -45,14 +50,19 @@
</foreach>
</if>
<include refid="where"/>
<if test="key != null and key !='' "> </if>
<if test="( productId != null and productId !='') or ( menuId != null and menuId !='')">
and exists ( select 1 from XM.xm_iteration_menu im where im.iteration_id=res.id
<if test="productId != null and productId !='' "> and im.product_id=#{productId} </if>
<if test="menuId != null and menuId !='' "> and im.menu_id=#{menuId} </if>
)
</if>
</if>
<if test="compete !=null and compete!=''">
and ( res.admin_userid=#{compete}
or exists (select 1 from XM.xm_iteration_menu im left join xm.xm_menu m on im.product_id=m.product_id where m.mm_userid=#{compete} and im.iteration_id=res.id)
)
</if>
<if test="key != null and key !='' "> and res.iteration_name like #{key} </if>
</where>
</select>

16
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMenuMapper.xml

@ -28,9 +28,14 @@
</foreach>
</if>
<include refid="where"/>
<if test="key != null and key !='' "> </if>
<if test=" excludeIterationId !=null and excludeIterationId !='' "> and not exists ( select 1 from XM.xm_iteration_menu im where im.iteration_id=#{excludeIterationId} and im.menu_id=res.menu_id)</if>
<if test="compete !=null and compete!=''">
and ( exists ( select 1 from XM.xm_menu m1 where m.mm_userid=#{compete} and m.product_id=res.product_id)
or exists ( select 1 from xm_product p where p.pm_userid=#{compete} and res.product_id=p.id)
)
</if>
<if test="key != null and key !='' "> and res.menu_name like #{key} </if>
</where>
order by res.seq_no asc
</select>
@ -47,7 +52,12 @@
<if test="key != null and key !='' "> </if>
<if test=" projectId !=null and projectId !='' "> and plan.project_id=#{projectId}</if>
<if test=" excludeIterationId !=null and excludeIterationId !='' "> and not exists ( select 1 from XM.xm_iteration_menu im where im.iteration_id=#{excludeIterationId} and im.menu_id=res.menu_id)</if>
<if test="compete !=null and compete!=''">
and ( exists ( select 1 from XM.xm_menu m1 where m.mm_userid=#{compete} and m.product_id=res.product_id)
or exists ( select 1 from xm_product p where p.pm_userid=#{compete} and res.product_id=p.id)
)
</if>
<if test="key != null and key !='' "> and res.menu_name like #{key} </if>
</where>
order by res.seq_no asc

22
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml

@ -16,9 +16,14 @@
</foreach>
</if>
<include refid="where"/>
<if test="key != null and key !='' "> </if>
<if test="projectId != null and projectId !='' "> and exists (select 1 from XM.xm_task t left join XM.xm_menu m on t.menu_id=m.menu_id and t.project_id=#{projectId} where t.project_id=#{projectId} and m.product_id=res.id) </if>
<if test="projectId != null and projectId !='' "> and exists (select 1 from XM.xm_task t left join XM.xm_menu m on t.menu_id=m.menu_id and t.project_id=#{projectId} where t.project_id=#{projectId} and m.product_id=res.id) </if>
<if test="compete !=null and compete!=''">
and ( exists ( select 1 from xm_project_group_user gu inner join XM.xm_task t on gu.project_id=t.project_id and t.product_id=res.id where gu.userid=#{compete} and t.product_id=res.id )
or res.pm_userid=#{compete}
or exists ( select 1 from xm_menu m where m.mm_userid=#{compete} and m.product_id=res.id)
)
</if>
<if test="key != null and key !='' "> and res.product_name like #{key} </if>
</where>
</select>
@ -37,9 +42,14 @@
</foreach>
</if>
<include refid="where"/>
<if test="key != null and key !='' "> </if>
<if test="projectId != null and projectId !='' "> and exists (select 1 from XM.xm_task t left join XM.xm_menu m on t.menu_id=m.menu_id and t.project_id=#{projectId} where t.project_id=#{projectId} and m.product_id=res.id) </if>
<if test="key != null and key !='' "> and res.product_name like #{key} </if>
<if test="projectId != null and projectId !='' "> and exists (select 1 from XM.xm_task t left join XM.xm_menu m on t.menu_id=m.menu_id and t.project_id=#{projectId} where t.project_id=#{projectId} and m.product_id=res.id) </if>
<if test="compete !=null and compete!=''">
and ( exists ( select 1 from xm_project_group_user gu inner join XM.xm_task t on gu.project_id=t.project_id and t.product_id=res.id where gu.userid=#{compete} and t.product_id=res.id )
or res.pm_userid=#{compete}
or exists ( select 1 from xm_menu m where m.mm_userid=#{compete} and m.product_id=res.id)
)
</if>
</where>
</select>

8
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectMapper.xml

@ -85,8 +85,8 @@
<!-- 我参与的 包括我创建的,我监控的,我审核的-->
<if test=" compete !=null and compete !='' ">
and ( exists ( select 1 from XM.xm_project_group g,XM.xm_project_group_user gu where gu.group_id=g.id and gu.userid=#{userid} and g.project_id=res.id )
or res.create_userid=#{userid}
or exists ( select 1 from XM.xm_task_execuser exe where exe.project_id=res.id and exe.userid=#{userid} )
or res.create_userid=#{compete}
or exists ( select 1 from XM.xm_task_execuser exe where exe.project_id=res.id and exe.userid=#{compete} )
)
</if>
<!-- 按参与角色查询等-->
@ -110,9 +110,9 @@
<if test="myFocus != null and myFocus != ''">
and exists ( select 1 from XM.xm_my_focus f where f.userid=#{userid} and f.project_id=res.id )
</if>
<if test="key != null and key !='' "> </if>
<if test="productId != null and productId !='' "> and exists ( select 1 from XM.xm_task t left join XM.xm_menu m on t.menu_id=m.menu_id and m.product_id=#{productId} where m.product_id=#{productId} and t.project_id=res.id) </if>
<if test="key != null and key !='' "> and res.name like #{key} </if>
</where>
</select>

14
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmQuestionMapper.xml

@ -68,8 +68,18 @@
</foreach>
</if>
<include refid="where"/>
<if test="key != null and key !='' "> </if>
<if test="work != null and work != ''"> and res.status != '已解决' </if>
<if test="myUserid != null and myUserid != ''"> and ( res.create_userid=#{myUserid} or res.handler_userid=#{myUserid}) </if>
<if test="menuIds != null"> and
res.menu_id in
<foreach collection="menuIds" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
<if test="compete !=null and compete!=''">
and exists ( select 1 from xm_project_group_user gu where gu.userid=#{compete} and gu.project_id=res.project_id )
</if>
<if test="key != null and key !='' "> and res.name like #{key} </if>
<if test="work != null and work != ''"> and res.status != 'resolved' </if>
</where>
</select>

10
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTaskMapper.xml

@ -121,8 +121,6 @@
</foreach>
</if>
<include refid="where"/>
<if test="key != null and key !='' "> and res.name like #{key} </if>
<if test="work != null and work != ''"> and res.rate != '100' </if>
<if test="parent != null and parent != ''"> and (res.parent_taskid = '' or res.parent_taskid IS NULL)</if>
<!-- 我参与的-->
@ -144,6 +142,14 @@
</foreach>
)
</if>
<if test="compete !=null and compete!=''">
and ( exists ( select 1 from xm_project_group_user gu where gu.userid=#{compete} and gu.project_id=res.project_id )
or exists ( select 1 from XM.xm_task_execuser exe where exe.project_id=res.project_id and exe.userid=#{compete})
)
</if>
<if test="key != null and key !='' "> and res.name like #{key} </if>
<if test="work != null and work != ''"> and res.rate != '100' </if>
</where>
order by res.sort_level asc
</select>

17
xm-core/xm-core.iml

@ -13,11 +13,6 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: com.mdp:mdp-boot-starter:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-redis:1.4.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.3.2" level="project" />
<orderEntry type="library" name="Maven: redis.clients:jedis:3.3.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.9.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework.session:spring-session-data-redis:2.4.1" level="project" />
@ -33,11 +28,19 @@
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.3" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.3" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-ds:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-oauth2-client:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-tpa-client:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-security:2.4.1" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-config:5.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-web:5.4.2" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-micro-client:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.4.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.3.2" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-oauth2-client:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-qx-api:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-oauth2-client:2.4.1" level="project" />
<orderEntry type="library" name="Maven: com.sun.mail:jakarta.mail:1.6.5" level="project" />
@ -98,7 +101,6 @@
<orderEntry type="library" name="Maven: org.jsoup:jsoup:1.11.3" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.59" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-audit-log-client:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-micro-client:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-core-api:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.11.3" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.11.3" level="project" />
@ -124,7 +126,6 @@
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.41" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-spring-enhance:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.2" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-dao-mybatis:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.mdp:mdp-mybatis-enhance:M.1.0.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.2.0" level="project" />

Loading…
Cancel
Save