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

master
yinq 6 months ago
parent 3aa5114c4c
commit c9903c34b3

@ -53,6 +53,12 @@ public class DetailElectricalinspection extends BaseEntity {
@Excel(name = "测试结果") @Excel(name = "测试结果")
private String testresult; 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") @Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date recordtime; private Date recordtime;
public String getQualityDefectName() {
return qualityDefectName;
}
public void setQualityDefectName(String qualityDefectName) {
this.qualityDefectName = qualityDefectName;
}
public void setUuid(String uuid) { public void setUuid(String uuid) {
this.uuid = uuid; this.uuid = uuid;
} }

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

@ -11,6 +11,8 @@
<result property="testTime" column="testtime"/> <result property="testTime" column="testtime"/>
<result property="testData" column="testdata"/> <result property="testData" column="testdata"/>
<result property="recordTime" column="recordtime"/> <result property="recordTime" column="recordtime"/>
<result property="materialModel" column="MATERIAL_MODEL"/>
<result property="qualityDefectNames" column="QUALITY_DEFECT_NAMES"/>
</resultMap> </resultMap>
<resultMap id="RecordElectricalInspectionDetailElectricalinspectionResult" type="RecordElectricalInspection" <resultMap id="RecordElectricalInspectionDetailElectricalinspectionResult" type="RecordElectricalInspection"
@ -27,28 +29,54 @@
<result property="testvalue" column="sub_testvalue"/> <result property="testvalue" column="sub_testvalue"/>
<result property="testresult" column="sub_testresult"/> <result property="testresult" column="sub_testresult"/>
<result property="recordtime" column="sub_recordtime"/> <result property="recordtime" column="sub_recordtime"/>
<result property="qualityDefectName" column="QUALITY_DEFECT_NAME"/>
</resultMap> </resultMap>
<sql id="selectRecordElectricalInspectionVo"> <sql id="selectRecordElectricalInspectionVo">
select uuid, result, barcode, testtime, testdata, recordtime SELECT ei.UUID,
from record_electricalinspection 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> </sql>
<select id="selectRecordElectricalInspectionList" parameterType="RecordElectricalInspection" <select id="selectRecordElectricalInspectionList" parameterType="RecordElectricalInspection"
resultMap="RecordElectricalInspectionResult"> resultMap="RecordElectricalInspectionResult">
<include refid="selectRecordElectricalInspectionVo"/> <include refid="selectRecordElectricalInspectionVo"/>
<where> <where>
<if test="uuid != null and uuid != ''">and uuid = #{uuid}</if> <if test="uuid != null and uuid != ''">and ei.uuid = #{uuid}</if>
<if test="result != null and result != ''">and result = #{result}</if> <if test="result != null and result != ''">and ei.result = #{result}</if>
<if test="barcode != null and barcode != ''">and barcode = #{barcode}</if> <if test="barcode != null and barcode != ''">and ei.barcode = #{barcode}</if>
<if test="testTime != null and testTime != ''">and testtime = #{testTime}</if> <if test="testTime != null and testTime != ''">and ei.testtime = #{testTime}</if>
<if test="testData != null and testData != ''">and testdata = #{testData}</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 != ''"> <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') to_date(#{params.endRecordTime}, 'yyyy-mm-dd hh24:mi:ss')
</if> </if>
</where> </where>
order by recordtime desc order by ei.recordtime desc
</select> </select>
<select id="selectRecordElectricalInspectionByUuid" parameterType="String" <select id="selectRecordElectricalInspectionByUuid" parameterType="String"
@ -65,10 +93,22 @@
b.testcondition as sub_testcondition, b.testcondition as sub_testcondition,
b.testvalue as sub_testvalue, b.testvalue as sub_testvalue,
b.testresult as sub_testresult, b.testresult as sub_testresult,
QI.QUALITY_DEFECT_NAME,
b.recordtime as sub_recordtime b.recordtime as sub_recordtime
from record_electricalinspection a from record_electricalinspection a
left join detail_electricalinspection b on b.uuid = a.testdata 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} where a.uuid = #{uuid}
ORDER BY sub_serialnumber
</select> </select>
<insert id="insertRecordElectricalInspection" parameterType="RecordElectricalInspection"> <insert id="insertRecordElectricalInspection" parameterType="RecordElectricalInspection">
@ -140,9 +180,10 @@
</insert> </insert>
<insert id="insertDetailElectricalinspection" parameterType="DetailElectricalinspection"> <insert id="insertDetailElectricalinspection" parameterType="DetailElectricalinspection">
INSERT INTO detail_electricalinspection( uuid, serialnumber, projectname, testcondition, testvalue, testresult, INSERT INTO detail_electricalinspection(uuid, serialnumber, projectname, testcondition, testvalue, testresult,
recordtime) values ( #{uuid}, #{serialnumber}, #{projectname}, #{testcondition}, recordtime)
#{testvalue}, #{testresult}, #{recordtime}) values (#{uuid}, #{serialnumber}, #{projectname}, #{testcondition},
#{testvalue}, #{testresult}, #{recordtime})
</insert> </insert>
</mapper> </mapper>
Loading…
Cancel
Save