This commit is contained in:
parent
d1775b570a
commit
3003639596
@ -6,10 +6,12 @@ import club.joylink.xiannccda.entity.FaultQuery;
|
|||||||
import club.joylink.xiannccda.exception.BusinessExceptionAssertEnum;
|
import club.joylink.xiannccda.exception.BusinessExceptionAssertEnum;
|
||||||
import club.joylink.xiannccda.mapper.FaultQueryMapper;
|
import club.joylink.xiannccda.mapper.FaultQueryMapper;
|
||||||
import club.joylink.xiannccda.repository.IFaultQueryRepository;
|
import club.joylink.xiannccda.repository.IFaultQueryRepository;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.google.common.base.Splitter;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -40,9 +42,11 @@ public class FaultQueryRepository extends ServiceImpl<FaultQueryMapper, FaultQue
|
|||||||
@Override
|
@Override
|
||||||
public IPage<FaultQuery> page(FaultQueryReqDTO reqDTO) {
|
public IPage<FaultQuery> page(FaultQueryReqDTO reqDTO) {
|
||||||
QueryWrapper<FaultQuery> qw = new QueryWrapper<>();
|
QueryWrapper<FaultQuery> qw = new QueryWrapper<>();
|
||||||
qw.lambda().eq(Objects.nonNull(reqDTO.getLineId()), FaultQuery::getLineId, reqDTO.getLineId())
|
LambdaQueryWrapper<FaultQuery> lam = qw.lambda().eq(Objects.nonNull(reqDTO.getLineId()), FaultQuery::getLineId, reqDTO.getLineId())
|
||||||
.in(Objects.nonNull(reqDTO.getFaultType()), FaultQuery::getFaultType, reqDTO.getFaultType().split(StringPool.COMMA))
|
.like(StringUtils.isNotEmpty(reqDTO.getFaultName()), FaultQuery::getFaultNameShower, reqDTO.getFaultName());
|
||||||
.eq(StringUtils.isNotEmpty(reqDTO.getFaultName()), FaultQuery::getFaultNameShower, reqDTO.getFaultName());
|
if (StringUtils.isNotEmpty(reqDTO.getFaultType())) {
|
||||||
|
lam.in(FaultQuery::getFaultType, Splitter.on(StringPool.COMMA).trimResults().splitToList(reqDTO.getFaultType()));
|
||||||
|
}
|
||||||
return this.page(CommonPageRequest.defaultPage(), qw);
|
return this.page(CommonPageRequest.defaultPage(), qw);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user