|
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.hfln.portal.common.dto.data.event.EventListDTO;
|
|
|
import com.hfln.portal.common.request.event.EventListParams;
|
|
|
+import com.hfln.portal.common.request.event.WapEventListParams;
|
|
|
import com.hfln.portal.infrastructure.mapper.EventListMapper;
|
|
|
import com.hfln.portal.infrastructure.po.EventList;
|
|
|
import com.hfln.portal.infrastructure.service.EventListService;
|
|
@@ -20,7 +21,7 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
public class EventListServiceImpl extends ServiceImpl<EventListMapper, EventList> implements EventListService {
|
|
|
@Override
|
|
|
- public Page<EventList> queryEventList(EventListParams params, List<Long> devIdList) {
|
|
|
+ public Page<EventList> WebQueryEventList(EventListParams params, List<Long> devIdList) {
|
|
|
Page<EventList> page = new Page<>(params.getPageNo(), params.getPageSize());
|
|
|
|
|
|
// 2. 构建查询条件
|
|
@@ -68,4 +69,26 @@ public class EventListServiceImpl extends ServiceImpl<EventListMapper, EventList
|
|
|
})
|
|
|
.collect(Collectors.toList());
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Page<EventList> WapQueryEventList(WapEventListParams params) {
|
|
|
+ Page<EventList> page = new Page<>(params.getPageNo(), params.getPageSize());
|
|
|
+
|
|
|
+ // 2. 构建查询条件,根据devId查询记录
|
|
|
+ LambdaQueryWrapper<EventList> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(EventList::getDevId, params.getDevId());
|
|
|
+
|
|
|
+ // 3. 添加日期条件
|
|
|
+ if (Objects.nonNull(params.getCreateTimeStart())) {
|
|
|
+ queryWrapper.ge(EventList::getCreateTime, params.getCreateTimeStart());
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(params.getCreateTimeEnd())) {
|
|
|
+ queryWrapper.lt(EventList::getCreateTime, params.getCreateTimeEnd().plusDays(1));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 4. 设置排序
|
|
|
+ queryWrapper.orderByDesc(EventList::getCreateTime);
|
|
|
+ return this.baseMapper.selectPage(page, queryWrapper);
|
|
|
+ }
|
|
|
}
|