feat(repository): 增加质检物料更多动态过滤条件支持
- QmsQcMaterialMapper.xml中分页查询和全部查询SQL增加对描述是否变更、 物料类别全路径名称、图号及版本号、材质、规格、规则维护状态等新条件的过滤支持 - 过滤条件实现包括模糊匹配和精确匹配多种类型,支持创建时间和修改时间范围查询 - QmsQcMaterialSearchQO新增对应的查询参数字段,包含布尔类型、字符串类型及日期范围类型 - 新增字段支持更丰富的查询场景,提高质检物料数据筛选灵活性和准确性
This commit is contained in:
parent
b06c07dc6c
commit
b608383244
|
|
@ -2,6 +2,7 @@ package com.nflg.wms.common.pojo.qo;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -35,6 +36,76 @@ public class QmsQcMaterialSearchQO extends PageQO {
|
|||
*/
|
||||
private String materialName;
|
||||
|
||||
/**
|
||||
* 描述是否变更(精确匹配):false=未变更,true=已变更
|
||||
*/
|
||||
private Boolean materialDescIsUpgrade;
|
||||
|
||||
/**
|
||||
* 物料类别全路径名称(模糊匹配)
|
||||
*/
|
||||
private String materialCategoryCodePathName;
|
||||
|
||||
/**
|
||||
* 物料图号(模糊匹配)
|
||||
*/
|
||||
private String drawingNo;
|
||||
|
||||
/**
|
||||
* 图号版本号(模糊匹配)
|
||||
*/
|
||||
private String drawingNoVer;
|
||||
|
||||
/**
|
||||
* 物料材质(模糊匹配)
|
||||
*/
|
||||
private String materialTexture;
|
||||
|
||||
/**
|
||||
* 物料规格(模糊匹配)
|
||||
*/
|
||||
private String materialSpecifications;
|
||||
|
||||
/**
|
||||
* 规则是否已维护(精确匹配):false=未维护,true=已维护
|
||||
*/
|
||||
private Boolean isStandardMaintained;
|
||||
|
||||
/**
|
||||
* 创建方式(精确匹配):0=人工操作,1=系统同步
|
||||
*/
|
||||
private Integer createdType;
|
||||
|
||||
/**
|
||||
* 创建人名称(模糊匹配)
|
||||
*/
|
||||
private String createByName;
|
||||
|
||||
/**
|
||||
* 创建时间范围-开始日期(含)
|
||||
*/
|
||||
private LocalDate createTimeStart;
|
||||
|
||||
/**
|
||||
* 创建时间范围-结束日期(含)
|
||||
*/
|
||||
private LocalDate createTimeEnd;
|
||||
|
||||
/**
|
||||
* 修改人名称(模糊匹配)
|
||||
*/
|
||||
private String updateByName;
|
||||
|
||||
/**
|
||||
* 修改时间范围-开始日期(含)
|
||||
*/
|
||||
private LocalDate updateTimeStart;
|
||||
|
||||
/**
|
||||
* 修改时间范围-结束日期(含)
|
||||
*/
|
||||
private LocalDate updateTimeEnd;
|
||||
|
||||
/**
|
||||
* 排序字段(对应 QmsQcMaterialVO 中的字段名,如 materialNo、createTime 等)
|
||||
* 为空时默认按物料编号倒序
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@
|
|||
<!--
|
||||
分页查询质检物料
|
||||
支持动态过滤:物料类别编码(materialCategoryCode)、物料编号模糊(materialNo)、物料描述模糊(materialDesc)、物料名称模糊(materialName)
|
||||
、描述是否变更(materialDescIsUpgrade)、类别全路径名称模糊(materialCategoryCodePathName)、图号模糊(drawingNo)
|
||||
、图号版本号模糊(drawingNoVer)、材质模糊(materialTexture)、规格模糊(materialSpecifications)
|
||||
、规则是否已维护(isStandardMaintained)、创建方式(createdType)、创建人模糊(createByName)
|
||||
、创建时间范围(createTimeStart/createTimeEnd)、修改人模糊(updateByName)、修改时间范围(updateTimeStart/updateTimeEnd)
|
||||
-->
|
||||
<select id="searchPage" resultType="com.nflg.wms.common.pojo.vo.QmsQcMaterialVO">
|
||||
SELECT
|
||||
|
|
@ -47,6 +51,48 @@
|
|||
<if test="request.materialName != null and request.materialName != ''">
|
||||
AND material_name ilike concat('%', #{request.materialName}, '%')
|
||||
</if>
|
||||
<if test="request.materialDescIsUpgrade != null">
|
||||
AND material_desc_is_upgrade = #{request.materialDescIsUpgrade}
|
||||
</if>
|
||||
<if test="request.materialCategoryCodePathName != null and request.materialCategoryCodePathName != ''">
|
||||
AND material_category_code_path_name ilike concat('%', #{request.materialCategoryCodePathName}, '%')
|
||||
</if>
|
||||
<if test="request.drawingNo != null and request.drawingNo != ''">
|
||||
AND drawing_no ilike concat('%', #{request.drawingNo}, '%')
|
||||
</if>
|
||||
<if test="request.drawingNoVer != null and request.drawingNoVer != ''">
|
||||
AND drawing_no_ver ilike concat('%', #{request.drawingNoVer}, '%')
|
||||
</if>
|
||||
<if test="request.materialTexture != null and request.materialTexture != ''">
|
||||
AND material_texture ilike concat('%', #{request.materialTexture}, '%')
|
||||
</if>
|
||||
<if test="request.materialSpecifications != null and request.materialSpecifications != ''">
|
||||
AND material_specifications ilike concat('%', #{request.materialSpecifications}, '%')
|
||||
</if>
|
||||
<if test="request.isStandardMaintained != null">
|
||||
AND is_standard_maintained = #{request.isStandardMaintained}
|
||||
</if>
|
||||
<if test="request.createdType != null">
|
||||
AND created_type = #{request.createdType}
|
||||
</if>
|
||||
<if test="request.createByName != null and request.createByName != ''">
|
||||
AND create_by_name ilike concat('%', #{request.createByName}, '%')
|
||||
</if>
|
||||
<if test="request.createTimeStart != null">
|
||||
AND create_time >= #{request.createTimeStart}::date
|
||||
</if>
|
||||
<if test="request.createTimeEnd != null">
|
||||
AND create_time < (#{request.createTimeEnd}::date + interval '1 day')
|
||||
</if>
|
||||
<if test="request.updateByName != null and request.updateByName != ''">
|
||||
AND update_by_name ilike concat('%', #{request.updateByName}, '%')
|
||||
</if>
|
||||
<if test="request.updateTimeStart != null">
|
||||
AND update_time >= #{request.updateTimeStart}::date
|
||||
</if>
|
||||
<if test="request.updateTimeEnd != null">
|
||||
AND update_time < (#{request.updateTimeEnd}::date + interval '1 day')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
<choose>
|
||||
|
|
@ -83,12 +129,15 @@
|
|||
<!--
|
||||
查询全部质检物料(不分页,用于导出)
|
||||
支持动态过滤:物料类别编码(materialCategoryCode)、物料编号模糊(materialNo)、物料描述模糊(materialDesc)、物料名称模糊(materialName)
|
||||
、描述是否变更(materialDescIsUpgrade)、类别全路径名称模糊(materialCategoryCodePathName)、图号模糊(drawingNo)
|
||||
、图号版本号模糊(drawingNoVer)、材质模糊(materialTexture)、规格模糊(materialSpecifications)
|
||||
、规则是否已维护(isStandardMaintained)、创建方式(createdType)、创建人模糊(createByName)
|
||||
、创建时间范围(createTimeStart/createTimeEnd)、修改人模糊(updateByName)、修改时间范围(updateTimeStart/updateTimeEnd)
|
||||
-->
|
||||
<select id="searchAll" resultType="com.nflg.wms.common.pojo.dto.QmsQcMaterialExportDTO">
|
||||
SELECT
|
||||
material_no,
|
||||
material_desc,
|
||||
CASE WHEN material_desc_is_upgrade THEN '是' ELSE '否' END AS material_desc_is_upgrade,
|
||||
material_category_code,
|
||||
material_category_code_path_name,
|
||||
drawing_no,
|
||||
|
|
@ -122,6 +171,48 @@
|
|||
<if test="request.materialName != null and request.materialName != ''">
|
||||
AND material_name ilike concat('%', #{request.materialName}, '%')
|
||||
</if>
|
||||
<if test="request.materialDescIsUpgrade != null">
|
||||
AND material_desc_is_upgrade = #{request.materialDescIsUpgrade}
|
||||
</if>
|
||||
<if test="request.materialCategoryCodePathName != null and request.materialCategoryCodePathName != ''">
|
||||
AND material_category_code_path_name ilike concat('%', #{request.materialCategoryCodePathName}, '%')
|
||||
</if>
|
||||
<if test="request.drawingNo != null and request.drawingNo != ''">
|
||||
AND drawing_no ilike concat('%', #{request.drawingNo}, '%')
|
||||
</if>
|
||||
<if test="request.drawingNoVer != null and request.drawingNoVer != ''">
|
||||
AND drawing_no_ver ilike concat('%', #{request.drawingNoVer}, '%')
|
||||
</if>
|
||||
<if test="request.materialTexture != null and request.materialTexture != ''">
|
||||
AND material_texture ilike concat('%', #{request.materialTexture}, '%')
|
||||
</if>
|
||||
<if test="request.materialSpecifications != null and request.materialSpecifications != ''">
|
||||
AND material_specifications ilike concat('%', #{request.materialSpecifications}, '%')
|
||||
</if>
|
||||
<if test="request.isStandardMaintained != null">
|
||||
AND is_standard_maintained = #{request.isStandardMaintained}
|
||||
</if>
|
||||
<if test="request.createdType != null">
|
||||
AND created_type = #{request.createdType}
|
||||
</if>
|
||||
<if test="request.createByName != null and request.createByName != ''">
|
||||
AND create_by_name ilike concat('%', #{request.createByName}, '%')
|
||||
</if>
|
||||
<if test="request.createTimeStart != null">
|
||||
AND create_time >= #{request.createTimeStart}::date
|
||||
</if>
|
||||
<if test="request.createTimeEnd != null">
|
||||
AND create_time < (#{request.createTimeEnd}::date + interval '1 day')
|
||||
</if>
|
||||
<if test="request.updateByName != null and request.updateByName != ''">
|
||||
AND update_by_name ilike concat('%', #{request.updateByName}, '%')
|
||||
</if>
|
||||
<if test="request.updateTimeStart != null">
|
||||
AND update_time >= #{request.updateTimeStart}::date
|
||||
</if>
|
||||
<if test="request.updateTimeEnd != null">
|
||||
AND update_time < (#{request.updateTimeEnd}::date + interval '1 day')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
<choose>
|
||||
|
|
|
|||
Loading…
Reference in New Issue