|
|
|
@ -534,6 +534,7 @@ |
|
|
|
d.cinv_source_code as cinvSourceCode, |
|
|
|
d.sku as sku, |
|
|
|
d.PartType as invdefinetype, |
|
|
|
d.spec, |
|
|
|
a.inspection_remark, |
|
|
|
a.roll_qty, |
|
|
|
a.sampling_qty, |
|
|
|
@ -916,7 +917,9 @@ |
|
|
|
d.cinv_source_code as cinvSourceCode, |
|
|
|
d.sku, |
|
|
|
d.umid as umId, |
|
|
|
um.UMName as umName, |
|
|
|
d.PartType as invdefinetype, |
|
|
|
d.spec, |
|
|
|
a.inspection_remark, |
|
|
|
a.roll_qty, |
|
|
|
a.sampling_qty, |
|
|
|
@ -954,6 +957,7 @@ |
|
|
|
left join part as d on a.site = d.site and a.bu_no = d.bu_no and a.part_no = d.partNo |
|
|
|
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 |
|
|
|
left join um as um on d.site = um.site and d.umid = um.UMID |
|
|
|
<where> |
|
|
|
a.site in (select site from AccessSite where userID = #{query.userName}) |
|
|
|
and a.bu_no in (select bu_no from AccessBu where username = #{query.userName}) |
|
|
|
@ -1294,6 +1298,7 @@ |
|
|
|
d.cinv_source_code as cinvSourceCode, |
|
|
|
d.sku as sku, |
|
|
|
d.PartType as invdefinetype, |
|
|
|
d.spec, |
|
|
|
a.inspection_remark, |
|
|
|
a.roll_qty, |
|
|
|
a.sampling_qty, |
|
|
|
@ -3336,95 +3341,96 @@ |
|
|
|
<!-- 查询OQC主记录信息 --> |
|
|
|
<select id="qcOQCInspectionSearch" parameterType="com.gaotao.modules.pms.data.QcFAIRecordData" resultType="com.gaotao.modules.pms.data.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, |
|
|
|
dbo.Get_Part_DescSpec(site, part_no) as part_desc, |
|
|
|
dbo.qc_get_part_umid(site, part_no) as umId, |
|
|
|
inspection_remark, |
|
|
|
roll_qty, |
|
|
|
sampling_qty, |
|
|
|
disposal_measures, |
|
|
|
disposal_remark, |
|
|
|
inspector_date, |
|
|
|
submit_flag, |
|
|
|
roll_no, |
|
|
|
roll_count, |
|
|
|
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_name(site, bu_no, inspection_no, 'responsible'), '') as responsiblePersonName, |
|
|
|
pass_qty, |
|
|
|
not_pass_qty, |
|
|
|
create_by, |
|
|
|
customer_no, |
|
|
|
dbo.Get_CustomerDesc(site, customer_no) as customerName, |
|
|
|
po_orderNo, |
|
|
|
po_itemNo |
|
|
|
FROM qc_oqc_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.umid as umId, |
|
|
|
um.UMName as umName, |
|
|
|
d.spec, |
|
|
|
a.inspection_remark, |
|
|
|
a.roll_qty, |
|
|
|
a.sampling_qty, |
|
|
|
a.disposal_measures, |
|
|
|
a.disposal_remark, |
|
|
|
a.inspector_date, |
|
|
|
a.submit_flag, |
|
|
|
a.roll_no, |
|
|
|
a.roll_count, |
|
|
|
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_name(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePersonName, |
|
|
|
a.pass_qty, |
|
|
|
a.not_pass_qty, |
|
|
|
a.create_by, |
|
|
|
a.customer_no, |
|
|
|
dbo.Get_CustomerDesc(a.site, a.customer_no) as customerName, |
|
|
|
a.po_orderNo, |
|
|
|
a.po_itemNo |
|
|
|
FROM qc_oqc_record as a |
|
|
|
left join part as d on a.site = d.site and a.bu_no = d.bu_no and a.part_no = d.partNo |
|
|
|
left join um as um on d.site = um.site and d.umid = um.UMID |
|
|
|
<where> |
|
|
|
site in (select site from AccessSite where userID = #{query.userName}) |
|
|
|
and bu_no in (select bu_no from AccessBu where username = #{query.userName}) |
|
|
|
a.site in (select site from AccessSite where userID = #{query.userName}) |
|
|
|
and a.bu_no in (select bu_no from AccessBu where username = #{query.userName}) |
|
|
|
<if test="query.buDesc != null and query.buDesc != ''"> |
|
|
|
AND dbo.get_bu_desc ( site, bu_no ) = #{query.buDesc} |
|
|
|
AND dbo.get_bu_desc (a.site, a.bu_no) = #{query.buDesc} |
|
|
|
</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 dbo.Get_Part_DescSpec(site, part_no) LIKE '%' + #{query.partDesc} + '%' |
|
|
|
AND a.part_desc LIKE '%' + #{query.partDesc} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.disposalMeasures != null and query.disposalMeasures != ''"> |
|
|
|
AND 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} + '%' |
|
|
|
AND a.disposal_measures LIKE '%' + #{query.disposalMeasures} + '%' |
|
|
|
</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.customerNo != null and query.customerNo != ''"> |
|
|
|
AND customer_no LIKE '%' + #{query.customerNo} + '%' |
|
|
|
AND a.customer_no LIKE '%' + #{query.customerNo} + '%' |
|
|
|
</if> |
|
|
|
<if test = "query.customerName != null and query.customerName != ''"> |
|
|
|
AND dbo.Get_CustomerDesc(site, customer_no) LIKE '%' + #{query.customerName} + '%' |
|
|
|
AND dbo.Get_CustomerDesc(a.site, a.customer_no) LIKE '%' + #{query.customerName} + '%' |
|
|
|
</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明细记录查询 --> |
|
|
|
|