|
|
|
@ -48,16 +48,16 @@
|
|
|
|
|
|
|
|
|
|
<select id="qualityDefectsStatisticalAnalysisList" resultType="java.util.HashMap" parameterType="java.util.HashMap">
|
|
|
|
|
SELECT FY.FACTORY_NAME,
|
|
|
|
|
BPP.PRODUCT_LINE_NAME,
|
|
|
|
|
BP.PRODUCT_LINE_CODE,
|
|
|
|
|
BP.PRODUCT_LINE_NAME STATION_NAME,
|
|
|
|
|
COUNT(*) INSPECTION_NUMBER,
|
|
|
|
|
SUM(REWORK_NUMBER) REWORK_NUMBER,
|
|
|
|
|
ROUND((1 - SUM(REWORK_NUMBER) / COUNT(*)) * 100, 0) || '%' RATE
|
|
|
|
|
BPP.PRODUCT_LINE_NAME,
|
|
|
|
|
BP.PRODUCT_LINE_CODE STATION_CODE,
|
|
|
|
|
BP.PRODUCT_LINE_NAME STATION_NAME,
|
|
|
|
|
COUNT(*) INSPECTION_NUMBER,
|
|
|
|
|
SUM(REWORK_NUMBER) REWORK_NUMBER,
|
|
|
|
|
ROUND((1 - SUM(REWORK_NUMBER) / COUNT(*)) * 100, 0) || '%' RATE
|
|
|
|
|
FROM REPORT_QUALITY_INSPECTION RQI
|
|
|
|
|
LEFT JOIN BASE_PRODUCTLINE BP ON BP.PRODUCT_LINE_CODE = RQI.STATION_CODE
|
|
|
|
|
LEFT JOIN BASE_PRODUCTLINE BPP ON BPP.PRODUCT_LINE_CODE = BP.PARENT_ID
|
|
|
|
|
LEFT JOIN BASE_FACTORY FY ON FY.FACTORY_CODE = BPP.PLANT_CODE
|
|
|
|
|
LEFT JOIN BASE_PRODUCTLINE BP ON BP.PRODUCT_LINE_CODE = RQI.STATION_CODE
|
|
|
|
|
LEFT JOIN BASE_PRODUCTLINE BPP ON BPP.PRODUCT_LINE_CODE = BP.PARENT_ID
|
|
|
|
|
LEFT JOIN BASE_FACTORY FY ON FY.FACTORY_CODE = BPP.PLANT_CODE
|
|
|
|
|
<where>
|
|
|
|
|
<if test="PRODUCT_LINE_CODE != null and PRODUCT_LINE_CODE != ''">
|
|
|
|
|
AND BPP.PRODUCT_LINE_CODE = #{PRODUCT_LINE_CODE}
|
|
|
|
@ -70,11 +70,39 @@
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
GROUP BY FY.FACTORY_NAME, BPP.PRODUCT_LINE_NAME, BP.PRODUCT_LINE_CODE, BP.PRODUCT_LINE_NAME
|
|
|
|
|
ORDER BY PRODUCT_LINE_CODE
|
|
|
|
|
ORDER BY BP.PRODUCT_LINE_CODE
|
|
|
|
|
</select>
|
|
|
|
|
<select id="fewerMistakesReportList" resultType="java.util.HashMap" parameterType="java.util.HashMap">
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM VIEW_MATERIAL_COMPLETION
|
|
|
|
|
SELECT FY.FACTORY_NAME,
|
|
|
|
|
BPP.PRODUCT_LINE_NAME,
|
|
|
|
|
TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD') INSPECTOR_TIME,
|
|
|
|
|
RQI.STATION_CODE,
|
|
|
|
|
BP.PRODUCT_LINE_NAME STATION_NAME,
|
|
|
|
|
GET_MATERIAL_TYPE(RQI.MATERIAL_NAME) MATERIAL_MODEL,
|
|
|
|
|
RQI.QUALITY_DEFECT_CODE,
|
|
|
|
|
RQI.QUALITY_DEFECT_NAME,
|
|
|
|
|
COUNT(*) DEFECT_NUMBER
|
|
|
|
|
FROM REPORT_QUALITY_INSPECTION RQI
|
|
|
|
|
LEFT JOIN BASE_PRODUCTLINE BP ON BP.PRODUCT_LINE_CODE = RQI.STATION_CODE
|
|
|
|
|
LEFT JOIN BASE_PRODUCTLINE BPP ON BPP.PRODUCT_LINE_CODE = BP.PARENT_ID
|
|
|
|
|
LEFT JOIN BASE_FACTORY FY ON FY.FACTORY_CODE = BPP.PLANT_CODE
|
|
|
|
|
WHERE RQI.TREATMENT_MEASURE = 1
|
|
|
|
|
<if test="PRODUCT_LINE_CODE != null and PRODUCT_LINE_CODE != ''">
|
|
|
|
|
AND BPP.PRODUCT_LINE_CODE = #{PRODUCT_LINE_CODE}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="STATION_CODE != null and STATION_CODE != ''">
|
|
|
|
|
AND RQI.STATION_CODE = #{STATION_CODE}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="MATERIAL_MODEL != null and MATERIAL_MODEL != ''">
|
|
|
|
|
AND RQI.MATERIAL_NAME LIKE '%' || #{MATERIAL_MODEL} || '%'
|
|
|
|
|
</if>
|
|
|
|
|
<if test="beginBeginTime != null and beginBeginTime != '' and endBeginTime != null and endBeginTime != ''">
|
|
|
|
|
AND TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD') BETWEEN #{beginBeginTime} AND #{endBeginTime}
|
|
|
|
|
</if>
|
|
|
|
|
GROUP BY FY.FACTORY_NAME, BPP.PRODUCT_LINE_NAME, TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD'),
|
|
|
|
|
RQI.STATION_CODE, BP.PRODUCT_LINE_NAME, GET_MATERIAL_TYPE(RQI.MATERIAL_NAME),
|
|
|
|
|
RQI.QUALITY_DEFECT_CODE, RQI.QUALITY_DEFECT_NAME
|
|
|
|
|
ORDER BY INSPECTOR_TIME DESC
|
|
|
|
|
</select>
|
|
|
|
|
<select id="qualityIssuesReportList" resultType="java.util.HashMap" parameterType="java.util.HashMap">
|
|
|
|
|
SELECT *
|
|
|
|
@ -103,8 +131,20 @@
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="qualityDefectsDetailList" resultType="java.util.HashMap" parameterType="java.util.HashMap">
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM VIEW_PERFUSION_RECORD
|
|
|
|
|
SELECT ROWNUM SEQ, SD.QUALITY_DEFECT_NAME, SD.DEFECT_NUMBER, ROUND(DEFECT_NUMBER / ALL_DEFECT * 100, 0) || '%' RATE
|
|
|
|
|
FROM (
|
|
|
|
|
SELECT RQI.QUALITY_DEFECT_NAME,
|
|
|
|
|
COUNT(*) DEFECT_NUMBER,
|
|
|
|
|
SUM(COUNT(*)) OVER () ALL_DEFECT
|
|
|
|
|
FROM REPORT_QUALITY_INSPECTION RQI
|
|
|
|
|
WHERE RQI.TREATMENT_MEASURE = 1
|
|
|
|
|
<if test="stationCode != null and stationCode != ''">
|
|
|
|
|
AND RQI.STATION_CODE = #{stationCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="beginBeginTime != null and beginBeginTime != '' and endBeginTime != null and endBeginTime != ''">
|
|
|
|
|
AND TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD HH24:MI:SS') BETWEEN #{beginBeginTime} AND #{endBeginTime}
|
|
|
|
|
</if>
|
|
|
|
|
GROUP BY RQI.QUALITY_DEFECT_NAME) SD
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|