|
|
|
@ -11,6 +11,8 @@
|
|
|
|
|
<result property="testTime" column="testtime"/>
|
|
|
|
|
<result property="testData" column="testdata"/>
|
|
|
|
|
<result property="recordTime" column="recordtime"/>
|
|
|
|
|
<result property="materialModel" column="MATERIAL_MODEL"/>
|
|
|
|
|
<result property="qualityDefectNames" column="QUALITY_DEFECT_NAMES"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<resultMap id="RecordElectricalInspectionDetailElectricalinspectionResult" type="RecordElectricalInspection"
|
|
|
|
@ -27,28 +29,54 @@
|
|
|
|
|
<result property="testvalue" column="sub_testvalue"/>
|
|
|
|
|
<result property="testresult" column="sub_testresult"/>
|
|
|
|
|
<result property="recordtime" column="sub_recordtime"/>
|
|
|
|
|
<result property="qualityDefectName" column="QUALITY_DEFECT_NAME"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectRecordElectricalInspectionVo">
|
|
|
|
|
select uuid, result, barcode, testtime, testdata, recordtime
|
|
|
|
|
from record_electricalinspection
|
|
|
|
|
SELECT ei.UUID,
|
|
|
|
|
ei.RESULT,
|
|
|
|
|
ei.BARCODE,
|
|
|
|
|
MI.MATERIAL_SPECIFICATIONS MATERIAL_MODEL,
|
|
|
|
|
ei.TESTTIME,
|
|
|
|
|
ei.TESTDATA,
|
|
|
|
|
NG.QUALITY_DEFECT_NAMES,
|
|
|
|
|
ei.RECORDTIME
|
|
|
|
|
FROM RECORD_ELECTRICALINSPECTION ei
|
|
|
|
|
LEFT JOIN C##AUCMA_MES.BASE_MATERIALINFO MI ON MI.MATERIAL_CODE = SUBSTR(ei.BARCODE, 8, 10)
|
|
|
|
|
LEFT JOIN (SELECT SD.UUID,
|
|
|
|
|
LISTAGG(QI.QUALITY_DEFECT_NAME, ',')
|
|
|
|
|
WITHIN GROUP (ORDER BY QI.QUALITY_DEFECT_NAME) AS QUALITY_DEFECT_NAMES
|
|
|
|
|
FROM (
|
|
|
|
|
SELECT DE.UUID,
|
|
|
|
|
DE.TESTRESULT,
|
|
|
|
|
CASE
|
|
|
|
|
WHEN DE.PROJECTNAME = 'lvs' THEN '5001'
|
|
|
|
|
WHEN DE.PROJECTNAME = 'gnd' THEN '5002'
|
|
|
|
|
WHEN DE.PROJECTNAME = 'ttl' THEN '5003'
|
|
|
|
|
WHEN DE.PROJECTNAME = 'acw' THEN '5004' END QUALITY_DEFECT_CODE
|
|
|
|
|
FROM DETAIL_ELECTRICALINSPECTION DE
|
|
|
|
|
WHERE DE.TESTRESULT = 'NG'
|
|
|
|
|
) SD
|
|
|
|
|
LEFT JOIN C##AUCMA_MES.BASE_QUALITY_INSPECTION_ITEM QI
|
|
|
|
|
ON QI.QUALITY_DEFECT_CODE = SD.QUALITY_DEFECT_CODE
|
|
|
|
|
GROUP BY SD.UUID) NG ON NG.UUID = ei.TESTDATA
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectRecordElectricalInspectionList" parameterType="RecordElectricalInspection"
|
|
|
|
|
resultMap="RecordElectricalInspectionResult">
|
|
|
|
|
<include refid="selectRecordElectricalInspectionVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="uuid != null and uuid != ''">and uuid = #{uuid}</if>
|
|
|
|
|
<if test="result != null and result != ''">and result = #{result}</if>
|
|
|
|
|
<if test="barcode != null and barcode != ''">and barcode = #{barcode}</if>
|
|
|
|
|
<if test="testTime != null and testTime != ''">and testtime = #{testTime}</if>
|
|
|
|
|
<if test="testData != null and testData != ''">and testdata = #{testData}</if>
|
|
|
|
|
<if test="uuid != null and uuid != ''">and ei.uuid = #{uuid}</if>
|
|
|
|
|
<if test="result != null and result != ''">and ei.result = #{result}</if>
|
|
|
|
|
<if test="barcode != null and barcode != ''">and ei.barcode = #{barcode}</if>
|
|
|
|
|
<if test="testTime != null and testTime != ''">and ei.testtime = #{testTime}</if>
|
|
|
|
|
<if test="testData != null and testData != ''">and ei.testdata = #{testData}</if>
|
|
|
|
|
<if test="params.beginRecordTime != null and params.beginRecordTime != '' and params.endRecordTime != null and params.endRecordTime != ''">
|
|
|
|
|
and recordtime between to_date(#{params.beginRecordTime}, 'yyyy-mm-dd hh24:mi:ss') and
|
|
|
|
|
and ei.recordtime between to_date(#{params.beginRecordTime}, 'yyyy-mm-dd hh24:mi:ss') and
|
|
|
|
|
to_date(#{params.endRecordTime}, 'yyyy-mm-dd hh24:mi:ss')
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by recordtime desc
|
|
|
|
|
order by ei.recordtime desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectRecordElectricalInspectionByUuid" parameterType="String"
|
|
|
|
@ -65,10 +93,22 @@
|
|
|
|
|
b.testcondition as sub_testcondition,
|
|
|
|
|
b.testvalue as sub_testvalue,
|
|
|
|
|
b.testresult as sub_testresult,
|
|
|
|
|
QI.QUALITY_DEFECT_NAME,
|
|
|
|
|
b.recordtime as sub_recordtime
|
|
|
|
|
from record_electricalinspection a
|
|
|
|
|
left join detail_electricalinspection b on b.uuid = a.testdata
|
|
|
|
|
LEFT JOIN C##AUCMA_MES.BASE_QUALITY_INSPECTION_ITEM QI
|
|
|
|
|
ON QI.QUALITY_DEFECT_CODE = (CASE
|
|
|
|
|
WHEN b.TESTRESULT = 'NG' AND b.PROJECTNAME = 'lvs'
|
|
|
|
|
THEN '5001'
|
|
|
|
|
WHEN b.TESTRESULT = 'NG' AND b.PROJECTNAME = 'gnd'
|
|
|
|
|
THEN '5002'
|
|
|
|
|
WHEN b.TESTRESULT = 'NG' AND b.PROJECTNAME = 'ttl'
|
|
|
|
|
THEN '5003'
|
|
|
|
|
WHEN b.TESTRESULT = 'NG' AND b.PROJECTNAME = 'acw'
|
|
|
|
|
THEN '5004' END)
|
|
|
|
|
where a.uuid = #{uuid}
|
|
|
|
|
ORDER BY sub_serialnumber
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertRecordElectricalInspection" parameterType="RecordElectricalInspection">
|
|
|
|
@ -140,8 +180,9 @@
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<insert id="insertDetailElectricalinspection" parameterType="DetailElectricalinspection">
|
|
|
|
|
INSERT INTO detail_electricalinspection( uuid, serialnumber, projectname, testcondition, testvalue, testresult,
|
|
|
|
|
recordtime) values ( #{uuid}, #{serialnumber}, #{projectname}, #{testcondition},
|
|
|
|
|
INSERT INTO detail_electricalinspection(uuid, serialnumber, projectname, testcondition, testvalue, testresult,
|
|
|
|
|
recordtime)
|
|
|
|
|
values (#{uuid}, #{serialnumber}, #{projectname}, #{testcondition},
|
|
|
|
|
#{testvalue}, #{testresult}, #{recordtime})
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|