【提取功能代码】
This commit is contained in:
parent
86826cdfb3
commit
5aac47bbac
@ -31,19 +31,19 @@ public class LineInfoRepository extends ServiceImpl<LineInfoMapper, LineInfo> im
|
||||
*/
|
||||
@Override
|
||||
public Page<LineInfo> pageQuery(LineInfoQueryDto query) {
|
||||
LambdaQueryWrapper<LineInfo> wrapper = Wrappers.lambdaQuery();
|
||||
if (StringUtils.isNotEmpty(query.getName())) {
|
||||
wrapper.like(LineInfo::getName, query.getName());
|
||||
}
|
||||
if (query.getLineId() != null) {
|
||||
wrapper.eq(LineInfo::getLineId, query.getLineId());
|
||||
}
|
||||
LambdaQueryWrapper<LineInfo> wrapper = getQueryWrapper(query);
|
||||
wrapper.select(LineInfo.class, info -> !info.getColumn().equals("config"));
|
||||
return page(query, wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LineInfo> list(LineInfoQueryDto query) {
|
||||
LambdaQueryWrapper<LineInfo> wrapper = getQueryWrapper(query);
|
||||
wrapper.select(LineInfo.class, info -> !info.getColumn().equals("config"));
|
||||
return list(wrapper);
|
||||
}
|
||||
|
||||
private static LambdaQueryWrapper<LineInfo> getQueryWrapper(LineInfoQueryDto query) {
|
||||
LambdaQueryWrapper<LineInfo> wrapper = Wrappers.lambdaQuery();
|
||||
if (StringUtils.isNotEmpty(query.getName())) {
|
||||
wrapper.like(LineInfo::getName, query.getName());
|
||||
@ -51,7 +51,6 @@ public class LineInfoRepository extends ServiceImpl<LineInfoMapper, LineInfo> im
|
||||
if (query.getLineId() != null) {
|
||||
wrapper.eq(LineInfo::getLineId, query.getLineId());
|
||||
}
|
||||
wrapper.select(LineInfo.class, info -> !info.getColumn().equals("config"));
|
||||
return list(wrapper);
|
||||
return wrapper;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package club.joylink.xiannccda.repository.impl;
|
||||
|
||||
import club.joylink.xiannccda.dto.PublishedGIQueryDto;
|
||||
import club.joylink.xiannccda.entity.LineInfo;
|
||||
import club.joylink.xiannccda.entity.PublishedGi;
|
||||
import club.joylink.xiannccda.mapper.PublishedGiMapper;
|
||||
import club.joylink.xiannccda.repository.IPublishedGiRepository;
|
||||
@ -27,38 +26,25 @@ public class PublishedGiRepository extends ServiceImpl<PublishedGiMapper, Publis
|
||||
|
||||
@Override
|
||||
public Page<PublishedGi> paging(PublishedGIQueryDto query) {
|
||||
LambdaQueryWrapper<PublishedGi> wrapper = Wrappers.lambdaQuery();
|
||||
if (StringUtils.isNotEmpty(query.getName())) {
|
||||
wrapper.like(PublishedGi::getName, query.getName());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(query.getType())) {
|
||||
wrapper.eq(PublishedGi::getType, query.getType());
|
||||
}
|
||||
if (query.getLineId() != null) {
|
||||
wrapper.eq(PublishedGi::getLineId, query.getLineId());
|
||||
}
|
||||
LambdaQueryWrapper<PublishedGi> wrapper = getQueryWrapper(query);
|
||||
wrapper.select(PublishedGi.class, publishedGi -> !publishedGi.getColumn().equals("proto"));
|
||||
return page(query, wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PublishedGi> list(PublishedGIQueryDto query) {
|
||||
LambdaQueryWrapper<PublishedGi> wrapper = Wrappers.lambdaQuery();
|
||||
if (StringUtils.isNotEmpty(query.getName())) {
|
||||
wrapper.like(PublishedGi::getName, query.getName());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(query.getType())) {
|
||||
wrapper.eq(PublishedGi::getType, query.getType());
|
||||
}
|
||||
if (query.getLineId() != null) {
|
||||
wrapper.eq(PublishedGi::getLineId, query.getLineId());
|
||||
}
|
||||
LambdaQueryWrapper<PublishedGi> wrapper = getQueryWrapper(query);
|
||||
wrapper.select(PublishedGi.class, publishedGi -> !publishedGi.getColumn().equals("proto"));
|
||||
return list(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PublishedGi queryByDto(PublishedGIQueryDto query) {
|
||||
LambdaQueryWrapper<PublishedGi> wrapper = getQueryWrapper(query);
|
||||
return getOne(wrapper);
|
||||
}
|
||||
|
||||
private static LambdaQueryWrapper<PublishedGi> getQueryWrapper(PublishedGIQueryDto query) {
|
||||
LambdaQueryWrapper<PublishedGi> wrapper = Wrappers.lambdaQuery();
|
||||
if (StringUtils.isNotEmpty(query.getName())) {
|
||||
wrapper.like(PublishedGi::getName, query.getName());
|
||||
@ -69,6 +55,6 @@ public class PublishedGiRepository extends ServiceImpl<PublishedGiMapper, Publis
|
||||
if (query.getLineId() != null) {
|
||||
wrapper.eq(PublishedGi::getLineId, query.getLineId());
|
||||
}
|
||||
return getOne(wrapper);
|
||||
return wrapper;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user