|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package org.dromara.qms.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import org.dromara.common.core.exception.ServiceException;
|
|
|
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
|
@ -7,6 +8,8 @@ import com.github.yulichang.toolkit.JoinWrappers;
|
|
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
|
import org.dromara.qms.domain.QcInspectionType;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.dromara.qms.domain.bo.QcInspectionItemCategoryBo;
|
|
|
|
@ -43,6 +46,19 @@ public class QcInspectionItemCategoryServiceImpl implements IQcInspectionItemCat
|
|
|
|
|
return baseMapper.selectVoById(categoryId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分页查询检测项类别列表
|
|
|
|
|
*
|
|
|
|
|
* @param bo 查询条件
|
|
|
|
|
* @param pageQuery 分页参数
|
|
|
|
|
* @return 检测项类别分页列表
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public TableDataInfo<QcInspectionItemCategoryVo> queryPageList(QcInspectionItemCategoryBo bo, PageQuery pageQuery) {
|
|
|
|
|
MPJLambdaWrapper<QcInspectionItemCategory> lqw = buildQueryWrapper(bo);
|
|
|
|
|
Page<QcInspectionItemCategoryVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
|
|
|
return TableDataInfo.build(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询符合条件的检测项类别列表
|
|
|
|
@ -60,11 +76,9 @@ public class QcInspectionItemCategoryServiceImpl implements IQcInspectionItemCat
|
|
|
|
|
Map<String, Object> params = bo.getParams();
|
|
|
|
|
MPJLambdaWrapper<QcInspectionItemCategory> lqw = JoinWrappers.lambda(QcInspectionItemCategory.class)
|
|
|
|
|
.selectAll(QcInspectionItemCategory.class)
|
|
|
|
|
|
|
|
|
|
// 查询检测类型列表
|
|
|
|
|
.select(QcInspectionType::getTypeName)
|
|
|
|
|
.leftJoin(QcInspectionType.class, QcInspectionType::getTypeId, QcInspectionItemCategory::getTypeId)
|
|
|
|
|
|
|
|
|
|
.eq(bo.getCategoryId() != null, QcInspectionItemCategory::getCategoryId, bo.getCategoryId())
|
|
|
|
|
.eq(bo.getParentId() != null, QcInspectionItemCategory::getParentId, bo.getParentId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getAncestors()), QcInspectionItemCategory::getAncestors, bo.getAncestors())
|
|
|
|
@ -72,7 +86,7 @@ public class QcInspectionItemCategoryServiceImpl implements IQcInspectionItemCat
|
|
|
|
|
.like(StringUtils.isNotBlank(bo.getCategoryName()), QcInspectionItemCategory::getCategoryName, bo.getCategoryName())
|
|
|
|
|
.eq(bo.getTypeId() != null, QcInspectionItemCategory::getTypeId, bo.getTypeId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getDescription()), QcInspectionItemCategory::getDescription, bo.getDescription())
|
|
|
|
|
.orderByDesc(QcInspectionItemCategory::getCreateTime);
|
|
|
|
|
.orderByAsc(QcInspectionItemCategory::getCreateTime);
|
|
|
|
|
return lqw;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|