|
|
@ -17,6 +17,7 @@ |
|
|
|
|
|
|
|
package com.elink.esua.epdc.service.impl; |
|
|
|
|
|
|
|
import cn.hutool.core.map.MapUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
@ -30,6 +31,7 @@ import com.elink.esua.epdc.dto.NewsCategoryDTO; |
|
|
|
import com.elink.esua.epdc.entity.NewsCategoryEntity; |
|
|
|
import com.elink.esua.epdc.service.NewsCategoryService; |
|
|
|
import com.elink.esua.epdc.service.NewsService; |
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -68,11 +70,13 @@ public class NewsCategoryServiceImpl extends BaseServiceImpl<NewsCategoryDao, Ne |
|
|
|
} |
|
|
|
|
|
|
|
private QueryWrapper<NewsCategoryEntity> getWrapper(Map<String, Object> params) { |
|
|
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
|
|
|
String sectionCode = MapUtils.getString(params,"sectionCode"); |
|
|
|
String id = MapUtils.getString(params,FieldConstant.ID_HUMP); |
|
|
|
|
|
|
|
QueryWrapper<NewsCategoryEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|
|
|
wrapper.orderByDesc("SORT"); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(sectionCode), "SECTION_CODE", sectionCode); |
|
|
|
wrapper.orderByAsc("SORT"); |
|
|
|
|
|
|
|
return wrapper; |
|
|
|
} |
|
|
|