refactor(search): 合并多个模糊查询字段为关键字查询

- 用单一关键字参数替代了物料编码、图号、检测单号、供应商编号和供应商名称的多个模糊查询字段
- 修改Mapper层SQL,使用关键字同时匹配多个字段实现模糊搜索
- 简化查询条件,提升接口调用便捷性和代码维护性
- 更新查询QO类,移除多余字段,增加关键字字段以支持统一搜索逻辑
This commit is contained in:
曹鹏飞 2026-05-12 11:01:30 +08:00
parent 1651ad5318
commit c91310b7db
2 changed files with 12 additions and 37 deletions

View File

@ -11,32 +11,13 @@ import lombok.EqualsAndHashCode;
public class QmsIncomingInspectionTaskTodoSearchQO extends PageQO { public class QmsIncomingInspectionTaskTodoSearchQO extends PageQO {
/** /**
* 物料编码模糊匹配 * 关键字
*/ */
private String materialNo; private String key;
/** /**
* 物料图号模糊匹配 * 检验状态不传则默认查 0 1
*/ * 0=待检1=检验中2=已检
private String drawingNo;
/**
* 检测单号模糊匹配
*/
private String taskNo;
/**
* 供应商编号模糊匹配
*/
private String supplierCode;
/**
* 供应商名称模糊匹配
*/
private String supplierName;
/**
* 检验状态0=待检1=检验中2=已检不传则默认查 0 1
*/ */
private Short inspectionStatus; private Short inspectionStatus;

View File

@ -160,20 +160,14 @@
<if test="request.isOverdue != null"> <if test="request.isOverdue != null">
AND t.is_overdue = #{request.isOverdue} AND t.is_overdue = #{request.isOverdue}
</if> </if>
<if test="request.materialNo != null and request.materialNo != ''"> <if test="request.key != null and request.key != ''">
AND m.material_no ilike concat('%', #{request.materialNo}, '%') AND (m.material_no ilike concat('%', #{request.key}, '%')
</if> or m.material_desc ilike concat('%', #{request.key}, '%')
<if test="request.drawingNo != null and request.drawingNo != ''"> or m.drawing_no ilike concat('%', #{request.key}, '%')
AND m.drawing_no ilike concat('%', #{request.drawingNo}, '%') or t.task_no ilike concat('%', #{request.key}, '%')
</if> or t.supplier_code ilike concat('%', #{request.key}, '%')
<if test="request.taskNo != null and request.taskNo != ''"> or t.supplier_name ilike concat('%', #{request.key}, '%')
AND t.task_no ilike concat('%', #{request.taskNo}, '%') )
</if>
<if test="request.supplierCode != null and request.supplierCode != ''">
AND t.supplier_code ilike concat('%', #{request.supplierCode}, '%')
</if>
<if test="request.supplierName != null and request.supplierName != ''">
AND t.supplier_name ilike concat('%', #{request.supplierName}, '%')
</if> </if>
</where> </where>
ORDER BY t.required_finish_time ASC ORDER BY t.required_finish_time ASC