change - 电检添加异常结果项显示

master
yinq 8 months ago
parent 3aa5114c4c
commit c9903c34b3

@ -53,6 +53,12 @@ public class DetailElectricalinspection extends BaseEntity {
@Excel(name = "测试结果")
private String testresult;
/**
*
*/
@Excel(name = "异常描述")
private String qualityDefectName;
/**
*
*/
@ -60,6 +66,14 @@ public class DetailElectricalinspection extends BaseEntity {
@Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date recordtime;
public String getQualityDefectName() {
return qualityDefectName;
}
public void setQualityDefectName(String qualityDefectName) {
this.qualityDefectName = qualityDefectName;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}

@ -21,9 +21,20 @@ public class RecordElectricalInspection extends BaseEntity {
/**
*
*/
@Excel(name = "唯一标识")
private String uuid;
/**
*
*/
@Excel(name = "产品条码")
private String barcode;
/**
*
*/
@Excel(name = "产品型号")
private String materialModel;
/**
*
*/
@ -31,10 +42,10 @@ public class RecordElectricalInspection extends BaseEntity {
private String result;
/**
*
*
*/
@Excel(name = "产品条码")
private String barcode;
@Excel(name = "异常描述")
private String qualityDefectNames;
/**
*
@ -45,7 +56,6 @@ public class RecordElectricalInspection extends BaseEntity {
/**
*
*/
@Excel(name = "测试数据")
private String testData;
/**
@ -60,6 +70,22 @@ public class RecordElectricalInspection extends BaseEntity {
*/
private List<DetailElectricalinspection> detailElectricalinspectionList;
public String getMaterialModel() {
return materialModel;
}
public void setMaterialModel(String materialModel) {
this.materialModel = materialModel;
}
public String getQualityDefectNames() {
return qualityDefectNames;
}
public void setQualityDefectNames(String qualityDefectNames) {
this.qualityDefectNames = qualityDefectNames;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}

@ -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>

Loading…
Cancel
Save