|
|
|
@ -1566,110 +1566,114 @@ |
|
|
|
<!-- 查询FAI主记录信息 --> |
|
|
|
<select id="qcFAIInspectionSearch" parameterType="QcFAIRecordData" resultType="QcFAIRecordData"> |
|
|
|
SELECT |
|
|
|
inspection_no, |
|
|
|
site, |
|
|
|
bu_no, |
|
|
|
dbo.get_bu_desc(site, bu_no) as buDesc, |
|
|
|
state, |
|
|
|
inspection_result, |
|
|
|
task_date, |
|
|
|
inspection_type_no, |
|
|
|
dbo.qc_get_inspection_type_name(site, inspection_type_no) as inspectionTypeName, |
|
|
|
inspection_cycle, |
|
|
|
order_no, |
|
|
|
operation_desc, |
|
|
|
resource_id, |
|
|
|
dbo.qc_get_resource_desc(site, resource_id, work_center_no) as resourceDesc, |
|
|
|
part_no, |
|
|
|
dbo.qc_get_part_desc(site, bu_no, part_no) as part_desc, |
|
|
|
inspection_remark, |
|
|
|
roll_qty, |
|
|
|
sampling_qty, |
|
|
|
disposal_measures, |
|
|
|
disposal_remark, |
|
|
|
inspector_date, |
|
|
|
inspector_no, |
|
|
|
dbo.qc_get_inspector_name(site, inspector_no) as inspectorName, |
|
|
|
ssr_id, |
|
|
|
unqualified_qty, |
|
|
|
submit_flag, |
|
|
|
dbo.qc_get_cinv_source_code(site, part_no) as cinvSourceCode, |
|
|
|
dbo.qc_get_sku(site, part_no) as sku, |
|
|
|
dbo.qc_get_invdefinetype(site, part_no) as invdefinetype, |
|
|
|
seq_no, |
|
|
|
batch_roll_no, |
|
|
|
special_requirements, |
|
|
|
work_center_no, |
|
|
|
roll_no, |
|
|
|
um_id, |
|
|
|
dbo.qc_get_um_name(site, um_id) as umName, |
|
|
|
action_date, |
|
|
|
action_by, |
|
|
|
isnull(dbo.joint_id(site, bu_no, inspection_no, 'coordination'), '') as operator, |
|
|
|
isnull(dbo.joint_name(site, bu_no, inspection_no, 'coordination'), '') as operatorName, |
|
|
|
isnull(dbo.joint_id(site, bu_no, inspection_no, 'responsible'), '') as responsiblePerson, |
|
|
|
isnull(dbo.joint_name2(site, bu_no, inspection_no, 'responsible'), '') as responsiblePersonName |
|
|
|
FROM qc_fai_record |
|
|
|
a.inspection_no, |
|
|
|
a.site, |
|
|
|
a.bu_no, |
|
|
|
dbo.get_bu_desc(a.site, a.bu_no) as buDesc, |
|
|
|
a.state, |
|
|
|
a.inspection_result, |
|
|
|
a.task_date, |
|
|
|
a.inspection_type_no, |
|
|
|
dbo.qc_get_inspection_type_name(a.site, a.inspection_type_no) as inspectionTypeName, |
|
|
|
a.inspection_cycle, |
|
|
|
a.order_no, |
|
|
|
a.operation_desc, |
|
|
|
a.resource_id, |
|
|
|
r.resource_desc, |
|
|
|
a.part_no, |
|
|
|
d.part_desc, |
|
|
|
d.cinv_source_code as cinvSourceCode, |
|
|
|
d.sku as sku, |
|
|
|
d.invdefinetype as invdefinetype, |
|
|
|
a.inspection_remark, |
|
|
|
a.roll_qty, |
|
|
|
a.sampling_qty, |
|
|
|
a.disposal_measures, |
|
|
|
a.disposal_remark, |
|
|
|
a.inspector_date, |
|
|
|
a.inspector_no, |
|
|
|
u.user_display as inspectorName, |
|
|
|
a.ssr_id, |
|
|
|
a.unqualified_qty, |
|
|
|
a.submit_flag, |
|
|
|
a.seq_no, |
|
|
|
a.batch_roll_no, |
|
|
|
a.special_requirements, |
|
|
|
a.work_center_no, |
|
|
|
a.roll_no, |
|
|
|
a.um_id, |
|
|
|
um.UMName as umName, |
|
|
|
a.action_date, |
|
|
|
a.action_by, |
|
|
|
isnull(dbo.joint_id(a.site, a.bu_no, a.inspection_no, 'coordination'), '') as operator, |
|
|
|
isnull(dbo.joint_name(a.site, a.bu_no, a.inspection_no, 'coordination'), '') as operatorName, |
|
|
|
isnull(dbo.joint_id(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePerson, |
|
|
|
isnull(dbo.joint_name2(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePersonName |
|
|
|
FROM qc_fai_record as a |
|
|
|
left join part as d on a.site = d.site and a.bu_no = d.sourceBu and a.part_no = d.part_no |
|
|
|
left join sys_user as u on a.inspector_no = u.username |
|
|
|
left join resource as r on a.site = r.site and a.resource_id = r.resource_id and a.work_center_no = r.work_center_no |
|
|
|
left join UM as um on a.site = um.site and a.um_id = um.UMID |
|
|
|
<where> |
|
|
|
site in (select site from eam_access_site where username = #{query.userName}) |
|
|
|
and (site + '-' + bu_no) in (select * from dbo.query_bu(#{query.userName})) |
|
|
|
a.site in (select site from eam_access_site where username = #{query.userName}) |
|
|
|
and (a.site + '-' + a.bu_no) in (select * from dbo.query_bu(#{query.userName})) |
|
|
|
<if test="query.buNo != null and query.buNo != ''"> |
|
|
|
AND bu_no = #{query.buNo} |
|
|
|
AND a.bu_no = #{query.buNo} |
|
|
|
</if> |
|
|
|
<if test = "query.inspectionNo != null and query.inspectionNo != ''"> |
|
|
|
AND inspection_no LIKE '%' + #{query.inspectionNo} + '%' |
|
|
|
AND a.inspection_no LIKE '%' + #{query.inspectionNo} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.partNo != null and query.partNo != ''"> |
|
|
|
AND part_no LIKE '%' + #{query.partNo} + '%' |
|
|
|
AND a.part_no LIKE '%' + #{query.partNo} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.partDesc != null and query.partDesc != ''"> |
|
|
|
AND dbo.qc_get_part_desc(site, bu_no, part_no) LIKE '%' + #{query.partDesc} + '%' |
|
|
|
AND d.part_desc LIKE '%' + #{query.partDesc} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.cinvSourceCode != null and query.cinvSourceCode != ''"> |
|
|
|
AND dbo.qc_get_cinv_source_code(site, part_no) LIKE '%' + #{query.cinvSourceCode} + '%' |
|
|
|
AND d.cinv_source_code LIKE '%' + #{query.cinvSourceCode} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.sku != null and query.sku != ''"> |
|
|
|
AND dbo.qc_get_sku(site, part_no) LIKE '%' + #{query.sku} + '%' |
|
|
|
AND d.sku LIKE '%' + #{query.sku} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.disposalMeasures != null and query.disposalMeasures != ''"> |
|
|
|
AND disposal_measures LIKE '%' + #{query.disposalMeasures} + '%' |
|
|
|
AND a.disposal_measures LIKE '%' + #{query.disposalMeasures} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.states != null and query.states.size > 0"> |
|
|
|
AND state in |
|
|
|
AND a.state in |
|
|
|
<foreach item="item" collection="query.states" open="(" separator="," close=")"> |
|
|
|
#{item} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test = "query.inspectionResult != null and query.inspectionResult != ''"> |
|
|
|
AND inspection_result = #{query.inspectionResult} |
|
|
|
AND a.inspection_result = #{query.inspectionResult} |
|
|
|
</if> |
|
|
|
<if test = "query.orderNo != null and query.orderNo != ''"> |
|
|
|
AND order_no LIKE '%' + #{query.orderNo} + '%' |
|
|
|
AND a.order_no LIKE '%' + #{query.orderNo} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.seqNo != null and query.seqNo != ''"> |
|
|
|
AND seq_no LIKE '%' + #{query.seqNo} + '%' |
|
|
|
AND a.seq_no LIKE '%' + #{query.seqNo} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.operationDesc != null and query.operationDesc != ''"> |
|
|
|
AND operation_desc LIKE '%' + #{query.operationDesc} + '%' |
|
|
|
AND a.operation_desc LIKE '%' + #{query.operationDesc} + '%' |
|
|
|
</if> |
|
|
|
<if test="query.startDate != null"> |
|
|
|
AND inspector_date >= #{query.startDate} |
|
|
|
AND a.inspector_date >= #{query.startDate} |
|
|
|
</if> |
|
|
|
<if test="query.endDate != null"> |
|
|
|
AND #{query.endDate} >= inspector_date |
|
|
|
AND #{query.endDate} >= a.inspector_date |
|
|
|
</if> |
|
|
|
<if test="query.startDate2 != null"> |
|
|
|
AND task_date >= #{query.startDate2} |
|
|
|
AND a.task_date >= #{query.startDate2} |
|
|
|
</if> |
|
|
|
<if test="query.endDate2 != null"> |
|
|
|
AND #{query.endDate2} >= task_date |
|
|
|
AND #{query.endDate2} >= a.task_date |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
ORDER BY |
|
|
|
CASE WHEN state = '待检验' THEN 1 |
|
|
|
WHEN state = '待审核' THEN 2 |
|
|
|
WHEN state = '已完成' THEN 3 |
|
|
|
END, task_date desc |
|
|
|
CASE WHEN a.state = '待检验' THEN 1 |
|
|
|
WHEN a.state = '待审核' THEN 2 |
|
|
|
WHEN a.state = '已完成' THEN 3 |
|
|
|
END, a.task_date desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 获取物料的类别编码 --> |
|
|
|
@ -1901,112 +1905,116 @@ |
|
|
|
<!-- 查询IPQC主记录信息 --> |
|
|
|
<select id="qcIPQCInspectionSearch" parameterType="QcFAIRecordData" resultType="QcFAIRecordData"> |
|
|
|
SELECT |
|
|
|
inspection_no, |
|
|
|
site, |
|
|
|
bu_no, |
|
|
|
dbo.get_bu_desc(site, bu_no) as buDesc, |
|
|
|
state, |
|
|
|
inspection_result, |
|
|
|
task_date, |
|
|
|
inspection_type_no, |
|
|
|
inspection_cycle, |
|
|
|
order_no, |
|
|
|
operation_desc, |
|
|
|
resource_id, |
|
|
|
dbo.qc_get_resource_desc(site, resource_id, work_center_no) as resourceDesc, |
|
|
|
part_no, |
|
|
|
dbo.qc_get_part_desc(site, bu_no, part_no) as part_desc, |
|
|
|
dbo.qc_get_cinv_source_code(site, part_no) as cinvSourceCode, |
|
|
|
inspection_remark, |
|
|
|
roll_qty, |
|
|
|
sampling_qty, |
|
|
|
disposal_measures, |
|
|
|
disposal_remark, |
|
|
|
inspector_date, |
|
|
|
inspector_no, |
|
|
|
dbo.qc_get_inspector_name(site, inspector_no) as inspectorName, |
|
|
|
ssr_id, |
|
|
|
unqualified_qty, |
|
|
|
submit_flag, |
|
|
|
dbo.qc_get_sku(site, part_no) as sku, |
|
|
|
dbo.qc_get_invdefinetype(site, part_no) as invdefinetype, |
|
|
|
seq_no, |
|
|
|
batch_roll_no, |
|
|
|
special_requirements, |
|
|
|
work_center_no, |
|
|
|
roll_no, |
|
|
|
um_id, |
|
|
|
dbo.qc_get_um_name(site, um_id) as umName, |
|
|
|
action_date, |
|
|
|
action_by, |
|
|
|
isnull(dbo.joint_id(site, bu_no, inspection_no, 'coordination'), '') as operator, |
|
|
|
isnull(dbo.joint_name(site, bu_no, inspection_no, 'coordination'), '') as operatorName, |
|
|
|
isnull(dbo.joint_id(site, bu_no, inspection_no, 'responsible'), '') as responsiblePerson, |
|
|
|
isnull(dbo.joint_name2(site, bu_no, inspection_no, 'responsible'), '') as responsiblePersonName |
|
|
|
FROM qc_ipqc_record |
|
|
|
a.inspection_no, |
|
|
|
a.site, |
|
|
|
a.bu_no, |
|
|
|
dbo.get_bu_desc(a.site, a.bu_no) as buDesc, |
|
|
|
a.state, |
|
|
|
a.inspection_result, |
|
|
|
a.task_date, |
|
|
|
a.inspection_type_no, |
|
|
|
a.inspection_cycle, |
|
|
|
a.order_no, |
|
|
|
a.operation_desc, |
|
|
|
a.resource_id, |
|
|
|
r.resource_desc, |
|
|
|
a.part_no, |
|
|
|
d.part_desc, |
|
|
|
d.cinv_source_code as cinvSourceCode, |
|
|
|
d.sku as sku, |
|
|
|
d.invdefinetype as invdefinetype, |
|
|
|
a.inspection_remark, |
|
|
|
a.roll_qty, |
|
|
|
a.sampling_qty, |
|
|
|
a.disposal_measures, |
|
|
|
a.disposal_remark, |
|
|
|
a.inspector_date, |
|
|
|
a.inspector_no, |
|
|
|
u.user_display as inspectorName, |
|
|
|
a.ssr_id, |
|
|
|
a.unqualified_qty, |
|
|
|
a.submit_flag, |
|
|
|
a.seq_no, |
|
|
|
a.batch_roll_no, |
|
|
|
a.special_requirements, |
|
|
|
a.work_center_no, |
|
|
|
a.roll_no, |
|
|
|
a.um_id, |
|
|
|
um.UMName as umName, |
|
|
|
a.action_date, |
|
|
|
a.action_by, |
|
|
|
isnull(dbo.joint_id(a.site, a.bu_no, a.inspection_no, 'coordination'), '') as operator, |
|
|
|
isnull(dbo.joint_name(a.site, a.bu_no, a.inspection_no, 'coordination'), '') as operatorName, |
|
|
|
isnull(dbo.joint_id(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePerson, |
|
|
|
isnull(dbo.joint_name2(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePersonName |
|
|
|
FROM qc_ipqc_record as a |
|
|
|
left join part as d on a.site = d.site and a.bu_no = d.sourceBu and a.part_no = d.part_no |
|
|
|
left join sys_user as u on a.inspector_no = u.username |
|
|
|
left join resource as r on a.site = r.site and a.resource_id = r.resource_id and a.work_center_no = r.work_center_no |
|
|
|
left join UM as um on a.site = um.site and a.um_id = um.UMID |
|
|
|
<where> |
|
|
|
site in (select site from eam_access_site where username = #{query.userName}) |
|
|
|
and (site + '-' + bu_no) in (select * from dbo.query_bu(#{query.userName})) |
|
|
|
a.site in (select site from eam_access_site where username = #{query.userName}) |
|
|
|
and (a.site + '-' + a.bu_no) in (select * from dbo.query_bu(#{query.userName})) |
|
|
|
<if test="query.buNo != null and query.buNo != ''"> |
|
|
|
AND bu_no = #{query.buNo} |
|
|
|
AND a.bu_no = #{query.buNo} |
|
|
|
</if> |
|
|
|
<if test = "query.inspectionNo != null and query.inspectionNo != ''"> |
|
|
|
AND inspection_no LIKE '%' + #{query.inspectionNo} + '%' |
|
|
|
AND a.inspection_no LIKE '%' + #{query.inspectionNo} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.partNo != null and query.partNo != ''"> |
|
|
|
AND part_no LIKE '%' + #{query.partNo} + '%' |
|
|
|
AND a.part_no LIKE '%' + #{query.partNo} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.partDesc != null and query.partDesc != ''"> |
|
|
|
AND dbo.qc_get_part_desc(site, bu_no, part_no) LIKE '%' + #{query.partDesc} + '%' |
|
|
|
AND d.part_desc LIKE '%' + #{query.partDesc} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.cinvSourceCode != null and query.cinvSourceCode != ''"> |
|
|
|
AND dbo.qc_get_cinv_source_code(site, part_no) LIKE '%' + #{query.cinvSourceCode} + '%' |
|
|
|
AND d.cinv_source_code LIKE '%' + #{query.cinvSourceCode} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.sku != null and query.sku != ''"> |
|
|
|
AND dbo.qc_get_sku(site, part_no) LIKE '%' + #{query.sku} + '%' |
|
|
|
AND d.sku LIKE '%' + #{query.sku} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.states != null and query.states.size > 0"> |
|
|
|
AND state in |
|
|
|
AND a.state in |
|
|
|
<foreach item="item" collection="query.states" open="(" separator="," close=")"> |
|
|
|
#{item} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test = "query.inspectionTypeNo != null and query.inspectionTypeNo != ''"> |
|
|
|
AND inspection_type_no = #{query.inspectionTypeNo} |
|
|
|
AND a.inspection_type_no = #{query.inspectionTypeNo} |
|
|
|
</if> |
|
|
|
<if test = "query.inspectionResult != null and query.inspectionResult != ''"> |
|
|
|
AND inspection_result = #{query.inspectionResult} |
|
|
|
AND a.inspection_result = #{query.inspectionResult} |
|
|
|
</if> |
|
|
|
<if test = "query.disposalMeasures != null and query.disposalMeasures != ''"> |
|
|
|
AND disposal_measures LIKE '%' + #{query.disposalMeasures} + '%' |
|
|
|
AND a.disposal_measures LIKE '%' + #{query.disposalMeasures} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.orderNo != null and query.orderNo != ''"> |
|
|
|
AND order_no LIKE '%' + #{query.orderNo} + '%' |
|
|
|
AND a.order_no LIKE '%' + #{query.orderNo} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.seqNo != null and query.seqNo != ''"> |
|
|
|
AND seq_no LIKE '%' + #{query.seqNo} + '%' |
|
|
|
AND a.seq_no LIKE '%' + #{query.seqNo} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.operationDesc != null and query.operationDesc != ''"> |
|
|
|
AND operation_desc LIKE '%' + #{query.operationDesc} + '%' |
|
|
|
AND a.operation_desc LIKE '%' + #{query.operationDesc} + '%' |
|
|
|
</if> |
|
|
|
<if test="query.startDate != null"> |
|
|
|
AND inspector_date >= #{query.startDate} |
|
|
|
AND a.inspector_date >= #{query.startDate} |
|
|
|
</if> |
|
|
|
<if test="query.endDate != null"> |
|
|
|
AND #{query.endDate} >= inspector_date |
|
|
|
AND #{query.endDate} >= a.inspector_date |
|
|
|
</if> |
|
|
|
<if test="query.startDate2 != null"> |
|
|
|
AND task_date >= #{query.startDate2} |
|
|
|
AND a.task_date >= #{query.startDate2} |
|
|
|
</if> |
|
|
|
<if test="query.endDate2 != null"> |
|
|
|
AND #{query.endDate2} >= task_date |
|
|
|
AND #{query.endDate2} >= a.task_date |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
ORDER BY |
|
|
|
CASE WHEN state = '待检验' THEN 1 |
|
|
|
WHEN state = '待审核' THEN 2 |
|
|
|
WHEN state = '已完成' THEN 3 |
|
|
|
END, task_date desc |
|
|
|
CASE WHEN a.state = '待检验' THEN 1 |
|
|
|
WHEN a.state = '待审核' THEN 2 |
|
|
|
WHEN a.state = '已完成' THEN 3 |
|
|
|
END, a.task_date desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- IPQC明细记录查询 --> |
|
|
|
@ -2275,119 +2283,122 @@ |
|
|
|
<!-- 查询IQC主记录信息 --> |
|
|
|
<select id="qcIQCInspectionSearch" parameterType="QcFAIRecordData" resultType="QcFAIRecordData"> |
|
|
|
SELECT |
|
|
|
inspection_no, |
|
|
|
site, |
|
|
|
bu_no, |
|
|
|
dbo.get_bu_desc(site, bu_no) as buDesc, |
|
|
|
state, |
|
|
|
inspection_result, |
|
|
|
create_date as taskDate, |
|
|
|
inspection_type_no, |
|
|
|
inspection_cycle, |
|
|
|
part_no, |
|
|
|
part_desc, |
|
|
|
dbo.qc_get_cinv_source_code(site, part_no) as cinvSourceCode, |
|
|
|
dbo.qc_get_sku(site, part_no) as sku, |
|
|
|
dbo.qc_get_invdefinetype(site, part_no) as invdefinetype, |
|
|
|
dbo.qc_get_part_umid(site, part_no) as umId, |
|
|
|
inspection_remark, |
|
|
|
roll_qty, |
|
|
|
sampling_qty, |
|
|
|
disposal_measures, |
|
|
|
disposal_remark, |
|
|
|
inspector_date, |
|
|
|
inspector_no, |
|
|
|
dbo.qc_get_inspector_name(site, inspector_no) as inspectorName, |
|
|
|
unqualified_quantity, |
|
|
|
submit_flag, |
|
|
|
roll_no, |
|
|
|
supplier_no, |
|
|
|
dbo.qc_get_supplier_name(site, supplier_no) as supplierDesc, |
|
|
|
po_orderNo, |
|
|
|
po_itemNo, |
|
|
|
roll_count, |
|
|
|
dbo.qc_get_order_type(site, po_orderNo, po_itemNo) as orderType, |
|
|
|
action_date, |
|
|
|
action_by, |
|
|
|
isnull(dbo.joint_id(site, bu_no, inspection_no, 'coordination'), '') as operator, |
|
|
|
isnull(dbo.joint_name(site, bu_no, inspection_no, 'coordination'), '') as operatorName, |
|
|
|
isnull(dbo.joint_id(site, bu_no, inspection_no, 'responsible'), '') as responsiblePerson, |
|
|
|
isnull(dbo.joint_name2(site, bu_no, inspection_no, 'responsible'), '') as responsiblePersonName, |
|
|
|
submission_remark, |
|
|
|
submission_type |
|
|
|
FROM qc_iqc_record |
|
|
|
a.inspection_no, |
|
|
|
a.site, |
|
|
|
a.bu_no, |
|
|
|
dbo.get_bu_desc(a.site, a.bu_no) as buDesc, |
|
|
|
a.state, |
|
|
|
a.inspection_result, |
|
|
|
a.create_date as taskDate, |
|
|
|
a.inspection_type_no, |
|
|
|
a.inspection_cycle, |
|
|
|
a.part_no, |
|
|
|
a.part_desc, |
|
|
|
d.cinv_source_code as cinvSourceCode, |
|
|
|
d.sku, |
|
|
|
d.umid as umId, |
|
|
|
d.invdefinetype as invdefinetype, |
|
|
|
a.inspection_remark, |
|
|
|
a.roll_qty, |
|
|
|
a.sampling_qty, |
|
|
|
a.disposal_measures, |
|
|
|
a.disposal_remark, |
|
|
|
a.inspector_date, |
|
|
|
a.inspector_no, |
|
|
|
u.user_display as inspectorName, |
|
|
|
a.unqualified_quantity, |
|
|
|
a.submit_flag, |
|
|
|
a.roll_no, |
|
|
|
a.supplier_no, |
|
|
|
s.SupplierName as supplierDesc, |
|
|
|
a.po_orderNo, |
|
|
|
a.po_itemNo, |
|
|
|
a.roll_count, |
|
|
|
dbo.qc_get_order_type(a.site, a.po_orderNo, a.po_itemNo) as orderType, |
|
|
|
a.action_date, |
|
|
|
a.action_by, |
|
|
|
isnull(dbo.joint_id(a.site, a.bu_no, a.inspection_no, 'coordination'), '') as operator, |
|
|
|
isnull(dbo.joint_name(a.site, a.bu_no, a.inspection_no, 'coordination'), '') as operatorName, |
|
|
|
isnull(dbo.joint_id(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePerson, |
|
|
|
isnull(dbo.joint_name2(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePersonName, |
|
|
|
a.submission_remark, |
|
|
|
a.submission_type |
|
|
|
FROM qc_iqc_record as a |
|
|
|
left join part as d on a.site = d.site and a.bu_no = d.sourceBu and a.part_no = d.part_no |
|
|
|
left join view_Supplier as s on a.site = s.site and a.supplier_no = s.SupplierID |
|
|
|
left join sys_user as u on a.inspector_no = u.username |
|
|
|
<where> |
|
|
|
site in (select site from eam_access_site where username = #{query.userName}) |
|
|
|
and (site + '-' + bu_no) in (select * from dbo.query_bu(#{query.userName})) |
|
|
|
a.site in (select site from eam_access_site where username = #{query.userName}) |
|
|
|
and (a.site + '-' + a.bu_no) in (select * from dbo.query_bu(#{query.userName})) |
|
|
|
<if test="query.buNo != null and query.buNo != ''"> |
|
|
|
AND bu_no = #{query.buNo} |
|
|
|
AND a.bu_no = #{query.buNo} |
|
|
|
</if> |
|
|
|
<if test = "query.inspectionNo != null and query.inspectionNo != ''"> |
|
|
|
AND inspection_no LIKE '%' + #{query.inspectionNo} + '%' |
|
|
|
AND a.inspection_no LIKE '%' + #{query.inspectionNo} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.states != null and query.states.size > 0"> |
|
|
|
AND state in |
|
|
|
AND a.state in |
|
|
|
<foreach item="item" collection="query.states" open="(" separator="," close=")"> |
|
|
|
#{item} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test = "query.inspectionResult != null and query.inspectionResult != ''"> |
|
|
|
AND inspection_result = #{query.inspectionResult} |
|
|
|
AND a.inspection_result = #{query.inspectionResult} |
|
|
|
</if> |
|
|
|
<if test = "query.partNo != null and query.partNo != ''"> |
|
|
|
AND part_no LIKE '%' + #{query.partNo} + '%' |
|
|
|
AND a.part_no LIKE '%' + #{query.partNo} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.partDesc != null and query.partDesc != ''"> |
|
|
|
AND part_desc LIKE '%' + #{query.partDesc} + '%' |
|
|
|
AND a.part_desc LIKE '%' + #{query.partDesc} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.cinvSourceCode != null and query.cinvSourceCode != ''"> |
|
|
|
AND dbo.qc_get_cinv_source_code(site, part_no) LIKE '%' + #{query.cinvSourceCode} + '%' |
|
|
|
AND d.cinv_source_code LIKE '%' + #{query.cinvSourceCode} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.sku != null and query.sku != ''"> |
|
|
|
AND dbo.qc_get_sku(site, part_no) LIKE '%' + #{query.sku} + '%' |
|
|
|
AND d.sku LIKE '%' + #{query.sku} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.supplierDesc != null and query.supplierDesc != ''"> |
|
|
|
AND dbo.qc_get_supplier_name(site, supplier_no) LIKE '%' + #{query.supplierDesc} + '%' |
|
|
|
AND s.SupplierName LIKE '%' + #{query.supplierDesc} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.disposalMeasures != null and query.disposalMeasures != ''"> |
|
|
|
AND disposal_measures LIKE '%' + #{query.disposalMeasures} + '%' |
|
|
|
AND a.disposal_measures LIKE '%' + #{query.disposalMeasures} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.inspectorName != null and query.inspectorName != ''"> |
|
|
|
AND dbo.qc_get_inspector_name(site, inspector_no) LIKE '%' + #{query.inspectorName} + '%' |
|
|
|
u.user_display LIKE '%' + #{query.inspectorName} + '%' |
|
|
|
</if> |
|
|
|
<if test="query.startDate != null"> |
|
|
|
AND inspector_date >= #{query.startDate} |
|
|
|
AND a.inspector_date >= #{query.startDate} |
|
|
|
</if> |
|
|
|
<if test="query.endDate != null"> |
|
|
|
AND #{query.endDate} >= inspector_date |
|
|
|
AND #{query.endDate} >= a.inspector_date |
|
|
|
</if> |
|
|
|
<if test="query.startDate2 != null"> |
|
|
|
AND create_date >= #{query.startDate2} |
|
|
|
AND a.create_date >= #{query.startDate2} |
|
|
|
</if> |
|
|
|
<if test="query.endDate2 != null"> |
|
|
|
AND #{query.endDate2} >= create_date |
|
|
|
AND #{query.endDate2} >= a.create_date |
|
|
|
</if> |
|
|
|
<if test = "query.poOrderNo != null and query.poOrderNo != ''"> |
|
|
|
AND po_orderNo LIKE '%' + #{query.poOrderNo} + '%' |
|
|
|
AND a.po_orderNo LIKE '%' + #{query.poOrderNo} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.poItemNo != null and query.poItemNo != ''"> |
|
|
|
AND po_itemNo LIKE '%' + #{query.poItemNo} + '%' |
|
|
|
AND a.po_itemNo LIKE '%' + #{query.poItemNo} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.orderType != null and query.orderType != ''"> |
|
|
|
AND dbo.qc_get_order_type(site, po_orderNo, po_itemNo) = #{query.orderType} |
|
|
|
AND dbo.qc_get_order_type(a.site, a.po_orderNo, a.po_itemNo) = #{query.orderType} |
|
|
|
</if> |
|
|
|
<if test = "query.submissionType != null and query.submissionType != ''"> |
|
|
|
AND submission_type = #{query.submissionType} |
|
|
|
AND a.submission_type = #{query.submissionType} |
|
|
|
</if> |
|
|
|
<if test = "query.invdefinetype != null and query.invdefinetype != ''"> |
|
|
|
AND dbo.qc_get_invdefinetype(site, part_no) LIKE '%' + #{query.invdefinetype} + '%' |
|
|
|
AND d.invdefinetype LIKE '%' + #{query.invdefinetype} + '%' |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
ORDER BY |
|
|
|
CASE WHEN state = '待检验' THEN 1 |
|
|
|
WHEN state = '待审核' THEN 2 |
|
|
|
WHEN state = '已完成' THEN 3 |
|
|
|
END, create_date desc |
|
|
|
CASE WHEN a.state = '待检验' THEN 1 |
|
|
|
WHEN a.state = '待审核' THEN 2 |
|
|
|
WHEN a.state = '已完成' THEN 3 |
|
|
|
END, a.create_date desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- IQC明细记录查询 --> |
|
|
|
@ -2633,110 +2644,114 @@ |
|
|
|
<!-- 查询FQC主记录信息 --> |
|
|
|
<select id="qcFQCInspectionSearch" parameterType="QcFAIRecordData" resultType="QcFAIRecordData"> |
|
|
|
SELECT |
|
|
|
inspection_no, |
|
|
|
site, |
|
|
|
bu_no, |
|
|
|
dbo.get_bu_desc(site, bu_no) as buDesc, |
|
|
|
state, |
|
|
|
inspection_result, |
|
|
|
task_date, |
|
|
|
inspection_type_no, |
|
|
|
dbo.qc_get_inspection_type_name(site, inspection_type_no) as inspectionTypeName, |
|
|
|
inspection_cycle, |
|
|
|
order_no, |
|
|
|
operation_desc, |
|
|
|
resource_id, |
|
|
|
dbo.qc_get_resource_desc(site, resource_id, work_center_no) as resourceDesc, |
|
|
|
part_no, |
|
|
|
dbo.qc_get_part_desc(site, bu_no, part_no) as part_desc, |
|
|
|
inspection_remark, |
|
|
|
roll_qty, |
|
|
|
sampling_qty, |
|
|
|
disposal_measures, |
|
|
|
disposal_remark, |
|
|
|
inspector_date, |
|
|
|
inspector_no, |
|
|
|
dbo.qc_get_inspector_name(site, inspector_no) as inspectorName, |
|
|
|
ssr_id, |
|
|
|
unqualified_qty, |
|
|
|
submit_flag, |
|
|
|
dbo.qc_get_cinv_source_code(site, part_no) as cinvSourceCode, |
|
|
|
dbo.qc_get_sku(site, part_no) as sku, |
|
|
|
dbo.qc_get_invdefinetype(site, part_no) as invdefinetype, |
|
|
|
seq_no, |
|
|
|
batch_roll_no, |
|
|
|
special_requirements, |
|
|
|
work_center_no, |
|
|
|
roll_no, |
|
|
|
um_id, |
|
|
|
dbo.qc_get_um_name(site, um_id) as umName, |
|
|
|
action_date, |
|
|
|
action_by, |
|
|
|
isnull(dbo.joint_id(site, bu_no, inspection_no, 'coordination'), '') as operator, |
|
|
|
isnull(dbo.joint_name(site, bu_no, inspection_no, 'coordination'), '') as operatorName, |
|
|
|
isnull(dbo.joint_id(site, bu_no, inspection_no, 'responsible'), '') as responsiblePerson, |
|
|
|
isnull(dbo.joint_name2(site, bu_no, inspection_no, 'responsible'), '') as responsiblePersonName |
|
|
|
FROM qc_fqc_record |
|
|
|
a.inspection_no, |
|
|
|
a.site, |
|
|
|
a.bu_no, |
|
|
|
dbo.get_bu_desc(a.site, a.bu_no) as buDesc, |
|
|
|
a.state, |
|
|
|
a.inspection_result, |
|
|
|
a.task_date, |
|
|
|
a.inspection_type_no, |
|
|
|
dbo.qc_get_inspection_type_name(a.site, a.inspection_type_no) as inspectionTypeName, |
|
|
|
a.inspection_cycle, |
|
|
|
a.order_no, |
|
|
|
a.operation_desc, |
|
|
|
a.resource_id, |
|
|
|
r.resource_desc, |
|
|
|
a.part_no, |
|
|
|
d.part_desc, |
|
|
|
d.cinv_source_code as cinvSourceCode, |
|
|
|
d.sku as sku, |
|
|
|
d.invdefinetype as invdefinetype, |
|
|
|
a.inspection_remark, |
|
|
|
a.roll_qty, |
|
|
|
a.sampling_qty, |
|
|
|
a.disposal_measures, |
|
|
|
a.disposal_remark, |
|
|
|
a.inspector_date, |
|
|
|
a.inspector_no, |
|
|
|
u.user_display as inspectorName, |
|
|
|
a.ssr_id, |
|
|
|
a.unqualified_qty, |
|
|
|
a.submit_flag, |
|
|
|
a.seq_no, |
|
|
|
a.batch_roll_no, |
|
|
|
a.special_requirements, |
|
|
|
a.work_center_no, |
|
|
|
a.roll_no, |
|
|
|
a.um_id, |
|
|
|
um.UMName as umName, |
|
|
|
a.action_date, |
|
|
|
a.action_by, |
|
|
|
isnull(dbo.joint_id(a.site, a.bu_no, a.inspection_no, 'coordination'), '') as operator, |
|
|
|
isnull(dbo.joint_name(a.site, a.bu_no, a.inspection_no, 'coordination'), '') as operatorName, |
|
|
|
isnull(dbo.joint_id(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePerson, |
|
|
|
isnull(dbo.joint_name2(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePersonName |
|
|
|
FROM qc_fqc_record as a |
|
|
|
left join part as d on a.site = d.site and a.bu_no = d.sourceBu and a.part_no = d.part_no |
|
|
|
left join sys_user as u on a.inspector_no = u.username |
|
|
|
left join resource as r on a.site = r.site and a.resource_id = r.resource_id and a.work_center_no = r.work_center_no |
|
|
|
left join UM as um on a.site = um.site and a.um_id = um.UMID |
|
|
|
<where> |
|
|
|
site in (select site from eam_access_site where username = #{query.userName}) |
|
|
|
and (site + '-' + bu_no) in (select * from dbo.query_bu(#{query.userName})) |
|
|
|
a.site in (select site from eam_access_site where username = #{query.userName}) |
|
|
|
and (a.site + '-' + a.bu_no) in (select * from dbo.query_bu(#{query.userName})) |
|
|
|
<if test="query.buNo != null and query.buNo != ''"> |
|
|
|
AND bu_no = #{query.buNo} |
|
|
|
AND a.bu_no = #{query.buNo} |
|
|
|
</if> |
|
|
|
<if test = "query.inspectionNo != null and query.inspectionNo != ''"> |
|
|
|
AND inspection_no LIKE '%' + #{query.inspectionNo} + '%' |
|
|
|
AND a.inspection_no LIKE '%' + #{query.inspectionNo} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.partNo != null and query.partNo != ''"> |
|
|
|
AND part_no LIKE '%' + #{query.partNo} + '%' |
|
|
|
AND a.part_no LIKE '%' + #{query.partNo} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.partDesc != null and query.partDesc != ''"> |
|
|
|
AND dbo.qc_get_part_desc(site, bu_no, part_no) LIKE '%' + #{query.partDesc} + '%' |
|
|
|
AND d.part_desc LIKE '%' + #{query.partDesc} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.cinvSourceCode != null and query.cinvSourceCode != ''"> |
|
|
|
AND dbo.qc_get_cinv_source_code(site, part_no) LIKE '%' + #{query.cinvSourceCode} + '%' |
|
|
|
AND d.cinv_source_code LIKE '%' + #{query.cinvSourceCode} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.sku != null and query.sku != ''"> |
|
|
|
AND dbo.qc_get_sku(site, part_no) LIKE '%' + #{query.sku} + '%' |
|
|
|
AND d.sku LIKE '%' + #{query.sku} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.disposalMeasures != null and query.disposalMeasures != ''"> |
|
|
|
AND disposal_measures LIKE '%' + #{query.disposalMeasures} + '%' |
|
|
|
AND a.disposal_measures LIKE '%' + #{query.disposalMeasures} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.states != null and query.states.size > 0"> |
|
|
|
AND state in |
|
|
|
AND a.state in |
|
|
|
<foreach item="item" collection="query.states" open="(" separator="," close=")"> |
|
|
|
#{item} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test = "query.inspectionResult != null and query.inspectionResult != ''"> |
|
|
|
AND inspection_result = #{query.inspectionResult} |
|
|
|
AND a.inspection_result = #{query.inspectionResult} |
|
|
|
</if> |
|
|
|
<if test = "query.orderNo != null and query.orderNo != ''"> |
|
|
|
AND order_no LIKE '%' + #{query.orderNo} + '%' |
|
|
|
AND a.order_no LIKE '%' + #{query.orderNo} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.seqNo != null and query.seqNo != ''"> |
|
|
|
AND seq_no LIKE '%' + #{query.seqNo} + '%' |
|
|
|
AND a.seq_no LIKE '%' + #{query.seqNo} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.operationDesc != null and query.operationDesc != ''"> |
|
|
|
AND operation_desc LIKE '%' + #{query.operationDesc} + '%' |
|
|
|
AND a.operation_desc LIKE '%' + #{query.operationDesc} + '%' |
|
|
|
</if> |
|
|
|
<if test="query.startDate != null"> |
|
|
|
AND inspector_date >= #{query.startDate} |
|
|
|
AND a.inspector_date >= #{query.startDate} |
|
|
|
</if> |
|
|
|
<if test="query.endDate != null"> |
|
|
|
AND #{query.endDate} >= inspector_date |
|
|
|
AND #{query.endDate} >= a.inspector_date |
|
|
|
</if> |
|
|
|
<if test="query.startDate2 != null"> |
|
|
|
AND task_date >= #{query.startDate2} |
|
|
|
AND a.task_date >= #{query.startDate2} |
|
|
|
</if> |
|
|
|
<if test="query.endDate2 != null"> |
|
|
|
AND #{query.endDate2} >= task_date |
|
|
|
AND #{query.endDate2} >= a.task_date |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
ORDER BY |
|
|
|
CASE WHEN state = '待检验' THEN 1 |
|
|
|
WHEN state = '待审核' THEN 2 |
|
|
|
WHEN state = '已完成' THEN 3 |
|
|
|
END, task_date desc |
|
|
|
CASE WHEN a.state = '待检验' THEN 1 |
|
|
|
WHEN a.state = '待审核' THEN 2 |
|
|
|
WHEN a.state = '已完成' THEN 3 |
|
|
|
END, a.task_date desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 新增FQC明细记录信息 --> |
|
|
|
|