Commit 06ccff45 by 阳浪

sort排序

parent 5ac64359
......@@ -66,7 +66,7 @@ public class DataClassificationServiceImpl extends ServiceImpl<DataClassificatio
EntityWrapper<DataClassification> wrapper = new EntityWrapper<DataClassification>(data);
List<String> list = new ArrayList<String>();
list.add("sort");
wrapper.orderDesc(list);
wrapper.orderAsc(list);
return this.selectList(wrapper);
}
......@@ -126,10 +126,13 @@ public class DataClassificationServiceImpl extends ServiceImpl<DataClassificatio
} else {
Map<String, Object> map = null;
for(ClassificationVO vo : list) {
List<String> wrapperList = new ArrayList<String>();
wrapperList.add("sort");
if (vo.getId() != 0L) {
EntityWrapper<DataClassification> wrapper = new EntityWrapper<>();
wrapper.eq("state", 1);
wrapper.eq("parent_id", vo.getId());
wrapper.orderAsc(wrapperList);
List<DataClassification> selectByMap = dataClassificationService.selectList(wrapper);
List<DataClassificationVo> selectVoByMap = new ArrayList<>();
if (CollectionUtil.isNotEmpty(selectByMap)) {
......@@ -142,6 +145,7 @@ public class DataClassificationServiceImpl extends ServiceImpl<DataClassificatio
EntityWrapper<DataClassification> wrapperChild = new EntityWrapper<>();
wrapperChild.eq("state", 1);
wrapperChild.eq("parent_id", entityVo.getId());
wrapperChild.orderAsc(wrapperList);
List<DataClassification> classificationChild = dataClassificationService.selectList(wrapperChild);
List<DataClassificationVo> childClassifyNews = new ArrayList<>();
if (CollectionUtil.isNotEmpty(classificationChild)) {
......@@ -180,6 +184,9 @@ public class DataClassificationServiceImpl extends ServiceImpl<DataClassificatio
dataClassification.setSiteId(context.getSiteId());
dataClassification.setParentId(0L);
EntityWrapper<DataClassification> wrapper = new EntityWrapper<DataClassification>(dataClassification);
List<String> list = new ArrayList<String>();
list.add("sort");
wrapper.orderAsc(list);
return this.selectList(wrapper);
}
......
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