|
|
@ -300,12 +300,12 @@ |
|
|
<if test="query.status != null and query.status != ''"> |
|
|
<if test="query.status != null and query.status != ''"> |
|
|
AND a.status like #{query.status} |
|
|
AND a.status like #{query.status} |
|
|
</if> |
|
|
</if> |
|
|
<if test="query.startDate != null "> |
|
|
|
|
|
AND a.apply_date >= #{query.startDate} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="query.endDate != null "> |
|
|
|
|
|
AND #{query.endDate} >= a.apply_date |
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
<!-- <if test="query.startDate != null ">--> |
|
|
|
|
|
<!-- AND a.apply_date >= #{query.startDate}--> |
|
|
|
|
|
<!-- </if>--> |
|
|
|
|
|
<!-- <if test="query.endDate != null ">--> |
|
|
|
|
|
<!-- AND #{query.endDate} >= a.apply_date--> |
|
|
|
|
|
<!-- </if>--> |
|
|
<if test="query.nodeId != null and query.nodeId != ''"> |
|
|
<if test="query.nodeId != null and query.nodeId != ''"> |
|
|
AND d.node_id = #{query.nodeId} |
|
|
AND d.node_id = #{query.nodeId} |
|
|
</if> |
|
|
</if> |
|
|
@ -319,6 +319,45 @@ |
|
|
<!-- AND project_id in ( select project_id from AccessProject where site=#{query.site} and username=#{query.userName} and searchFlag='Y' )--> |
|
|
<!-- AND project_id in ( select project_id from AccessProject where site=#{query.site} and username=#{query.userName} and searchFlag='Y' )--> |
|
|
<!-- AND bu_no in ( select bu_no from AccessBu where site=#{query.site} and username=#{query.userName})--> |
|
|
<!-- AND bu_no in ( select bu_no from AccessBu where site=#{query.site} and username=#{query.userName})--> |
|
|
<!-- </if>--> |
|
|
<!-- </if>--> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 新增:通过 EXISTS 关联明细表,按 tool_id 筛选 --> |
|
|
|
|
|
<if test="query.toolId != null and query.toolId != ''"> |
|
|
|
|
|
AND EXISTS ( |
|
|
|
|
|
SELECT 1 |
|
|
|
|
|
FROM plm_project_tool_applyDetail b |
|
|
|
|
|
WHERE b.site = a.site |
|
|
|
|
|
AND b.apply_no = a.apply_no |
|
|
|
|
|
AND b.tool_id like #{query.toolId} |
|
|
|
|
|
) |
|
|
|
|
|
</if> |
|
|
|
|
|
<!-- 新增:通过 EXISTS 关联明细 + view_Project_Part,按 final_part_no 过滤 --> |
|
|
|
|
|
<if test="query.ifsPartNo != null and query.ifsPartNo != ''"> |
|
|
|
|
|
AND EXISTS ( |
|
|
|
|
|
SELECT 1 |
|
|
|
|
|
FROM plm_project_tool_applyDetail det |
|
|
|
|
|
LEFT JOIN view_Project_Part h |
|
|
|
|
|
ON det.site = h.site |
|
|
|
|
|
AND h.test_part_no = det.orderRef2 |
|
|
|
|
|
AND det.orderRef1 = h.project_id |
|
|
|
|
|
WHERE det.site = a.site |
|
|
|
|
|
AND det.apply_no = a.apply_no |
|
|
|
|
|
AND h.final_part_no like #{query.ifsPartNo} |
|
|
|
|
|
) |
|
|
|
|
|
</if> |
|
|
|
|
|
<!-- 新增:通过 EXISTS 关联明细 + view_Project_Part,按 plm_part_no 过滤 --> |
|
|
|
|
|
<if test="query.plmPartNo != null and query.plmPartNo != ''"> |
|
|
|
|
|
AND EXISTS ( |
|
|
|
|
|
SELECT 1 |
|
|
|
|
|
FROM plm_project_tool_applyDetail det |
|
|
|
|
|
LEFT JOIN view_Project_Part h |
|
|
|
|
|
ON det.site = h.site |
|
|
|
|
|
AND h.test_part_no = det.orderRef2 |
|
|
|
|
|
AND det.orderRef1 = h.project_id |
|
|
|
|
|
WHERE det.site = a.site |
|
|
|
|
|
AND det.apply_no = a.apply_no |
|
|
|
|
|
AND h.plm_part_no like #{query.plmPartNo} |
|
|
|
|
|
) |
|
|
|
|
|
</if> |
|
|
</where> |
|
|
</where> |
|
|
order by a.apply_no desc |
|
|
order by a.apply_no desc |
|
|
</select> |
|
|
</select> |
|
|
|