Commit f11f1c16 by zhiwj

查询添加参数

parent ab12249b
...@@ -15,6 +15,7 @@ public class IndexQO extends PageQO implements Serializable { ...@@ -15,6 +15,7 @@ public class IndexQO extends PageQO implements Serializable {
private String moduleId; private String moduleId;
private Integer isAppIndex; private Integer isAppIndex;
private String search; private String search;
private Integer indexLevel;
private Integer indexGroupId; private Integer indexGroupId;
private List<Integer> indexIdList; private List<Integer> indexIdList;
...@@ -65,4 +66,12 @@ public class IndexQO extends PageQO implements Serializable { ...@@ -65,4 +66,12 @@ public class IndexQO extends PageQO implements Serializable {
public void setIndexGroupId(Integer indexGroupId) { public void setIndexGroupId(Integer indexGroupId) {
this.indexGroupId = indexGroupId; this.indexGroupId = indexGroupId;
} }
public Integer getIndexLevel() {
return indexLevel;
}
public void setIndexLevel(Integer indexLevel) {
this.indexLevel = indexLevel;
}
} }
...@@ -60,7 +60,7 @@ public interface IndexApiService { ...@@ -60,7 +60,7 @@ public interface IndexApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.cloud.dto.IndexDTO>> * @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.cloud.dto.IndexDTO>>
* @throws * @throws
*/ */
ServiceResponse<List<IndexDTO>> listAllIndex(); ServiceResponse<List<IndexDTO>> listAllIndex(IndexQO indexQO);
/** /**
* @Title: delete * @Title: delete
......
...@@ -85,7 +85,7 @@ public class IndexController { ...@@ -85,7 +85,7 @@ public class IndexController {
@RequestMapping("/list-all-index") @RequestMapping("/list-all-index")
public RestResponse listAllIndex(IndexQO indexQO) { public RestResponse listAllIndex(IndexQO indexQO) {
ServiceResponse<List<IndexDTO>> serviceResponse = indexApiService.listAllIndex(); ServiceResponse<List<IndexDTO>> serviceResponse = indexApiService.listAllIndex(indexQO);
return ResultControllerUtils.commonResult(serviceResponse); return ResultControllerUtils.commonResult(serviceResponse);
} }
...@@ -110,7 +110,7 @@ public class IndexController { ...@@ -110,7 +110,7 @@ public class IndexController {
String realName = UserUtils.getUser().getRealName(); String realName = UserUtils.getUser().getRealName();
List<Integer> indexIdList; List<Integer> indexIdList;
if ("all".equals(indexIds)) { if ("all".equals(indexIds)) {
List<IndexDTO> list = indexApiService.listAllIndex().getResult(); List<IndexDTO> list = indexApiService.listAllIndex(new IndexQO()).getResult();
indexIdList = list.stream().map(IndexDTO::getIndexId).collect(Collectors.toList()); indexIdList = list.stream().map(IndexDTO::getIndexId).collect(Collectors.toList());
} else { } else {
indexIdList = Stream.of(indexIds.split(",")).map(Integer::valueOf).collect(Collectors.toList()); indexIdList = Stream.of(indexIds.split(",")).map(Integer::valueOf).collect(Collectors.toList());
......
...@@ -79,7 +79,7 @@ public class IndexServiceImpl implements IndexService { ...@@ -79,7 +79,7 @@ public class IndexServiceImpl implements IndexService {
@Override @Override
public List<TabIndex> listAllIndex(IndexQO indexQO) { public List<TabIndex> listAllIndex(IndexQO indexQO) {
return tabIndexMapper.listIndex(new IndexQO()); return tabIndexMapper.listIndex(indexQO);
} }
@Override @Override
......
...@@ -133,8 +133,8 @@ public class IndexApiServiceImpl implements IndexApiService { ...@@ -133,8 +133,8 @@ public class IndexApiServiceImpl implements IndexApiService {
} }
@Override @Override
public ServiceResponse<List<IndexDTO>> listAllIndex() { public ServiceResponse<List<IndexDTO>> listAllIndex(IndexQO indexQO) {
List<TabIndex> tabIndices = indexService.listAllIndex(new IndexQO()); List<TabIndex> tabIndices = indexService.listAllIndex(indexQO);
List<IndexDTO> dtoList = EntityUtil.changeEntityListByJSON(IndexDTO.class, tabIndices); List<IndexDTO> dtoList = EntityUtil.changeEntityListByJSON(IndexDTO.class, tabIndices);
return EnterpriseServiceResponse.success(dtoList); return EnterpriseServiceResponse.success(dtoList);
} }
......
...@@ -378,6 +378,9 @@ ...@@ -378,6 +378,9 @@
<if test="indexGroupId != null "> <if test="indexGroupId != null ">
and (index_group_id = #{indexGroupId} or index_group_id is null) and (index_group_id = #{indexGroupId} or index_group_id is null)
</if> </if>
<if test="indexLevel != null ">
and index_level = #{indexLevel}
</if>
<if test="null != indexIdList and indexIdList.size > 0"> <if test="null != indexIdList and indexIdList.size > 0">
and index_id in and index_id in
<foreach collection="indexIdList" index="index" item="item" open="(" separator="," close=")"> <foreach collection="indexIdList" index="index" item="item" open="(" separator="," close=")">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment