Commit 036e7127 by 阳浪

优化投稿列表查询

parent 90193cb8
......@@ -25,7 +25,6 @@ public interface DictionaryMapper extends BaseMapper<Dictionary> {
* @param enabledSensitive true:仅取可用的数据字典,false:不管可用不可用都取
* @return
*/
@Select("SELECT getDictChildList(#{id}, #{includeParent}, #{layer}, #{enabledSensitive})")
String getDictChildList(@Param("id") Long id,
@Param("includeParent") Boolean includeParent,
@Param("layer") Integer layer,
......
......@@ -132,6 +132,9 @@ public class DictionaryServiceImpl extends ServiceImpl<DictionaryMapper, Diction
for (String item : ids) {
idList.add(new Long(item));
}
if(includeParent){
idList.add(id);
}
return this.selectBatchIds(idList);
}
return new ArrayList<Dictionary>();
......@@ -143,6 +146,7 @@ public class DictionaryServiceImpl extends ServiceImpl<DictionaryMapper, Diction
StringBuilder idsToDeleteSb = new StringBuilder();
for (int i = 0; i < ids.length; i++) {
idsToDeleteSb.append("," + dictionaryMapper.getDictChildList(ids[i], true, null, true));
idsToDeleteSb.append("," +ids[i]);
}
String[] idsToDeleteStr = idsToDeleteSb.toString().split(",");
......
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