|
@@ -18,6 +18,7 @@ import org.springframework.stereotype.Service;
|
|
import tk.mybatis.mapper.entity.Condition;
|
|
import tk.mybatis.mapper.entity.Condition;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -35,28 +36,36 @@ public class MournServiceImpl extends IBaseServiceImpl<MournEntity, Long> implem
|
|
return this.entityMapper;
|
|
return this.entityMapper;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// @Override
|
|
|
|
+// public Result<MournEntity> search(PageDateDto param, Integer display) {
|
|
|
|
+// startPage(param);
|
|
|
|
+// Condition condition = new Condition(MournEntity.class);
|
|
|
|
+// String searchKey = param.getSearchKey();
|
|
|
|
+// if (StringUtils.isNotBlank(searchKey)) {
|
|
|
|
+// searchKey = StringUtils.trim(searchKey);
|
|
|
|
+// condition.and().orLike("realName", "%" + searchKey + "%")
|
|
|
|
+// .orLike("unit", "%" + searchKey + "%");
|
|
|
|
+// }
|
|
|
|
+// String startTime = param.getStartTime();
|
|
|
|
+// String endTime = param.getEndTime();
|
|
|
|
+// if (StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)) {
|
|
|
|
+// condition.and().andBetween("createTime", startTime, endTime);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// if (display != null) {
|
|
|
|
+// condition.and().andEqualTo("display", display);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// condition.orderBy("createTime").desc();
|
|
|
|
+// PageInfo<MournEntity> pageInfo = this.findAll(condition, param.getPageNum(), param.getPageSize());
|
|
|
|
+// return Result.success(pageInfo);
|
|
|
|
+// }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public Result<MournEntity> search(PageDateDto param, Integer display) {
|
|
public Result<MournEntity> search(PageDateDto param, Integer display) {
|
|
startPage(param);
|
|
startPage(param);
|
|
- Condition condition = new Condition(MournEntity.class);
|
|
|
|
- String searchKey = param.getSearchKey();
|
|
|
|
- if (StringUtils.isNotBlank(searchKey)) {
|
|
|
|
- searchKey = StringUtils.trim(searchKey);
|
|
|
|
- condition.and().orLike("realName", "%" + searchKey + "%")
|
|
|
|
- .orLike("unit", "%" + searchKey + "%");
|
|
|
|
- }
|
|
|
|
- String startTime = param.getStartTime();
|
|
|
|
- String endTime = param.getEndTime();
|
|
|
|
- if (StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)) {
|
|
|
|
- condition.and().andBetween("createTime", startTime, endTime);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (display != null) {
|
|
|
|
- condition.and().andEqualTo("display", display);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- condition.orderBy("createTime").desc();
|
|
|
|
- PageInfo<MournEntity> pageInfo = this.findAll(condition, param.getPageNum(), param.getPageSize());
|
|
|
|
|
|
+ List<MournEntity> list = entityMapper.search(param, display);
|
|
|
|
+ PageInfo<MournEntity> pageInfo = new PageInfo<>(list);
|
|
return Result.success(pageInfo);
|
|
return Result.success(pageInfo);
|
|
}
|
|
}
|
|
|
|
|