【update】部分筛选修改为右模糊匹配

This commit is contained in:
nixj 2024-06-28 13:13:09 +08:00
parent 50a0813ce1
commit 68f38e8470
2 changed files with 4 additions and 7 deletions

View File

@ -87,7 +87,7 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai
Page<? extends BaseExcel> data=new PageImpl<>(Collections.emptyList());
//申请单查询
if (!dto.getActualOrderNo().isEmpty()){
List<String> orderNos=jdbcRouteRepository.findByActualOrderNo("%" + dto.getActualOrderNo() + "%");
List<String> orderNos=jdbcRouteRepository.findByActualOrderNo(dto.getActualOrderNo() + "%");
if (orderNos.isEmpty()){
return new PageResult<BaseExcel>(0,new ArrayList<>());
}
@ -167,7 +167,7 @@ public class JdbcConsumptionDetailRepositoryImpl implements JdbcConsumptionDetai
private static String getString(ConsumptionDetailQuery dto, String query, Map<String, Object> params, PageRequest pageRequest) {
if (!dto.getUserName().isEmpty()) {
dto.setUserName("%"+ dto.getUserName()+"%");
dto.setUserName(dto.getUserName()+"%");
query +="AND user_name LIKE (:userName)";
}

View File

@ -224,12 +224,9 @@ public class ManageServiceImpl implements ManageService {
}
dto.setRouteIds(updatedRouteIds);
}
//设置模糊
//设置模糊
if (!dto.getOrderNo().equals("")){
dto.setOrderNo("%"+dto.getOrderNo()+"%");
}
if (!dto.getApplicant().equals("")){
dto.setApplicant("%"+dto.getApplicant()+"%");
dto.setOrderNo(dto.getOrderNo()+"%");
}
List<OrderDetailBasic> list=jdbcOrderDetailBasicRepository.listByCondition(dto,dto.getPageResult());