<?xml version="1.0" encoding="UTF-8"?>
<query desc="权限功能表查询">

    <query id="CrmOrderProduce.insertCrmOrderProduce" desc="新增">
        INSERT INTO CRM_ORDER_PRODUCE(
        ORD_LN_DLY_PK,
        CREATE_NAME,
        CREATE_TIME,
        APP_NUM,
        APP_UNIT,
        PSS_NUM,
        PSS_WGT,
        WGT_ESTMT,
        LG_NUM,
        LG_WGT,
        LG_TIME,
        D_PLINE_CODE,
        D_PLINE_NAME,
        PASS_CODE,
        PASS_NAME,
        PLAN_TIME_B,
        EXE_STATUS,
        GRADECODE,
        GRADENAME,
        DIAMETER_GP,
        ZG_NUM,
        ZG_WGT,
        PLAN_TIME_DBK,
        DBK_NUM,
        DBK_WGT,
        PLAN_TIME_RCL,
        RCL_NUM,
        RCL_WGT,
        PLAN_TIME_JGX,
        JGX_NUM,
        JGX_WGT,
        PRODUCT_NUM,
        PRODUCT_WGT,
        PRODUCT_LEN,
        DATA_STATUS)
        VALUES(
        '#ORD_LN_DLY_PK#',
        '#CREATE_NAME#',
        SYSDATE,
        '#APP_NUM#',
        '#APP_UNIT#',
        '#PSS_NUM#',
        '#PSS_WGT#',
        '#WGT_ESTMT#',
        '#LG_NUM#',
        '#LG_WGT#',
        '#LG_TIME#',
        '#D_PLINE_CODE#',
        '#D_PLINE_NAME#',
        '#PASS_CODE#',
        '#PASS_NAME#',
        TO_DATE(substr('#PLAN_TIME_B#', 0, 19),'YYYY-MM-DD HH24:mi:ss'),
        '#EXE_STATUS#',
        '#GRADECODE#',
        '#GRADENAME#',
        '#DIAMETER_GP#',
        '#ZG_NUM#',
        '#ZG_WGT#',
        TO_DATE(substr('#PLAN_TIME_DBK#', 0, 19),'YYYY-MM-DD HH24:mi:ss'),
        '#DBK_NUM#',
        '#DBK_WGT#',
        TO_DATE(substr('#PLAN_TIME_RCL#', 0, 19),'YYYY-MM-DD HH24:mi:ss'),
        '#RCL_NUM#',
        '#RCL_WGT#',
        TO_DATE(substr('#PLAN_TIME_JGX#', 0, 19),'YYYY-MM-DD HH24:mi:ss'),
        '#JGX_NUM#',
        '#JGX_WGT#',
        '#PRODUCT_NUM#',
        '#PRODUCT_WGT#',
        '#PRODUCT_LEN#',
        '#DATA_STATUS#')
    </query>

    <query id="CrmOrderProduce.queryProcessOrderM" desc="查询">
        SELECT
        T.ORD_LN_DLY_PK,
        T.DELVRY_QTY,
        T.ORDER_UNIT,
        T.ENSU_TOTL_LEN,
        T.APP_NUM,
        T.APP_UNIT,
        T.PSS_NUM,
        T.PSS_WGT,
        T.PAY_NUM,
        T.PAY_LEN,
        T.PAY_WGT,
        T.NEG_PAY_NUM,
        T.NEG_PAY_LEN,
        T.NEG_PAY_WGT,
        T.OUT_NUM,
        T.OUT_WGT,
        T.OUT_LEN,
        T.NEG_OUT_NUM,
        T.NEG_OUT_WGT,
        T.NEG_OUT_LEN,
        T.ELIM_NUM,
        T.ELIM_WGT,
        T.ELIM_LEN,
        T.CHARGE_NUM,
        T.CHARGE_WGT,
        T.CHARGE_LEN,
        T.SOK_WGT,
        T.INV_NUM,
        T.INV_WGT,
        T.INV_LEN,
        T.ONV_NUM,
        T.ONV_WGT,
        T.ONV_LEN,
        T.EVENT_ID,
        T.EVENT_DESC,
        T.FORM_NAME,
        T.CALL_FUNC_CODING,
        TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
        T.ACCOUNT_NUM,
        T.ACCOUNT_WGT,
        T.ACCOUNT_LEN,
        TO_CHAR(T.EFFECT_TIME, 'YYYY-MM-DD HH24:MI:SS') EFFECT_TIME,
        D.WGT_ESTMT
        FROM PROCESS_ORDER_M T,SLM_ORDER_LINE_DELIVERY D
        WHERE
        T.ORD_LN_DLY_PK = D.ORD_LN_DLY_PK
    </query>

    <query id="CrmOrderProduce.queryCrmOrderProduce" desc="查询">
        SELECT
        T.ORD_LN_DLY_PK,
        T.CREATE_NAME,
        TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
        T.APP_NUM,
        T.APP_UNIT,
        T.PSS_NUM,
        T.PSS_WGT,
        T.WGT_ESTMT,
        T.LG_NUM,
        T.LG_WGT,
        TO_CHAR(T.LG_TIME, 'YYYY-MM-DD HH24:MI:SS') LG_TIME,
        T.D_PLINE_CODE,
        T.D_PLINE_NAME,
        T.PASS_CODE,
        T.PASS_NAME,
        TO_CHAR(T.PLAN_TIME_B, 'YYYY-MM-DD HH24:MI:SS') PLAN_TIME_B,
        T.EXE_STATUS,
        T.GRADECODE,
        T.GRADENAME,
        T.DIAMETER_GP,
        T.ZG_NUM,
        T.ZG_WGT,
        TO_CHAR(T.PLAN_TIME_DBK, 'YYYY-MM-DD HH24:MI:SS') PLAN_TIME_DBK,
        T.DBK_NUM,
        T.DBK_WGT,
        TO_CHAR(T.PLAN_TIME_RCL, 'YYYY-MM-DD HH24:MI:SS') PLAN_TIME_RCL,
        T.RCL_NUM,
        T.RCL_WGT,
        TO_CHAR(T.PLAN_TIME_JGX, 'YYYY-MM-DD HH24:MI:SS') PLAN_TIME_JGX,
        T.JGX_NUM,
        T.JGX_WGT,
        T.PRODUCT_NUM,
        T.PRODUCT_WGT,
        T.PRODUCT_LEN,
        T.OUTS_BILLET_FL
        FROM CRM_ORDER_PRODUCE T
        WHERE
        T.ORD_LN_DLY_PK = ?
        ORDER BY T.CREATE_TIME DESC
    </query>
    <query id="CrmOrderProduce.getOrdLnDlyPkList" desc="查询">
        SELECT
        ORD_LN_DLY_PK
        FROM SLM_ORDER_LINE_DELIVERY T
        WHERE T.ORD_PK = ?
        AND T.VALIDFLAG = '1'
    </query>
</query>