diff --git a/aucma-report/src/main/java/com/aucma/report/domain/DetailElectricalinspection.java b/aucma-report/src/main/java/com/aucma/report/domain/DetailElectricalinspection.java index 25dbcc0..649e849 100644 --- a/aucma-report/src/main/java/com/aucma/report/domain/DetailElectricalinspection.java +++ b/aucma-report/src/main/java/com/aucma/report/domain/DetailElectricalinspection.java @@ -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; } diff --git a/aucma-report/src/main/java/com/aucma/report/domain/RecordElectricalInspection.java b/aucma-report/src/main/java/com/aucma/report/domain/RecordElectricalInspection.java index 88a4e65..7d6caf0 100644 --- a/aucma-report/src/main/java/com/aucma/report/domain/RecordElectricalInspection.java +++ b/aucma-report/src/main/java/com/aucma/report/domain/RecordElectricalInspection.java @@ -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 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; } diff --git a/aucma-report/src/main/resources/mapper/report/RecordElectricalInspectionMapper.xml b/aucma-report/src/main/resources/mapper/report/RecordElectricalInspectionMapper.xml index 7b4d8f8..1aa2738 100644 --- a/aucma-report/src/main/resources/mapper/report/RecordElectricalInspectionMapper.xml +++ b/aucma-report/src/main/resources/mapper/report/RecordElectricalInspectionMapper.xml @@ -11,6 +11,8 @@ + + + - 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