Browse Source

问题不显示

tags/v1.1.0
qiujinyang 2 years ago
parent
commit
0bf7573a21
1 changed files with 13 additions and 5 deletions
  1. +13
    -5
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/QuestionServiceImpl.java

+ 13
- 5
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/QuestionServiceImpl.java View File

@@ -66,14 +66,18 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio
try {
// 获取分页数据
IPage<Question> page = new Page<>(query.getPage(), query.getLimit());
pageData = questionMapper.selectPage(page, new LambdaQueryWrapper<Question>()

LambdaQueryWrapper<Question> questionLambdaQueryWrapper = new LambdaQueryWrapper<Question>()
.eq(ObjectUtil.isNotEmpty(query.getMissionId()), Question::getMissionId, query.getMissionId())
.like(ObjectUtil.isNotEmpty(query.getName()), Question::getMissionName, query.getName())
.between((ObjectUtil.isNotEmpty(query.getStartTime()) && ObjectUtil.isNotEmpty(query.getEndTime())), Question::getCreateTime, dateformat.parse(query.getStartTime()), dateformat.parse(query.getEndTime()))
.eq(ObjectUtil.isNotEmpty(query.getType()), Question::getType, query.getType())
.eq(ObjectUtil.isNotEmpty(query.getStatus()), Question::getStatus, query.getStatus())
//.eq(Question::getTenantId, ShiroUtils.getTenantId())
.eq(Question::getMark, MarkTypeEnum.VALID.getCode()).orderByDesc(Question::getCreateTime));
.eq(Question::getMark, MarkTypeEnum.VALID.getCode()).orderByDesc(Question::getCreateTime);
if(ObjectUtil.isNotEmpty(query.getStartTime()) && ObjectUtil.isNotEmpty(query.getEndTime())){
questionLambdaQueryWrapper.between(Question::getCreateTime, dateformat.parse(query.getStartTime()), dateformat.parse(query.getEndTime()));
}
pageData = questionMapper.selectPage(page, questionLambdaQueryWrapper);
}catch (Exception e){
e.printStackTrace();
log.error("查询出错!");
@@ -95,7 +99,7 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio
return new ArrayList<>();
}
try {
return questionMapper.selectList(new LambdaQueryWrapper<Question>()
LambdaQueryWrapper<Question> questionLambdaQueryWrapper = new LambdaQueryWrapper<Question>()
//只需要取最上面的那一条
.eq(Question::getMissionId, thMissions.get(0).getId())
.like(ObjectUtil.isNotEmpty(query.getName()), Question::getMissionName, query.getName())
@@ -103,7 +107,11 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio
.eq(ObjectUtil.isNotEmpty(query.getType()), Question::getType, query.getType())
.eq(Question::getStatus, QuestionStatusEnum.CONFIRM.getCode())
//.eq(Question::getTenantId, ShiroUtils.getTenantId())
.eq(Question::getMark, MarkTypeEnum.VALID.getCode()).orderByDesc(Question::getCreateTime));
.eq(Question::getMark, MarkTypeEnum.VALID.getCode()).orderByDesc(Question::getCreateTime);
if(ObjectUtil.isNotEmpty(query.getStartTime()) && ObjectUtil.isNotEmpty(query.getEndTime())){
questionLambdaQueryWrapper.between(Question::getCreateTime, dateformat.parse(query.getStartTime()), dateformat.parse(query.getEndTime()));
}
return questionMapper.selectList(questionLambdaQueryWrapper);
}catch (Exception e){
e.printStackTrace();
log.error("查询出错!");

Loading…
Cancel
Save