|
|
|
|
@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
|
import com.github.xiaoymin.knife4j.core.util.StrUtil; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
|
@ -27,7 +28,9 @@ import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -53,8 +56,14 @@ public class ReagentController extends BladeController { |
|
|
|
|
LambdaQueryWrapper<Reagent> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
// 模糊搜索
|
|
|
|
|
if (StringUtil.isNoneBlank(entry.getName())) { |
|
|
|
|
wrapper.like(Reagent::getManufacturer, entry.getName()).or(); |
|
|
|
|
wrapper.like(Reagent::getName, entry.getName()); |
|
|
|
|
String searchKeyword = entry.getName().trim(); |
|
|
|
|
List<String> keywordList = Arrays.stream(searchKeyword.split("\\s+")) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
for (String keyword : keywordList) { |
|
|
|
|
wrapper.and(w -> w.like(Reagent::getName, keyword) |
|
|
|
|
.or() |
|
|
|
|
.like(Reagent::getManufacturer, keyword)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 时间范围搜索
|
|
|
|
|
if (entry.getStartTime() != null && entry.getEndTime() != null) { |
|
|
|
|
|