Commit ca8a5cb3 by zhiwj

修改bug

parent 1dbbf374
package com.gic.cloud.qo;
import java.io.Serializable;
import java.util.List;
/**
* @author zhiwj
......@@ -14,6 +15,7 @@ public class IndexQO extends PageQO implements Serializable {
private String moduleId;
private Integer isAppIndex;
private String search;
private List<Integer> indexIdList;
public Integer getClassifyType() {
return classifyType;
......@@ -46,4 +48,12 @@ public class IndexQO extends PageQO implements Serializable {
public void setSearch(String search) {
this.search = search;
}
public void setIndexIdList(List<Integer> indexIdList) {
this.indexIdList = indexIdList;
}
public List<Integer> getIndexIdList() {
return indexIdList;
}
}
......@@ -62,7 +62,9 @@ public interface TabIndexModuleRelMapper {
List<String> listModuleIdByBusinessId(@Param("businessId") Integer businessId, @Param("type") Integer type);
List<Integer> listBusinessIdByModuleId(@Param("moduleId") Integer moduleId);
List<Integer> listBusinessIdByModuleId(@Param("moduleId") String moduleId);
List<Integer> listBusinessIdByModuleIds(@Param("moduleIdList") List<String> moduleIdList);
List<TabIndexModuleRel> listModuleIdByBusinessIds(@Param("ids") List<Integer> businessIdList, @Param("type") Integer type);
}
\ No newline at end of file
......@@ -13,7 +13,9 @@ public interface IndexModuleRelService {
List<String> listModuleIdByBusinessId(Integer indexId, Integer type);
List<Integer> listBusinessIdByModuleId(Integer moduleId);
List<Integer> listBusinessIdByModuleId(String moduleId);
List<Integer> listBusinessIdByModuleIds(List<String> moduleIdList);
void deleteByBusinessId(Integer businessId, Integer type);
......
......@@ -48,11 +48,16 @@ public class IndexModuleRelServiceImpl implements IndexModuleRelService {
}
@Override
public List<Integer> listBusinessIdByModuleId(Integer moduleId) {
public List<Integer> listBusinessIdByModuleId(String moduleId) {
return tabIndexModuleRelMapper.listBusinessIdByModuleId(moduleId);
}
@Override
public List<Integer> listBusinessIdByModuleIds(List<String> moduleIdList) {
return tabIndexModuleRelMapper.listBusinessIdByModuleIds(moduleIdList);
}
@Override
public void deleteByBusinessId(Integer businessId, Integer type) {
tabIndexModuleRelMapper.delByBusinessId(businessId, type);
}
......
......@@ -4,13 +4,16 @@ import com.gic.cloud.dao.mapper.TabIndexMapper;
import com.gic.cloud.dto.IndexDTO;
import com.gic.cloud.entity.TabIndex;
import com.gic.cloud.qo.IndexQO;
import com.gic.cloud.service.IndexModuleRelService;
import com.gic.cloud.service.IndexService;
import com.gic.commons.util.EntityUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
......@@ -24,6 +27,8 @@ public class IndexServiceImpl implements IndexService {
@Autowired
private TabIndexMapper tabIndexMapper;
@Autowired
private IndexModuleRelService indexModuleRelService;
@Override
public boolean isNameRepeat(String name, Integer indexId) {
......@@ -65,6 +70,10 @@ public class IndexServiceImpl implements IndexService {
@Override
public Page<TabIndex> listIndex(IndexQO indexQO) {
PageHelper.startPage(indexQO.getCurrentPage(), indexQO.getPageSize());
if (StringUtils.isNotBlank(indexQO.getModuleId())) {
List<Integer> indexIdList = indexModuleRelService.listBusinessIdByModuleIds(Arrays.asList(indexQO.getModuleId().split(",")));
indexQO.setIndexIdList(indexIdList);
}
return tabIndexMapper.listIndex(indexQO);
}
......
......@@ -369,15 +369,18 @@
<if test="classifyType != null ">
and classify_type = #{classifyType}
</if>
<if test="moduleId != null ">
and module_id = #{moduleId}
</if>
<if test="isAppIndex != null ">
and is_app_index = #{isAppIndex}
</if>
<if test="search != null and search != '' ">
and name like concat('%', #{search}, '%')
</if>
<if test="null != indexIdList and indexIdList.size > 0">
and index_id in
<foreach collection="indexIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
order by create_time desc
</select>
</mapper>
\ No newline at end of file
......@@ -168,6 +168,18 @@
from tab_index_module_rel
where status = 1 and module_id = #{moduleId}
</select>
<select id="listBusinessIdByModuleIds" resultMap="BaseResultMap">
select
module_id
from tab_index_module_rel
where status = 1
<if test="null != ids and ids.size > 0">
and module_id in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="listModuleIdByBusinessIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
......
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