Commit ca8a5cb3 by zhiwj

修改bug

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