<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="查询外观检测质量原始记录">
	<query id="FrmMilQualityEvaluation.queryMinResult" desc="查询">
<![CDATA[
select T.JUDGE_STOVE_NO,
       T.LOT_NO,
       T.PLINE_CODE,
       (SELECT B.PLINE_NAME
          FROM COM_BASE_PLINE B
         WHERE B.PLINE_CODE = T.PLINE_CODE) PLINE_NAME,
       DECODE(T.COL_SHIFT, 1, '早班', 2, '中班', 3, '夜班', 0, '常白班') COL_SHIFT,
       DECODE(T.COL_GROUP, 1, '甲班', 2, '乙班', 3, '丙班', 4, '丁班') COL_GROUP,
       T.NON_ROUNDNESS,
       T.UNEVEN_DEGREE,
       T.LENGTH,
       T.WEIGHT,
       T.DIRECTOR_QUANTITY,
       T.OFFLINE_QUANTITY,
       T.WASTE_QUANTITY,
       T.QUALIFIED_BRANCH,
       T.QUALIFIED_TONS,
       T.HEAD_STRAIGHT,
       T.BODY_STRAIGHT,
       T.COL_USER,
       T.END_TIME
  from MIL_SURFACE_RESULT t
  WHERE 1=1

]]>
	</query>
	
	<query id="FrmMilQualityEvaluation.queryMinResultFeiPing" desc="查询">
<![CDATA[
select T.JUDGE_STOVE_NO,
       T.LOT_NO,
       T.PLINE_CODE,
       (SELECT B.PLINE_NAME
          FROM COM_BASE_PLINE B
         WHERE B.PLINE_CODE = T.PLINE_CODE) PLINE_NAME,
       DECODE(T.COL_SHIFT, 1, '早班', 2, '中班', 3, '夜班', 0, '常白班') COL_SHIFT,
       DECODE(T.COL_GROUP, 1, '甲班', 2, '乙班', 3, '丙班', 4, '丁班') COL_GROUP,
       T.NON_ROUNDNESS,
       T.UNEVEN_DEGREE,
       T.LENGTH,
       T.WEIGHT,
       T.DIRECTOR_QUANTITY,
       T.OFFLINE_QUANTITY,
       T.WASTE_QUANTITY,
       T.QUALIFIED_BRANCH,
       T.QUALIFIED_TONS,
       T.HEAD_STRAIGHT,
       T.BODY_STRAIGHT,
       T.COL_USER,
       T.END_TIME,
       T1.DEFECT_ITEM,
       T1.WASTE_BRANCH,
       T1.WASTE_TONS,
       T1.OFFLINE_PRODUCT
  from MIL_SURFACE_RESULT t,MIL_CHECK_DEATIL_SIMPLE  T1
  WHERE T.JUDGE_STOVE_NO = T1.JUDGE_STOVE_NO

]]>
	</query>

	<query id="FrmMilQualityEvaluation.getSurfaceRackSeq" desc="外观检测上料管号队列">
	 <![CDATA[
	  SELECT SIMPLE_LOT_NO,
       MAT_NO,
       LOT_NO,
       STOVE_NO,
       REGEXP_REPLACE(JUDGE_STOVE_NO, '-.*', '') JUDGE_STOVE_NO,
       STEELCODE,
       STEELNAME,
       GRADECODE,
       GRADENAME,
       PLINE_CODE,
       case STATUS
         when '0' then
          '正常轧制'
         when '1' then
          '剔除'
         when
         --'2' then '二检剔除' when
          '2' then
          '下线'
         when '4' then
          '最终下线'
       END AS STATUS,
       QA_FLAG,
       SCRAP_REASON,
       TO_CHAR(START_TIME, 'YYYY-MM-DD HH24:MI:SS') START_TIME,
       TO_CHAR(END_TIME, 'YYYY-MM-DD HH24:MI:SS') END_TIME,
       DECODE(OFFLINE_FLAG, '0', '未下线', '1', '下线') OFFLINE_FLAG,
       TO_CHAR(OFFLINE_TIME, 'YYYY-MM-DD HH24:MI:SS') OFFLINE_TIME,
       FOLLOW_FLAG,
       FOLLOW_HEAT_NO,
       TO_CHAR(FOLLOW_TIME, 'YYYY-MM-DD HH24:MI:SS') FOLLOW_TIME,
       GROUP_FLAG,
       BEFORE_HEAT_NO,
       BEFORE_MAT_NO,
       REMARK,
       COL_MODE,
       TO_CHAR(COL_TIME, 'YYYY-MM-DD HH24:MI:SS') COL_TIME,
       COL_USER,
       case COL_GROUP
         WHEN '1' THEN
          '甲'
         WHEN '2' THEN
          '乙'
         WHEN '3' THEN
          '丙'
         WHEN '4' THEN
          '丁'
       end as COL_GROUP,
       case COL_SHIFT
         WHEN '0' THEN
          '常白班'
         WHEN '1' THEN
          '早班'
         WHEN '2' THEN
          '中班'
         WHEN '3' THEN
          '晚班'
       end as COL_SHIFT,
       SEQ,
       TO_CHAR(QA_TIME, 'YYYY-MM-DD HH24:MI:SS') QA_TIME,
       CASE CHANGE_FLAG
         WHEN '0' THEN
          ''
         WHEN '1' THEN
          '确认交班'
         WHEN '2' THEN
          '待接班确认'
       END AS CHANGE_FLAG,
       '交班' CHANGE_GROUP,
       '接班' TAKE_OVER
  FROM MIL_QA_RACK
 WHERE REGEXP_REPLACE(JUDGE_STOVE_NO, '-.*', '') = ?
 order by SEQ ASC

	 ]]>
	</query>

	<query id="FrmMilQualityEvaluation.getDefectData" desc="查询缺陷项">
		SELECT
		T.JUDGE_STOVE_NO,
		T.DEFECT_ITEM,
		T.WASTE_BRANCH,
		T.WASTE_TONS,
		T.SIMPLE_LOT_NO,
		T.OFFLINE_PRODUCT
		FROM MIL_CHECK_DEATIL_SIMPLE T
		WHERE T.JUDGE_STOVE_NO = ?
	</query>

	<query id="FrmMilQualityEvaluation.SizeCheckQuery" desc="查询抽检管记录">
        <![CDATA[
            SELECT a.SAMPLE_PIPE_NO,
       a.D1,
       a.D2,
       a.S1,
       a.S2,
       a.S3,
       a.S4,
       decode(a.location, '0', '管端', '1', '管体') LOCATION1,
       a.SAMPLE_PIPE_SEQ
  FROM MIL_SIZE_CHECK_DEATIL a
 WHERE a.JUDGE_STOVE_NO = ?
        ]]>
	</query>
</queryMap>