diff --git a/renren-admin/src/main/java/io/renren/modules/demanData/service/impl/TDemandDataServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/demanData/service/impl/TDemandDataServiceImpl.java index a9f39cfe..53de3468 100644 --- a/renren-admin/src/main/java/io/renren/modules/demanData/service/impl/TDemandDataServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/demanData/service/impl/TDemandDataServiceImpl.java @@ -1,6 +1,7 @@ package io.renren.modules.demanData.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.renren.common.constant.Constant; import io.renren.common.service.impl.CrudServiceImpl; import io.renren.modules.demanData.dao.TDemandDataDao; import io.renren.modules.demanData.dto.TDemandDataDTO; @@ -34,6 +35,9 @@ public class TDemandDataServiceImpl extends CrudServiceImpl> page(@ApiIgnore @RequestParam Map params) { diff --git a/renren-admin/src/main/java/io/renren/modules/demandComment/service/impl/TDemandCommentServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/demandComment/service/impl/TDemandCommentServiceImpl.java index 513e13f9..87221b58 100644 --- a/renren-admin/src/main/java/io/renren/modules/demandComment/service/impl/TDemandCommentServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/demandComment/service/impl/TDemandCommentServiceImpl.java @@ -2,14 +2,19 @@ package io.renren.modules.demandComment.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import io.renren.common.constant.Constant; import io.renren.common.service.impl.CrudServiceImpl; +import io.renren.modules.demanData.service.TDemandDataService; import io.renren.modules.demandComment.dao.TDemandCommentDao; import io.renren.modules.demandComment.dto.TDemandCommentDTO; import io.renren.modules.demandComment.entity.TDemandCommentEntity; import io.renren.modules.demandComment.service.TDemandCommentService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.HashMap; import java.util.Map; +import java.util.stream.Collectors; /** * 需求评论 @@ -19,6 +24,8 @@ import java.util.Map; */ @Service public class TDemandCommentServiceImpl extends CrudServiceImpl implements TDemandCommentService { + @Autowired + private TDemandDataService tDemandDataService; @Override public QueryWrapper getWrapper(Map params) { @@ -31,9 +38,18 @@ public class TDemandCommentServiceImpl extends CrudServiceImpl() { + { + put(Constant.SEARCHKEY, params.get(Constant.SEARCHKEY).toString()); + } + }).stream().map(index_ -> index_.getId()).collect(Collectors.toList()).toArray()); + } + break; } }); -// wrapper.groupBy("target_id"); + wrapper.orderByDesc("create_date"); return wrapper; } diff --git a/renren-common/src/main/java/io/renren/common/constant/Constant.java b/renren-common/src/main/java/io/renren/common/constant/Constant.java index 03ad1619..104bc037 100644 --- a/renren-common/src/main/java/io/renren/common/constant/Constant.java +++ b/renren-common/src/main/java/io/renren/common/constant/Constant.java @@ -2,9 +2,12 @@ package io.renren.common.constant; /** * 常量 - * */ public interface Constant { + /** + * 模糊查询时key + */ + String SEARCHKEY = "searchKey"; /** * 成功 */ @@ -34,7 +37,7 @@ public interface Constant { */ Long DICT_ROOT = 0L; /** - * 升序 + * 升序 */ String ASC = "asc"; /**