<?xml version="1.0" encoding="UTF-8"?>
<queryMap>
    <query id = "FrmProInformation.doQueryPro" desc = "查询监制信息">
        SELECT (SELECT T1.BASENAME
        FROM COM_BASE_INFO T1
        WHERE T1.BASECODE = T.PRDCR_DESC) PRDCR_DESC,
        S.PRDCR_NO,
        S.PROCESS_CODE,
        S.PROCESS_DESC,
        S.PROCESS_CODE_C,
        S.PROCESS_DESC_C,
        S.STATION_CODE,
        S.STATION_DESC,
        S.CRAFTITEM_CODE,
        S.CRAFTITEM_DESC,
        S.PRDCR_PRC_FL,
        (SELECT T2.BASENAME
        FROM COM_BASE_INFO T2
        WHERE T2.BASECODE = S.PRDCR_PRC_DESC) PRDCR_PRC_DESC,
        S.PRDCR_ADVC_DAY,
        S.PDEPT_NO,
        (SELECT PDEPT_NAME FROM SLM_BASE_PRDCR_DEPT WHERE PDEPT_NO = S.PDEPT_NO) PDEPT_NAME,
        S.PHONE,
        S.PDEPT_NO2,
        S.PDEPT_NAME2,
        S.PHONE2,
        S.PDEPT_NO3,
        S.PDEPT_NAME3,
        S.PHONE3,
        S.PRDCR_MAN,
        S.PRDCR_MAN_PHONE,
        S.ARRIVE_TIME,
        S.FINISH_TIME,
        S.PRDCR_MAN2,
        S.PRDCR_MAN_PHONE2,
        S.PRDCR_MAN3,
        S.PRDCR_MAN_PHONE3,
        DECODE(S.IS_NOTICE, 0, '否', '1', '是', '否') IS_NOTICE,
        S.PRDCR_INDEX
        FROM SLM_ORDER_LINE_PRDCR T, SLM_ORDER_LINE_PRDCR_LST S
        WHERE T.PRDCR_NO = S.PRDCR_NO
        AND T.PRDCR_INDEX = S.PRDCR_INDEX
        AND T.PRDCR_NO = ?
        AND T.MSC_PLINE = ?
        AND S.PROCESS_CODE = ?
        -- AND CODE_JG IS NULL
        -- AND CODE_BL IS NULL
        AND S.STATION_CODE NOT IN('60190','40230')
    </query>
    <query id = "FrmProInformation.doQueryProH" desc = "查询监制信息">
        SELECT (SELECT T1.BASENAME
        FROM COM_BASE_INFO T1
        WHERE T1.BASECODE = T.PRDCR_DESC) PRDCR_DESC,
        S.PRDCR_NO,
        S.PROCESS_CODE,
        S.PROCESS_DESC,
        S.PROCESS_CODE_C,
        S.PROCESS_DESC_C,
        S.STATION_CODE,
        S.STATION_DESC,
        S.CRAFTITEM_CODE,
        S.CRAFTITEM_DESC,
        S.PRDCR_PRC_FL,
        (SELECT T2.BASENAME
        FROM COM_BASE_INFO T2
        WHERE T2.BASECODE = S.PRDCR_PRC_DESC) PRDCR_PRC_DESC,
        S.PRDCR_ADVC_DAY,
        S.PDEPT_NO,
        S.PDEPT_NAME,
        S.PHONE,
        S.PDEPT_NO2,
        S.PDEPT_NAME2,
        S.PHONE2,
        S.PDEPT_NO3,
        S.PDEPT_NAME3,
        S.PHONE3,
        S.PRDCR_MAN,
        S.PRDCR_MAN_PHONE,
        S.ARRIVE_TIME,
        S.FINISH_TIME,
        S.PRDCR_MAN2,
        S.PRDCR_MAN_PHONE2,
        S.PRDCR_MAN3,
        S.PRDCR_MAN_PHONE3,
        DECODE(S.IS_NOTICE, 0, '否', '1', '是', '否') IS_NOTICE,
        S.PRDCR_INDEX
        FROM SLM_ORDER_LINE_PRDCR T, SLM_ORDER_LINE_PRDCR_LST S
        WHERE T.PRDCR_NO = S.PRDCR_NO
        AND T.PRDCR_INDEX = S.PRDCR_INDEX
        AND T.PRDCR_NO = ?
        AND S.PROCESS_CODE = ?
    </query>
    <query id = "FrmProInformation.doQueryProLg" desc = "查询炼钢监制">
        SELECT (SELECT T1.BASENAME
        FROM COM_BASE_INFO T1
        WHERE T1.BASECODE = T.PRDCR_DESC) PRDCR_DESC,
        S.PRDCR_NO,
        S.PROCESS_CODE,
        S.PROCESS_DESC,
        S.PROCESS_CODE_C,
        S.PROCESS_DESC_C,
        S.STATION_CODE,
        S.STATION_DESC,
        S.CRAFTITEM_CODE,
        S.CRAFTITEM_DESC,
        S.PRDCR_PRC_FL,
        (SELECT T2.BASENAME
        FROM COM_BASE_INFO T2
        WHERE T2.BASECODE = S.PRDCR_PRC_DESC) PRDCR_PRC_DESC,
        S.PRDCR_ADVC_DAY,
        S.PDEPT_NO,
        S.PDEPT_NAME,
        S.PHONE,
        S.PDEPT_NO2,
        S.PDEPT_NAME2,
        S.PHONE2,
        S.PDEPT_NO3,
        S.PDEPT_NAME3,
        S.PHONE3,
        S.PRDCR_MAN,
        S.PRDCR_MAN_PHONE,
        S.ARRIVE_TIME,
        S.FINISH_TIME,
        S.PRDCR_MAN2,
        S.PRDCR_MAN_PHONE2,
        S.PRDCR_MAN3,
        S.PRDCR_MAN_PHONE3,
        DECODE(S.IS_NOTICE, 0, '否', '1', '是', '否') IS_NOTICE,
        S.PRDCR_INDEX
        FROM SLM_ORDER_LINE_PRDCR T, SLM_ORDER_LINE_PRDCR_LST S
        WHERE T.PRDCR_NO = S.PRDCR_NO
        AND T.PRDCR_INDEX = S.PRDCR_INDEX
        AND T.PRDCR_NO = ?
        --AND T.MSC_PLINE = ?
        AND S.PROCESS_CODE IN('A','B')
        AND CODE_JG IS NULL
        AND CODE_BL IS NULL
    </query>
    <query id = "FrmProInformation.notice" desc = "修改监制标识">
        UPDATE SLM_ORDER_LINE_PRDCR_LST T SET T.IS_NOTICE = '1',T.NOTICE_TIME = SYSDATE
        WHERE T.PRDCR_NO = '#PRDCR_NO#'
        AND T.PRDCR_INDEX = '#PRDCR_INDEX#'
        AND T.STATION_CODE = '#STATION_CODE#'
    </query>
    <query id = "FrmProInformation.cancelNotice" desc = "修改监制标识">
        UPDATE SLM_ORDER_LINE_PRDCR_LST T SET T.IS_NOTICE = '0',T.NOTICE_TIME = ''
        WHERE T.PRDCR_NO = '#PRDCR_NO#'
        AND T.PRDCR_INDEX = '#PRDCR_INDEX#'
        AND T.STATION_CODE = '#STATION_CODE#'
    </query>
</queryMap>

