Compare commits
9 Commits
8c564739af
...
04109205c8
| Author | SHA1 | Date |
|---|---|---|
|
|
04109205c8 | |
|
|
b06c07dc6c | |
|
|
260e533cc0 | |
|
|
a43523da36 | |
|
|
66f732bf66 | |
|
|
c9f0e112d6 | |
|
|
4143924357 | |
|
|
12d0e0ca71 | |
|
|
ba571b994c |
|
|
@ -4,7 +4,6 @@ import jakarta.validation.Valid;
|
|||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import model.TextPosition;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -147,7 +146,7 @@ public class QmsInspectionStandardSaveQO {
|
|||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Integer sortNo=0;
|
||||
private Integer sortNo = 0;
|
||||
|
||||
/**
|
||||
* 检测项名称
|
||||
|
|
@ -165,15 +164,35 @@ public class QmsInspectionStandardSaveQO {
|
|||
*/
|
||||
private String legend;
|
||||
|
||||
/**
|
||||
* PDF信息
|
||||
*/
|
||||
private TextPosition pdfInfo;
|
||||
|
||||
/**
|
||||
* 判定类型,0:直接判定;1:测量值
|
||||
*/
|
||||
@NotNull(message = "判定类型不能为空")
|
||||
private Integer judgmentType;
|
||||
|
||||
/**
|
||||
* PDF页码
|
||||
*/
|
||||
private Integer pdfPageNum;
|
||||
|
||||
/**
|
||||
* PDF x轴起始位置
|
||||
*/
|
||||
private Float pdfX;
|
||||
|
||||
/**
|
||||
* PDF y轴起始位置
|
||||
*/
|
||||
private Float pdfY;
|
||||
|
||||
/**
|
||||
* PDF宽度
|
||||
*/
|
||||
private Float pdfWidth;
|
||||
|
||||
/**
|
||||
* PDF高度
|
||||
*/
|
||||
private Float pdfHeight;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.nflg.qms.admin.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import model.TextPosition;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
|
@ -36,16 +35,36 @@ public class QmsInspectionStandardItemContentVO {
|
|||
*/
|
||||
private String legend;
|
||||
|
||||
/**
|
||||
* PDF信息
|
||||
*/
|
||||
private TextPosition pdfInfo;
|
||||
|
||||
/**
|
||||
* 判定类型,0:直接判定;1:测量值
|
||||
*/
|
||||
private Integer judgmentType;
|
||||
|
||||
/**
|
||||
* PDF页码
|
||||
*/
|
||||
private Integer pdfPageNum;
|
||||
|
||||
/**
|
||||
* PDF x轴起始位置
|
||||
*/
|
||||
private Float pdfX;
|
||||
|
||||
/**
|
||||
* PDF y轴起始位置
|
||||
*/
|
||||
private Float pdfY;
|
||||
|
||||
/**
|
||||
* PDF宽度
|
||||
*/
|
||||
private Float pdfWidth;
|
||||
|
||||
/**
|
||||
* PDF高度
|
||||
*/
|
||||
private Float pdfHeight;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -187,6 +187,7 @@ public class IncomingInspectionTaskControllerService {
|
|||
|
||||
// 7. 构建并保存来料检测任务
|
||||
QmsIncomingInspectionTask task = new QmsIncomingInspectionTask()
|
||||
.setRequestNo(request.getRequestNo())
|
||||
.setTaskNo(taskNo)
|
||||
.setMaterialId(material.getId())
|
||||
.setInspectionStandardId(standard.getId())
|
||||
|
|
@ -311,6 +312,7 @@ public class IncomingInspectionTaskControllerService {
|
|||
|
||||
// 7. 构建并保存库存检测任务(存入来料检测任务表,dataType=1)
|
||||
QmsIncomingInspectionTask task = new QmsIncomingInspectionTask()
|
||||
.setRequestNo(request.getRequestNo())
|
||||
.setTaskNo(taskNo)
|
||||
.setMaterialId(material.getId())
|
||||
.setInspectionStandardId(standard.getId())
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.nflg.qms.admin.service;
|
|||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.qms.admin.pojo.qo.QmsPdfExtractRegionQO;
|
||||
|
|
@ -26,7 +25,6 @@ import com.nflg.wms.repository.service.*;
|
|||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import model.DimensionResult;
|
||||
import model.TextPosition;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import service.PdfExtractionService;
|
||||
|
|
@ -304,9 +302,11 @@ public class QmsInspectionStandardControllerService {
|
|||
vo.setName(content.getName());
|
||||
vo.setTestStandard(content.getTestStandard());
|
||||
vo.setLegend(content.getLegend());
|
||||
if (StrUtil.isNotBlank(content.getPdfInfo())) {
|
||||
vo.setPdfInfo(JSONUtil.toBean(content.getPdfInfo(), TextPosition.class));
|
||||
}
|
||||
vo.setPdfPageNum(content.getPdfPageNum());
|
||||
vo.setPdfX(content.getPdfX());
|
||||
vo.setPdfY(content.getPdfY());
|
||||
vo.setPdfWidth(content.getPdfWidth());
|
||||
vo.setPdfHeight(content.getPdfHeight());
|
||||
vo.setJudgmentType(content.getJudgmentType());
|
||||
vo.setCreateUserName(content.getCreateUserName());
|
||||
vo.setCreateTime(content.getCreateTime());
|
||||
|
|
@ -681,11 +681,14 @@ public class QmsInspectionStandardControllerService {
|
|||
if (qo.getLegend() != null) {
|
||||
content.setLegend(qo.getLegend());
|
||||
}
|
||||
if (qo.getPdfInfo() != null) {
|
||||
content.setPdfInfo(JSONUtil.toJsonStr(qo.getPdfInfo()));
|
||||
}
|
||||
content.setJudgmentType(qo.getJudgmentType());
|
||||
|
||||
content.setPdfPageNum(qo.getPdfPageNum());
|
||||
content.setPdfX(qo.getPdfX());
|
||||
content.setPdfY(qo.getPdfY());
|
||||
content.setPdfWidth(qo.getPdfWidth());
|
||||
content.setPdfHeight(qo.getPdfHeight());
|
||||
|
||||
content.setUpdateUserId(userId);
|
||||
content.setUpdateUserName(userName);
|
||||
content.setUpdateTime(now);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
package com.nflg.qms.admin.service;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.nflg.wms.common.exception.NflgException;
|
||||
import com.nflg.qms.admin.pojo.vo.QmsInspectionStandardItemContentVO;
|
||||
import com.nflg.wms.repository.entity.QmsInspectionStandardItem;
|
||||
|
|
@ -10,7 +8,6 @@ import com.nflg.wms.repository.service.IQmsInspectionStandardItemContentService;
|
|||
import com.nflg.wms.repository.service.IQmsInspectionStandardItemService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import model.TextPosition;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -62,9 +59,11 @@ public class QmsInspectionStandardItemControllerService {
|
|||
vo.setName(content.getName());
|
||||
vo.setTestStandard(content.getTestStandard());
|
||||
vo.setLegend(content.getLegend());
|
||||
if (StrUtil.isNotBlank(content.getPdfInfo())) {
|
||||
vo.setPdfInfo(JSONUtil.toBean(content.getPdfInfo(), TextPosition.class));
|
||||
}
|
||||
vo.setPdfPageNum(content.getPdfPageNum());
|
||||
vo.setPdfX(content.getPdfX());
|
||||
vo.setPdfY(content.getPdfY());
|
||||
vo.setPdfWidth(content.getPdfWidth());
|
||||
vo.setPdfHeight(content.getPdfHeight());
|
||||
vo.setJudgmentType(content.getJudgmentType());
|
||||
vo.setCreateUserName(content.getCreateUserName());
|
||||
vo.setCreateTime(content.getCreateTime());
|
||||
|
|
|
|||
|
|
@ -78,6 +78,11 @@ public class QmsQcMaterialControllerService {
|
|||
* 分页查询质检物料
|
||||
*/
|
||||
public PageData<QmsQcMaterialVO> search(QmsQcMaterialSearchQO request) {
|
||||
// 若传入了物料类别编码,展开为包含当前类别及所有子孙类别的编码列表
|
||||
if (StrUtil.isNotBlank(request.getMaterialCategoryCode())) {
|
||||
request.setMaterialCategoryCodes(expandCategoryCodes(request.getMaterialCategoryCode()));
|
||||
}
|
||||
|
||||
IPage<QmsQcMaterialVO> page = qcMaterialMapper.searchPage(
|
||||
request, new Page<>(request.getPage(), request.getPageSize()));
|
||||
|
||||
|
|
@ -89,6 +94,41 @@ public class QmsQcMaterialControllerService {
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 展开物料类别编码:查询指定编码对应的类别及其所有子孙类别的编码列表(一次查询,无递归)
|
||||
* <p>
|
||||
* parentTree 存储完整祖先路径(ltree 格式,如 0.A.B.C),子孙节点满足:
|
||||
* parentTree = fullPath OR parentTree LIKE 'fullPath.%'
|
||||
* </p>
|
||||
*/
|
||||
private List<String> expandCategoryCodes(String categoryCode) {
|
||||
QmsQcMaterialCategory category = qcMaterialCategoryService.lambdaQuery()
|
||||
.eq(QmsQcMaterialCategory::getCategoryCode, categoryCode)
|
||||
.one();
|
||||
if (category == null) {
|
||||
// 类别不存在,原样返回,Mapper 中 IN 条件查不到数据
|
||||
return List.of(categoryCode);
|
||||
}
|
||||
|
||||
// 构建当前节点完整路径:parentTree.id(若 parentTree 为空则直接取 id)
|
||||
String fullPath = StrUtil.isBlank(category.getParentTree())
|
||||
? String.valueOf(category.getId())
|
||||
: category.getParentTree();
|
||||
|
||||
// 一次查询:自身 + 直接子节点(parentTree=fullPath)+ 孙级及更深(parentTree LIKE 'fullPath.%')
|
||||
// parent_tree 为 ltree 类型,需显式转为 text 才能与 varchar 比较
|
||||
return qcMaterialCategoryService.lambdaQuery()
|
||||
.eq(QmsQcMaterialCategory::getCategoryCode, categoryCode)
|
||||
.or().apply("parent_tree::text = {0}", fullPath)
|
||||
.or().apply("parent_tree::text LIKE {0}", fullPath + ".%")
|
||||
.list()
|
||||
.stream()
|
||||
.map(QmsQcMaterialCategory::getCategoryCode)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增质检物料
|
||||
*/
|
||||
|
|
@ -375,6 +415,10 @@ public class QmsQcMaterialControllerService {
|
|||
* 导出质检物料(不分页)
|
||||
*/
|
||||
public void exportSearch(HttpServletResponse response, QmsQcMaterialSearchQO request) throws IOException {
|
||||
// 导出同样支持子孙类别展开
|
||||
if (StrUtil.isNotBlank(request.getMaterialCategoryCode())) {
|
||||
request.setMaterialCategoryCodes(expandCategoryCodes(request.getMaterialCategoryCode()));
|
||||
}
|
||||
EecExcelUtil.export("质检物料", "质检物料", qcMaterialMapper.searchAll(request), response);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -104,12 +104,13 @@ public class WmsIncomingInspectionTaskCallbackService {
|
|||
private void inventory(QmsIncomingInspectionTaskVO taskVO, Short processingResult) {
|
||||
WmsInventoryInspectionTaskCallbackQO qo = new WmsInventoryInspectionTaskCallbackQO()
|
||||
.setTaskNo(taskVO.getTaskNo())
|
||||
.setRequestNo(taskVO.getRequestNo())
|
||||
.setMaterialNo(taskVO.getMaterialNo())
|
||||
.setFactory(taskVO.getFactory())
|
||||
.setWarehouse(taskVO.getWarehouse())
|
||||
.setStorageLocation(taskVO.getStorageLocation())
|
||||
.setStorageDays(taskVO.getStorageDays())
|
||||
.setInspectionQty(taskVO.getInspectionQty())
|
||||
.setDetectionQty(taskVO.getDetectionQty())
|
||||
.setQualifiedQty(taskVO.getQualifiedQty())
|
||||
.setUnqualifiedQty(taskVO.getUnqualifiedQty())
|
||||
.setInspectionResult(taskVO.getInspectionResult())
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package extraction;
|
||||
|
||||
import lombok.Getter;
|
||||
import model.TextElement;
|
||||
import org.apache.pdfbox.pdmodel.PDPage;
|
||||
import org.apache.pdfbox.pdmodel.common.PDRectangle;
|
||||
|
|
@ -11,6 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
public class PositionedTextStripper extends PDFTextStripper {
|
||||
@Getter
|
||||
private final List<TextElement> elements = new ArrayList<>();
|
||||
private int currentPage = 0;
|
||||
private float currentPageWidth = 0;
|
||||
|
|
@ -53,7 +55,4 @@ public class PositionedTextStripper extends PDFTextStripper {
|
|||
super.writeString(text, textPositions);
|
||||
}
|
||||
|
||||
public List<TextElement> getElements() {
|
||||
return elements;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,47 +0,0 @@
|
|||
package model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TextPosition {
|
||||
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
private int pageNum;
|
||||
|
||||
/**
|
||||
* x轴起始位置
|
||||
*/
|
||||
private float x;
|
||||
|
||||
/**
|
||||
* y轴起始位置
|
||||
*/
|
||||
private float y;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private float width;
|
||||
|
||||
/**
|
||||
* 高度
|
||||
*/
|
||||
private float height;
|
||||
|
||||
/**
|
||||
* 页宽
|
||||
*/
|
||||
private float pageWidth;
|
||||
|
||||
/**
|
||||
* 页高
|
||||
*/
|
||||
private float pageHeight;
|
||||
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
private int sortOrder;
|
||||
}
|
||||
|
|
@ -11,6 +11,12 @@ import lombok.Data;
|
|||
@Data
|
||||
public class ExternalIncomingInspectionApplyQO {
|
||||
|
||||
/**
|
||||
* 请求单号,第三方唯一编号
|
||||
*/
|
||||
@NotBlank(message = "请求单号不能为空")
|
||||
private String requestNo;
|
||||
|
||||
/**
|
||||
* 物料编号(必填)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -11,6 +11,12 @@ import lombok.Data;
|
|||
@Data
|
||||
public class ExternalInventoryInspectionApplyQO {
|
||||
|
||||
/**
|
||||
* 请求单号,第三方唯一编号
|
||||
*/
|
||||
@NotBlank(message = "请求单号不能为空")
|
||||
private String requestNo;
|
||||
|
||||
/**
|
||||
* 物料编号(必填)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.nflg.wms.common.pojo.qo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 查询质检物料列表 请求参数(分页)
|
||||
*/
|
||||
|
|
@ -13,6 +15,11 @@ public class QmsQcMaterialSearchQO extends PageQO {
|
|||
*/
|
||||
private String materialCategoryCode;
|
||||
|
||||
/**
|
||||
* 物料类别编码列表(内部使用,由 Service 层自动填充,包含当前类别及其所有子孙类别编码)
|
||||
*/
|
||||
private List<String> materialCategoryCodes;
|
||||
|
||||
/**
|
||||
* 物料编号(模糊匹配)
|
||||
*/
|
||||
|
|
@ -27,4 +34,15 @@ public class QmsQcMaterialSearchQO extends PageQO {
|
|||
* 物料名称(模糊匹配)
|
||||
*/
|
||||
private String materialName;
|
||||
|
||||
/**
|
||||
* 排序字段(对应 QmsQcMaterialVO 中的字段名,如 materialNo、createTime 等)
|
||||
* 为空时默认按物料编号倒序
|
||||
*/
|
||||
private String sortField;
|
||||
|
||||
/**
|
||||
* 排序类型:asc=升序,desc=降序,默认 desc
|
||||
*/
|
||||
private String sortOrder;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
|
@ -14,6 +15,11 @@ public class WmsInventoryInspectionTaskCallbackQO {
|
|||
*/
|
||||
private String taskNo;
|
||||
|
||||
/**
|
||||
* 请求单号,第三方唯一编号
|
||||
*/
|
||||
private String requestNo;
|
||||
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
|
|
@ -40,9 +46,9 @@ public class WmsInventoryInspectionTaskCallbackQO {
|
|||
private Integer storageDays;
|
||||
|
||||
/**
|
||||
* 送检数量
|
||||
* 检测数量
|
||||
*/
|
||||
private Integer inspectionQty;
|
||||
private Integer detectionQty;
|
||||
|
||||
/**
|
||||
* 合格数量
|
||||
|
|
|
|||
|
|
@ -17,6 +17,11 @@ public class QmsIncomingInspectionTaskVO {
|
|||
*/
|
||||
private String taskNo;
|
||||
|
||||
/**
|
||||
* 请求单号,第三方唯一编号
|
||||
*/
|
||||
private String requestNo;
|
||||
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -37,6 +37,11 @@ public class QmsIncomingInspectionTask implements Serializable {
|
|||
*/
|
||||
private String taskNo;
|
||||
|
||||
/**
|
||||
* 请求单号,第三方唯一编号
|
||||
*/
|
||||
private String requestNo;
|
||||
|
||||
/**
|
||||
* 物料id,关联质检物料表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -51,16 +51,36 @@ public class QmsInspectionStandardItemContent implements Serializable {
|
|||
*/
|
||||
private String legend;
|
||||
|
||||
/**
|
||||
* PDF信息
|
||||
*/
|
||||
private String pdfInfo;
|
||||
|
||||
/**
|
||||
* 判定类型,0:直接判定;1:测量值
|
||||
*/
|
||||
private Integer judgmentType;
|
||||
|
||||
/**
|
||||
* PDF页码
|
||||
*/
|
||||
private Integer pdfPageNum;
|
||||
|
||||
/**
|
||||
* PDF x轴起始位置
|
||||
*/
|
||||
private Float pdfX;
|
||||
|
||||
/**
|
||||
* PDF y轴起始位置
|
||||
*/
|
||||
private Float pdfY;
|
||||
|
||||
/**
|
||||
* PDF宽度
|
||||
*/
|
||||
private Float pdfWidth;
|
||||
|
||||
/**
|
||||
* PDF高度
|
||||
*/
|
||||
private Float pdfHeight;
|
||||
|
||||
/**
|
||||
* 创建人ID
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
|||
.setParentId(request.getParentId())
|
||||
.setEnable(request.getEnable())
|
||||
.setCreateBy(UserUtil.getUserName())
|
||||
.setCreateTime(LocalDateTime.now());
|
||||
.setCreateTime(LocalDateTime.now())
|
||||
.setHeadUserId(request.getHeadUserId())
|
||||
.setHeadUserName(request.getHeadUserName());
|
||||
save(department);
|
||||
auditLogService.addInsert(Department.class, department, UserUtil.getUserName());
|
||||
}
|
||||
|
|
@ -77,7 +79,9 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
|||
.setEnable(request.getEnable())
|
||||
.setCreateBy(dept1.getCreateBy())
|
||||
.setCreateTime(dept1.getCreateTime())
|
||||
.setSourceId(request.getNo());
|
||||
.setSourceId(request.getNo())
|
||||
.setHeadUserId(request.getHeadUserId())
|
||||
.setHeadUserName(request.getHeadUserName());
|
||||
|
||||
|
||||
//Department dept2 = BeanUtil.copy(dept1, Department.class);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
SELECT
|
||||
t.id,
|
||||
t.task_no,
|
||||
t.check_no,
|
||||
t.material_id,
|
||||
m.material_no,
|
||||
m.material_desc,
|
||||
|
|
@ -108,6 +109,7 @@
|
|||
SELECT
|
||||
t.id,
|
||||
t.task_no,
|
||||
t.check_no,
|
||||
t.material_id,
|
||||
m.material_no,
|
||||
m.material_desc,
|
||||
|
|
@ -180,6 +182,7 @@
|
|||
<select id="getDetail" resultType="com.nflg.wms.common.pojo.vo.QmsIncomingInspectionTaskVO">
|
||||
SELECT t.id,
|
||||
t.task_no,
|
||||
t.check_no,
|
||||
t.material_id,
|
||||
m.material_no,
|
||||
m.material_desc,
|
||||
|
|
|
|||
|
|
@ -27,9 +27,17 @@
|
|||
update_time
|
||||
FROM qms_qc_material
|
||||
<where>
|
||||
<if test="request.materialCategoryCode != null and request.materialCategoryCode != ''">
|
||||
AND material_category_code = #{request.materialCategoryCode}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="request.materialCategoryCodes != null and !request.materialCategoryCodes.isEmpty()">
|
||||
AND material_category_code IN
|
||||
<foreach collection="request.materialCategoryCodes" item="code" open="(" separator="," close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</when>
|
||||
<when test="request.materialCategoryCode != null and request.materialCategoryCode != ''">
|
||||
AND material_category_code = #{request.materialCategoryCode}
|
||||
</when>
|
||||
</choose>
|
||||
<if test="request.materialNo != null and request.materialNo != ''">
|
||||
AND material_no ilike concat('%', #{request.materialNo}, '%')
|
||||
</if>
|
||||
|
|
@ -40,7 +48,36 @@
|
|||
AND material_name ilike concat('%', #{request.materialName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY id DESC
|
||||
ORDER BY
|
||||
<choose>
|
||||
<when test="request.sortField != null and request.sortField != ''">
|
||||
<choose>
|
||||
<when test="request.sortField == 'id'">id</when>
|
||||
<when test="request.sortField == 'materialNo'">material_no</when>
|
||||
<when test="request.sortField == 'materialDesc'">material_desc</when>
|
||||
<when test="request.sortField == 'materialDescIsUpgrade'">material_desc_is_upgrade</when>
|
||||
<when test="request.sortField == 'materialCategoryCode'">material_category_code</when>
|
||||
<when test="request.sortField == 'materialCategoryCodePathName'">material_category_code_path_name</when>
|
||||
<when test="request.sortField == 'drawingNo'">drawing_no</when>
|
||||
<when test="request.sortField == 'drawingNoVer'">drawing_no_ver</when>
|
||||
<when test="request.sortField == 'materialName'">material_name</when>
|
||||
<when test="request.sortField == 'materialTexture'">material_texture</when>
|
||||
<when test="request.sortField == 'materialSpecifications'">material_specifications</when>
|
||||
<when test="request.sortField == 'isStandardMaintained'">is_standard_maintained</when>
|
||||
<when test="request.sortField == 'createdType'">created_type</when>
|
||||
<when test="request.sortField == 'createByName'">create_by_name</when>
|
||||
<when test="request.sortField == 'createTime'">create_time</when>
|
||||
<when test="request.sortField == 'updateByName'">update_by_name</when>
|
||||
<when test="request.sortField == 'updateTime'">update_time</when>
|
||||
<otherwise>material_no</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test="request.sortOrder != null and request.sortOrder.equalsIgnoreCase('asc')">ASC</when>
|
||||
<otherwise>DESC</otherwise>
|
||||
</choose>
|
||||
</when>
|
||||
<otherwise>material_no DESC</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<!--
|
||||
|
|
@ -65,9 +102,17 @@
|
|||
TO_CHAR(create_time, 'YYYY-MM-DD HH24:MI:SS') AS create_time
|
||||
FROM qms_qc_material
|
||||
<where>
|
||||
<if test="request.materialCategoryCode != null and request.materialCategoryCode != ''">
|
||||
AND material_category_code = #{request.materialCategoryCode}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="request.materialCategoryCodes != null and !request.materialCategoryCodes.isEmpty()">
|
||||
AND material_category_code IN
|
||||
<foreach collection="request.materialCategoryCodes" item="code" open="(" separator="," close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</when>
|
||||
<when test="request.materialCategoryCode != null and request.materialCategoryCode != ''">
|
||||
AND material_category_code = #{request.materialCategoryCode}
|
||||
</when>
|
||||
</choose>
|
||||
<if test="request.materialNo != null and request.materialNo != ''">
|
||||
AND material_no ilike concat('%', #{request.materialNo}, '%')
|
||||
</if>
|
||||
|
|
@ -78,7 +123,36 @@
|
|||
AND material_name ilike concat('%', #{request.materialName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY id DESC
|
||||
ORDER BY
|
||||
<choose>
|
||||
<when test="request.sortField != null and request.sortField != ''">
|
||||
<choose>
|
||||
<when test="request.sortField == 'id'">id</when>
|
||||
<when test="request.sortField == 'materialNo'">material_no</when>
|
||||
<when test="request.sortField == 'materialDesc'">material_desc</when>
|
||||
<when test="request.sortField == 'materialDescIsUpgrade'">material_desc_is_upgrade</when>
|
||||
<when test="request.sortField == 'materialCategoryCode'">material_category_code</when>
|
||||
<when test="request.sortField == 'materialCategoryCodePathName'">material_category_code_path_name</when>
|
||||
<when test="request.sortField == 'drawingNo'">drawing_no</when>
|
||||
<when test="request.sortField == 'drawingNoVer'">drawing_no_ver</when>
|
||||
<when test="request.sortField == 'materialName'">material_name</when>
|
||||
<when test="request.sortField == 'materialTexture'">material_texture</when>
|
||||
<when test="request.sortField == 'materialSpecifications'">material_specifications</when>
|
||||
<when test="request.sortField == 'isStandardMaintained'">is_standard_maintained</when>
|
||||
<when test="request.sortField == 'createdType'">created_type</when>
|
||||
<when test="request.sortField == 'createByName'">create_by_name</when>
|
||||
<when test="request.sortField == 'createTime'">create_time</when>
|
||||
<when test="request.sortField == 'updateByName'">update_by_name</when>
|
||||
<when test="request.sortField == 'updateTime'">update_time</when>
|
||||
<otherwise>material_no</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test="request.sortOrder != null and request.sortOrder.equalsIgnoreCase('asc')">ASC</when>
|
||||
<otherwise>DESC</otherwise>
|
||||
</choose>
|
||||
</when>
|
||||
<otherwise>material_no DESC</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue