<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="汽运提单编制">
<query id="CoreCasCarBill.queryPipeMat" desc="通过合同的主键查询库存信息">
        <![CDATA[    
SELECT T2.*
  FROM (SELECT T.JUDGE_STOVE_NO,
               T.BATCH_NO,
               T.GROUD_NO,
               T1.STORAGE_NO,
               (SELECT T4.STORAGE_NAME
                  FROM YDM_BS_STORAGE T4
                 WHERE T4.STORAGE_NO = T1.STORAGE_NO) STORAGE_NAME,
               T.PRODUCCODE,
               T.PRODUCNAME,
               T.JUDGE_GRADECODE,
               T.JUDGE_GRADENAME,
               T.JUDGE_STD_CODE,
               T.JUDGE_STD_NAME,
               T.ACT_FIX_NUM,
               T.ACT_FIX_LEN,
               T.SPEC_CODE,
               T.SPEC_NAME,
               T.ORD_PK,
               T.ORD_LN_PK,
               T.ORD_LN_DLY_PK,
               TO_CHAR(T.ACT_LEN_MIN, 'FM99990.00') AS ACT_LEN_MIN,
               TO_CHAR(T.ACT_LEN_MAX, 'FM99990.00') AS ACT_LEN_MAX,
               TO_CHAR(MAX(T.INSTOCK_TIME), 'YYYY-MM-DD HH24:MI:SS') INSTOCK_TIME,
               '0' SEND_NUM,
               SUM(CASE
                     WHEN T.MAT_STATUS = '80150301' THEN
                      NVL(T.ACT_COUNT, 0)
                     ELSE
                      0
                   END) ACT_COUNT,
               SUM(CASE
                     WHEN T.MAT_STATUS = '80150301' THEN
                      NVL(T.ACT_WEIGHT, 0)
                     ELSE
                      0
                   END) ACT_WEIGHT,
               SUM(CASE
                     WHEN T.MAT_STATUS = '80150301' THEN
                      NVL(T.ACT_LEN, 0)
                     ELSE
                      0
                   END) ACT_LEN,
               SUM(CASE
                     WHEN T.MAT_STATUS = '80150302' THEN
                      NVL(T.ACT_COUNT, 0)
                     ELSE
                      0
                   END) YB_COUNT,
               SUM(CASE
                     WHEN T.MAT_STATUS = '80150302' THEN
                      NVL(T.ACT_WEIGHT, 0)
                     ELSE
                      0
                   END) YB_WEIGHT,
               SUM(CASE
                     WHEN T.MAT_STATUS = '80150302' THEN
                      NVL(T.ACT_LEN, 0)
                     ELSE
                      0
                   END) YB_LEN,
               SUM(CASE
                     WHEN T.MAT_STATUS = '80150301' THEN
                      NVL(T.ACT_COUNT, 0)
                     WHEN T.MAT_STATUS = '80150302' THEN
                      NVL(T.ACT_COUNT, 0)
                     ELSE
                      0
                   END) KC_COUNT,
               SUM(CASE
                     WHEN T.MAT_STATUS = '80150301' THEN
                      NVL(T.ACT_WEIGHT, 0)
                     WHEN T.MAT_STATUS = '80150302' THEN
                      NVL(T.ACT_WEIGHT, 0)
                     ELSE
                      0
                   END) KC_WEIGHT,
               SUM(CASE
                     WHEN T.MAT_STATUS = '80150301' THEN
                      NVL(T.ACT_LEN, 0)
                     WHEN T.MAT_STATUS = '80150302' THEN
                      NVL(T.ACT_LEN, 0)
                     ELSE
                      0
                   END) KC_LEN
        
          FROM MAT_GP_M T, YDM_GP_BUTTRESS T1
         WHERE T.MAT_NO = T1.MAT_NO
           AND T.LOCK_FLAG = '0'
        AND T.ORD_LN_DLY_PK = ?
         GROUP BY T.JUDGE_STOVE_NO,
                  T.BATCH_NO,
                  T.GROUD_NO,
                  T1.STORAGE_NO,
                  T.PRODUCCODE,
                  T.PRODUCNAME,                  
                  T.SPEC_CODE,
                  T.SPEC_NAME,
                  T.ORD_PK,
                  T.ORD_LN_PK,
                  T.ORD_LN_DLY_PK,
                  T.ACT_LEN_MIN,
                  T.ACT_LEN_MAX,
                  T.JUDGE_GRADECODE,
                  T.JUDGE_GRADENAME,
                  T.JUDGE_STD_CODE,
                  T.JUDGE_STD_NAME,
                  T.ACT_FIX_NUM,
                  T.ACT_FIX_LEN
         ORDER BY T.JUDGE_STOVE_NO, T.BATCH_NO) T2
 WHERE T2.ACT_COUNT != '0'
          ]]>
	</query>
	
	<query id="CoreCasCarBill.getInventoryCanWgt" desc="查询挂提单资源量">
      <![CDATA[
           SELECT NVL(SUM(ACT_COUNT), 0) SUM_COUNT, NVL(SUM(ACT_WEIGHT), 0) SUM_WGT,NVL(SUM(ACT_LEN),0) SUM_LEN
  FROM (SELECT T.ACT_WEIGHT, T.ACT_COUNT,T.ACT_LEN
          FROM MAT_GP_M T, YDM_GP_BUTTRESS T1
         WHERE T.MAT_NO = T1.MAT_NO
           AND T.ORD_LN_DLY_PK = '#ORD_LN_DLY_PK#'
           AND T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
           AND NVL(T.BATCH_NO,'/') = NVL('#BATCH_NO#','/')
           AND T.GROUD_NO='#GROUD_NO#'
           AND T.MAT_STATUS = '80150301'
           --AND T1.LOCATION_NO = '#LOCATION_NO#'
           AND T1.STORAGE_NO = '#STORAGE_NO#'
           AND T.LOCK_FLAG='0'
         ORDER BY T.MAT_NO)
 WHERE ROWNUM < ?  
        ]]>
	</query>
	<query id="CoreCasCarBill.QueryMatInfo" desc="通过合同的主键查询库存信息（坯子）">
        <![CDATA[
       SELECT T2.*
  FROM (SELECT T.JUDGE_STOVE_NO,
               T.BATCH_NO,
               T.GROUD_NO,
               T1.STORAGE_NO,
               (SELECT T4.STORAGE_NAME
                  FROM YDM_BS_STORAGE T4
                 WHERE T4.STORAGE_NO = T1.STORAGE_NO) STORAGE_NAME,
               T.PRODUCCODE,
               T.PRODUCNAME,
               T.JUDGE_GRADECODE,
               T.JUDGE_GRADENAME,
               T.JUDGE_STD_CODE,
               T.JUDGE_STD_NAME,
               T.ACT_FIX_NUM,
               T.ACT_FIX_LEN,
               T.ACT_DIMATER || T.ACT_HEIGHT AS ACT_DIM_HEI,
               T.ORD_PK,
               T.ORD_LN_PK,
               T.ORD_LN_DLY_PK,
               TO_CHAR(T.ACT_LEN_MIN, 'FM99990.00') AS ACT_LEN_MIN,
               TO_CHAR(T.ACT_LEN_MAX, 'FM99990.00') AS ACT_LEN_MAX,
               TO_CHAR(MAX(T.INSTOCK_TIME), 'YYYY-MM-DD HH24:MI:SS') INSTOCK_TIME,
               '0' SEND_NUM,
               SUM(CASE
                     WHEN T.MAT_STATUS = '80150301' THEN
                      NVL(T.ACT_COUNT, 0)
                     ELSE
                      0
                   END) ACT_COUNT,
               SUM(CASE
                     WHEN T.MAT_STATUS = '80150301' THEN
                      NVL(T.ACT_WEIGHT, 0)
                     ELSE
                      0
                   END) ACT_WEIGHT,
               SUM(CASE
                     WHEN T.MAT_STATUS = '80150301' THEN
                      NVL(T.ACT_LEN, 0)
                     ELSE
                      0
                   END) ACT_LEN,
               SUM(CASE
                     WHEN T.MAT_STATUS = '80150302' THEN
                      NVL(T.ACT_COUNT, 0)
                     ELSE
                      0
                   END) YB_COUNT,
               SUM(CASE
                     WHEN T.MAT_STATUS = '80150302' THEN
                      NVL(T.ACT_WEIGHT, 0)
                     ELSE
                      0
                   END) YB_WEIGHT,
               SUM(CASE
                     WHEN T.MAT_STATUS = '80150302' THEN
                      NVL(T.ACT_LEN, 0)
                     ELSE
                      0
                   END) YB_LEN,
               SUM(CASE
                     WHEN T.MAT_STATUS = '80150301' THEN
                      NVL(T.ACT_COUNT, 0)
                     WHEN T.MAT_STATUS = '80150302' THEN
                      NVL(T.ACT_COUNT, 0)
                     ELSE
                      0
                   END) KC_COUNT,
               SUM(CASE
                     WHEN T.MAT_STATUS = '80150301' THEN
                      NVL(T.ACT_WEIGHT, 0)
                     WHEN T.MAT_STATUS = '80150302' THEN
                      NVL(T.ACT_WEIGHT, 0)
                     ELSE
                      0
                   END) KC_WEIGHT,
               SUM(CASE
                     WHEN T.MAT_STATUS = '80150301' THEN
                      NVL(T.ACT_LEN, 0)
                     WHEN T.MAT_STATUS = '80150302' THEN
                      NVL(T.ACT_LEN, 0)
                     ELSE
                      0
                   END) KC_LEN
        
          FROM MAT_GP_M T, YDM_GP_BUTTRESS T1
         WHERE T.MAT_NO = T1.MAT_NO
        AND T.ORD_LN_DLY_PK = ?
         GROUP BY T.JUDGE_STOVE_NO,
                  T.BATCH_NO,
                  T.GROUD_NO,
                  T1.STORAGE_NO,
                  T.PRODUCCODE,
                  T.PRODUCNAME,
                  T.JUDGE_GRADECODE,
                  T.JUDGE_GRADENAME,
                  T.JUDGE_STD_CODE,
                  T.JUDGE_STD_NAME,
                  T.ACT_FIX_NUM,
                  T.ACT_FIX_LEN,
                  T.ACT_DIMATER,
                  T.ACT_HEIGHT,
                  T.ORD_PK,
                  T.ORD_LN_PK,
                  T.ORD_LN_DLY_PK,
                  T.ACT_LEN_MIN,
                  T.ACT_LEN_MAX
         ORDER BY T.JUDGE_STOVE_NO, T.BATCH_NO) T2
 WHERE T2.ACT_COUNT != '0'
          ]]>
	</query>

	<query id="CoreCasCarBill.createBillNo" desc="生成提单号">
 <![CDATA[
SELECT 'TH' || ? || TO_CHAR(SYSDATE, 'YYMMDD') ||
       LPAD(TO_CHAR(NVL(SUBSTR(MAX(T.BILL_NO), 10), 0) + 1), 4, 0) BILL_NO
  FROM YDM_ZC_BILL_NO T
 WHERE INSTR(T.BILL_NO, ? || TO_CHAR(SYSDATE, 'YYMMDD')) > 0
 AND T.BILL_NO LIKE '#BILLNO#%'
 ]]>
	</query>

	<query id="CoreCasCarBill.checkBillStatus" desc="验证提单号">
        <![CDATA[
               SELECT DISTINCT T.BILL_STATUS,T.SEND_PLAN_NO,T.VSTEL_CODE
  FROM YDM_ZC_BILL_M T
 WHERE T.BILL_NO = ?
   AND T.VALIDFLAG = '1'
         ]]>
	</query>

	<query id="CoreCasCarBill.checkIsCommon" desc="验证提单修改或者新增">
        <![CDATA[
            SELECT COUNT(1) COUNT
  FROM YDM_ZC_BILL_M T
 WHERE T.BILL_NO = ?
   AND T.SEND_PLAN_NO = ?
   AND T.ORD_LN_DLY_PK = ?
   AND T.VALIDFLAG = '1'
          ]]>
	</query>

	<query id="CoreCasCarBill.checkIsPrtByJustNo" desc="验证是否分炉">
      <![CDATA[
          SELECT COUNT(1) COUNT
  FROM MAT_GP_M T
 WHERE T.JUDGE_STOVE_NO = ?
   AND NVL(T.BATCH_NO,'/') = NVL(?,'/') 
   AND T.GROUD_NO=?
        ]]>
	</query>

	<query id="CoreCasCarBill.GetBillNoSeq" desc="查询提单主表主键">
 <![CDATA[
 SELECT ? ||
            LPAD(NVL(TO_NUMBER(SUBSTR(MAX(BILL_NO_SEQ), 14, 4)), 0) + 1,
                 4,
                 0) BILL_NO_SEQ
       FROM YDM_ZC_BILL_M
      WHERE BILL_NO = ?
 ]]>
	</query>
	<query id="FrmPipeTrainBill.QueryBillNoSeq" desc="查询改提货单是否已存在对应的计划号下">
 <![CDATA[
SELECT T.SEND_DAYPLAN_NO FROM YDM_ZC_BILL_M T WHERE T.BILL_NO=? AND T.VALIDFLAG='1'
 ]]>
	</query>
	<query id="CoreCasCarBill.GetBillSeq" desc="查询提单材料表主键">
 <![CDATA[
 SELECT ? ||
            LPAD(NVL(TO_NUMBER(SUBSTR(MAX(BILL_SQE), LENGTH(MAX(BILL_SQE))-3)), 0) + 1,
                 4,
                 0) BILL_SQE
       FROM YDM_ZC_BILL_C
      WHERE MAT_NO = ?
 ]]>
	</query>
	<query id="CoreCasCarBill.GetBillM" desc="查询提单材料表主键">
 <![CDATA[
SELECT T.BILL_NO_SEQ
  FROM YDM_ZC_BILL_M T
 WHERE T.BILL_NO = ?
   AND T.ORDER_NO = ?
   AND T.ORDER_SEQ = ?
   AND T.DELIVERY_NO = ?
 ]]>
	</query>
	<query id="CoreCasCarBill.UpdateBillM" desc="修改库存材料表材料状态">
 <![CDATA[
UPDATE MAT_ZC_M SET MAT_STATUS = '80150302' WHERE MAT_NO = ? 
 ]]>
	</query>
	<query id="CoreCasCarBill.QueryBillMat" desc="查询提单材料表材料号">
 <![CDATA[
SELECT BILL_SQE,MAT_NO
  FROM YDM_ZC_BILL_C T
 WHERE T.BILL_NO = ?
   AND T.ORDER_NO = ?
   AND T.ORDER_SEQ = ?
   AND T.DELIVERY_NO = ?
   AND T.VALIDFLAG = '1'
 ]]>
	</query>
	<query id="CoreCasCarBill.DeleteBillM" desc="删除提单从表">
 <![CDATA[
 DELETE YDM_ZC_BILL_M
 WHERE BILL_NO = ?
 ]]>
	</query>
	<query id="CoreCasCarBill.DeleteBillC" desc="修改提单材料表有效标志">
 <![CDATA[
DELETE FROM YDM_ZC_BILL_C T
 WHERE T.BILL_NO = ?
   AND T.ORD_LN_PK = ?
   AND T.ORD_LN_DLY_PK = ?
 ]]>
	</query>
	<query id="CoreCasCarBill.DeleteMat" desc="修改库存材料表材料状态">
 <![CDATA[
   UPDATE MAT_GP_M
   SET MAT_STATUS = '80150301', UPDATE_NAME = ?, UPDATE_TIME = SYSDATE
 WHERE MAT_NO IN (SELECT T1.MAT_NO
                    FROM YDM_ZC_BILL_C T1
                   WHERE T1.BILL_NO = ?
                     AND T1.ORD_LN_DLY_PK = ?
                     AND T1.VALIDFLAG = '1')
 ]]>
	</query>

	<query id="CoreCasCarBill.getsendPlanInfoBySendPlanNo" desc="通过计划号查询计划信息">
        <![CDATA[
             SELECT SEND_PLAN_NO,
       SALE_ORG,
       SALE_ORG_DESC,
       CUSTOMER_NO,
       CUSTOMER_NM,
       RECEIV_NO,
       RECEIV_NM,
       TRANS_TYPE,
       ACT_TRANS_TYPE,
       STATION_NO,
       STATION_NM,
       SPCL_LN_NO,
       SPCL_LN_NM,
       PORT_NO,
       PORT_DESC,
       PLAN_YEAR_MONTH,
       TO_CHAR(PLAN_START_TIME,'YYYY-MM-DD HH24:MI:SS') PLAN_START_TIME,
       TO_CHAR(PLAN_END_TIME,'YYYY-MM-DD HH24:MI:SS') PLAN_END_TIME,
       TO_CHAR(PLAN_REL_TIME,'YYYY-MM-DD HH24:MI:SS') PLAN_REL_TIME,
       PLAN_WT,
       PLAN_NUM,
       PLAN_TOTL_LEN,
       ACT_START_TIME,
       ACT_END_TIME,
       ACT_WT,
       ACT_NUM,
       ACT_TOTL_LEN,
       SEND_PLAN_STATUS,
       MEMO,
       VALIDFLAG,
       CREATE_NAME,
       CREATE_TIME,
       UPDATE_NAME,
       UPDATE_TIME,
       DELETE_NAME,
       DELETE_TIME,
       DEPARTMENT_CODE,
       DEPARTMENT_DESC,
       MANAGEMENT_NO,
       MANAGEMENT_NAME
  FROM YDM_ZC_SENDPLAN_M T
 WHERE T.SEND_PLAN_NO = ?
   AND T.VALIDFLAG = '1'
          ]]>
	</query>

	<query id="CoreCasCarBill.getPlanCInfoByordLnPkAndSPNo" desc="根据计划号和合同行主键查询发运计划子信息">
        <![CDATA[
         SELECT SEND_PLAN_NO,
       ORDER_NO,
       ORDER_SEQ,
       DELIVERY_NO,
       MATERIAL_NO,
       MATERIAL_NAME,
       PRODUCCODE,
       PRODUCNAME,
       PRD_CLS,
       PSC,
       PSC_DESC,
       SPEC_CODE,
       SPEC_NAME,
       LEN_NO,
       LEN_DESC,
       PLAN_WT,
       PLAN_NUM,
       PLAN_TOTL_LEN,
       ACT_WT,
       ACT_NUM,
       ACT_TOTL_LEN,
       MEMO,
       VALIDFLAG,
       CREATE_NAME,
       CREATE_TIME,
       UPDATE_NAME,
       UPDATE_TIME,
       DELETE_NAME,
       DELETE_TIME,
       ORD_PK,
       ORD_LN_PK,
       ORD_LN_DLY_PK
  FROM YDM_ZC_SENDPLAN_C T
 WHERE T.SEND_PLAN_NO = ?
   AND T.ORD_LN_DLY_PK = ?
   AND T.VALIDFLAG = '1'
          ]]>
	</query>

	<query id="CoreCasCarBill.checkBillNoByBillNo" desc="验证提单号">
        <![CDATA[
             SELECT COUNT(1) COUNT
  FROM YDM_ZC_BILL_M T
 WHERE T.BILL_NO = ?
   AND T.VALIDFLAG = '1'
          ]]>
	</query>

	<query id="CoreCasCarBill.getMatMInfo80150301" desc="查询仓库可编制量">
        <![CDATA[
            SELECT T.MAT_NO,
       T.PRODUCT_FLAG,
       T.MAT_STATUS,
       T.LOT_NO,
       T.STOVE_NO,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.GROUD_NO,
       T.MATERIAL_NO,
       T.MATERIAL_NAME,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.STEELCODE,
       T.STEELNAME,
       T.GRADECODE,
       T.GRADENAME,
       T.SPEC_CODE,
       T.SPEC_NAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.STD_CODE,
       T.STD_NAME,
       T.STD_STYLE,
       T.STD_STYLE_DESC,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.ORDER_SEQ_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.ACT_DIMATER,
       T.ACT_HEIGHT,
       T.ACT_LEN,
       T.ACT_LEN_MIN,
       T.ACT_LEN_MAX,
       T.ACT_COUNT,
       T.ACT_WEIGHT,
       T.ACT_THEORY_WEIGHT,
       T.JUDGE_RESULT_CODE,
       T.PRO_BC,
       T.PRO_BZ,
       T.RPO_TIME,
       T.MEMO,
       T.CREATE_NAME,
       T.CREATE_TIME,
       T.ORD_PK,
       T.ORD_LN_PK,
       T.ORD_LN_DLY_PK
  FROM MAT_ZC_M T, YDM_ZC_BUTTRESS T1
 WHERE T.MAT_NO = T1.MAT_NO 
   AND T.ORD_LN_DLY_PK = ?
   AND T.JUDGE_STOVE_NO = ?
   AND NVL(T.BATCH_NO,'/') = NVL(?,'/')
   AND T.GROUD_NO=?
   AND T.MAT_STATUS = '80150301'
   AND T1.STORAGE_NO = ?
   ORDER BY MAT_NO
          ]]>
	</query>

	<query id="CoreCasCarBill.updateMatZcMByMatNo" desc="修改库存信息">
        <![CDATA[
            UPDATE MAT_GP_M T SET T.MAT_STATUS = '80150302' WHERE T.MAT_NO = ?
          ]]>
	</query>
	<query id="CoreCasCarBill.getMaxSeqByBillNo" desc="查询提单号最大序号">
        <![CDATA[
            SELECT NVL(TO_NUMBER(SUBSTR(MAX(T.BILL_NO_SEQ), 14)), 0) + 1 INDEX_SEQ
  FROM YDM_ZC_BILL_M T
 WHERE T.BILL_NO = ?
          ]]>
	</query>

	<query id="CoreCasCarBill.addBillMInfo" desc="新增提单主表信息">
        <![CDATA[
            INSERT INTO YDM_ZC_BILL_M
  (DEPARTMENT_DESC,
   MANAGEMENT_NO,
   MANAGEMENT_NAME,
   CUSTOMER_NM,
   RECEIV_NO,
   RECEIV_NM,
   STLMT_UNIT_NO,
   STLMT_UNIT_NM,
   CARRY_COMPANY_CODE,
   CARRY_COMPANY_NAME,
   PRD_CLS,
   PRODUCCODE,
   PRODUCNAME,
   STD_CODE,
   STD_NAME,
   STEELCODE,
   STEELNAME,
   PLAN_START_TIME,
   PLAN_END_TIME,
   ACT_START_TIME,
   ACT_END_TIME,
   PLAN_WT,
   PLAN_NUM,
   PLAN_TOTL_LEN,
   ACT_WT,
   ACT_NUM,
   ACT_TOTL_LEN,
   SPEC_CODE,
   SPEC_NAME,
   BILL_STATUS,
   MEMO,
   VALIDFLAG,
   CREATE_NAME,
   CREATE_TIME,
   UPDATE_NAME,
   UPDATE_TIME,
   DELETE_NAME,
   DELETE_TIME,
   DEPARTMENT_CODE,
   BILL_NO_SEQ,
   BILL_NO,
   ORDER_NO,
   ORDER_SEQ,
   DELIVERY_NO,
   SEND_PLAN_NO,
   VSTEL_CODE,
   VSTEL_DESC,
   PLAN_TRANS_TYPE,
   ACT_TRANS_TYPE,
   STATION_NO,
   STATION_NM,
   SPCL_LN_NO,
   SPCL_LN_NM,
   PORT_NO,
   PORT_DESC,
   DELIVY_PLACE_CODE,
   DELIVY_PLACE_NAME,
   SALE_ORG,
   SALE_ORG_DESC,
   CUSTOMER_NO,
   LOADVEHICLE_TYPE,
   FST_DRAWEE_UNIT,
   ORD_PK,
   ORD_LN_PK,
   ORD_LN_DLY_PK,
   AGENCY_FL,
   RECEIV_ADDR,
   DELVRY_ADDR,
   PICKUP_FLAG,CREDIT_NO,EXTRA_FLAG)
VALUES
  ('#DEPARTMENT_DESC#',
   '#MANAGEMENT_NO#',
   '#MANAGEMENT_NAME#',
   '#CUSTOMER_NM#',
   '#RECEIV_NO#',
   '#RECEIV_NM#',
   '#STLMT_UNIT_NO#',
   '#STLMT_UNIT_NM#',
   '#CARRY_COMPANY_CODE#',
   '#CARRY_COMPANY_NAME#',
   '#PRD_CLS#',
   '#PRODUCCODE#',
   '#PRODUCNAME#',
   '#STD_CODE#',
   '#STD_NAME#',
   '#STEELCODE#',
   '#STEELNAME#',
   TO_DATE('#PLAN_START_TIME#','YYYY/MM/DD HH24:MI:SS'),
   TO_DATE('#PLAN_END_TIME#','YYYY/MM/DD HH24:MI:SS'),
   TO_DATE('#ACT_START_TIME#','YYYY-MM-DD'),
   TO_DATE('#ACT_END_TIME#','YYYY-MM_DD'),
   '#PLAN_WT#',
   '#PLAN_NUM#',
   '#PLAN_TOTL_LEN#',
   '#ACT_WT#',
   '#ACT_NUM#',
   '#ACT_TOTL_LEN#',
   '#SPEC_CODE#',
   '#SPEC_NAME#',
   '#BILL_STATUS#',
   '#MEMO#',
   '#VALIDFLAG#',
   '#CREATE_NAME#',
   TO_DATE('#CREATE_TIME#','YYYY-MM-DD HH24:MI:SS'),
   NULL,
   NULL,
   NULL,
   NULL,
   '#DEPARTMENT_CODE#',
   '#BILL_NO_SEQ#',
   '#BILL_NO#',
   '#ORDER_NO#',
   '#ORDER_SEQ#',
   '#DELIVERY_NO#',
   '#SEND_PLAN_NO#',
   '#VSTEL_CODE#',
   '#VSTEL_DESC#',
   '#PLAN_TRANS_TYPE#',
   '#ACT_TRANS_TYPE#',
   '#STATION_NO#',
   '#STATION_NM#',
   '#SPCL_LN_NO#',
   '#SPCL_LN_NM#',
   '#PORT_NO#',
   '#PORT_DESC#',
   '#DELIVY_PLACE_CODE#',
   '#DELIVY_PLACE_NAME#',
   '#SALE_ORG#',
   '#SALE_ORG_DESC#',
   '#CUSTOMER_NO#',
   '#LOADVEHICLE_TYPE#',
   '#FST_DRAWEE_UNIT#',
   '#ORD_PK#',
   '#ORD_LN_PK#',
   '#ORD_LN_DLY_PK#',
   '#AGENCY_FL#',
   '#RECEIV_ADDR#',
   '#DELVRY_ADDR#',
   '#PICKUP_FLAG#','#CREDIT_NO#','#EXTRA_FLAG#')
          ]]>
	</query>
	<query id="CoreCasCarBill.getBillCMaxSeq" desc="查询提单从表最大序号">
        <![CDATA[
            SELECT NVL(TO_NUMBER(SUBSTR(MAX(T.BILL_SQE), LENGTH(MAX(T.BILL_SQE)) - 3)),
           0)  INDEX_SEQ
  FROM YDM_ZC_BILL_C T
 WHERE T.Mat_No=?
          ]]>
	</query>

	<query id="CoreCasCarBill.addBillCInfo" desc="新增提单从表信息">
        <![CDATA[
          INSERT INTO YDM_ZC_BILL_C (PRT_FLAG, ORD_PK, ORD_LN_PK, ORD_LN_DLY_PK, BILL_SQE, 
BILL_NO, ORDER_NO, ORDER_SEQ, MAT_NO, LOT_NO, JUDGE_STOVE_NO, BATCH_NO, 
GROUP_NO, STOVE_NO, MATERIAL_NO, MATERIAL_NAME, PRODUCCODE, PRODUCNAME, 
STD_CODE, STD_NAME, GRADECODE, GRADENAME, STEELCODE, STEELNAME, STD_STYLE, 
STD_STYLE_DESC, SPEC_CODE, SPEC_NAME, MODEL_CODE, MODEL_DESC, PLINE_CODE, 
PLINE_NAME, ACT_DIMATER, ACT_HEIGHT, ACT_LEN, ACT_LEN_MIN, ACT_LEN_MAX, 
ACT_COUNT, ACT_WEIGHT, ACT_THEORY_WEIGHT, JUDGE_RESULT_CODE, PRO_BC, PRO_BZ, 
RPO_TIME, STORAGE_NO, LOCATION_NO, CREATE_NAME, CREATE_TIME, DELIVERY_NO,VSTEL,VSTEL_DESC,SEND_NUM,ACT_FIX_NUM,ACT_FIX_LEN,BOUND_NUM) 
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?, ?, ?, ?, ?, ?, ?, ?,?, ?, ?, ?, ?, 
?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?, ?, ?, ?, ?, ?, ?, ?, ?, TO_DATE(?,'YYYY-MM-DD 
HH24:MI:SS'), (SELECT T.STORAGE_NO FROM YDM_GP_BUTTRESS T WHERE T.MAT_NO=?), 
(SELECT T.LOCATION_NO FROM YDM_GP_BUTTRESS T WHERE T.MAT_NO=?), ?, 
TO_DATE(?,'YYYY- MM-DD HH24:MI:SS'), ?,?,?,TO_NUMBER(?),TO_NUMBER(?),TO_NUMBER(?),TO_NUMBER(?))
          ]]>
	</query>

	<query id="CoreCasCarBill.checkIsPrtByJust" desc="查詢库存炉总量">
        <![CDATA[
            SELECT COUNT(1) COUNT
  FROM MAT_ZC_M T
 WHERE T.JUDGE_STOVE_NO = ?
   AND NVL(T.BATCH_NO,'/') = NVL(?,'/')
          ]]>
	</query>
	<query id="CoreCasCarBill.getBillStatusByBillNo" desc="查询提单状态">
        <![CDATA[
            select T.BILL_STATUS,T.LOADVEHICLE_TYPE from YDM_ZC_BILL_M t where T.BILL_NO=?
          ]]>
	</query>

	<query id="CoreCasCarBill.checkBillByBillNo" desc="验证提单">
        <![CDATA[
            SELECT COUNT(1) COUNT
  FROM YDM_ZC_BILL_M T
 WHERE T.BILL_NO = ?
   AND T.SEND_PLAN_NO = ?
   AND T.ORD_LN_DLY_PK = ?
   AND T.VALIDFLAG = '1'
          ]]>
	</query>


	<query id="CoreCasCarBill.updateBillByBillNo" desc="修改提单">
        <![CDATA[
            update YDM_ZC_BILL_M T
   SET T.PLAN_NUM = TO_NUMBER(T.PLAN_NUM) + TO_NUMBER(?),
       T.PLAN_WT  = TO_NUMBER(T.PLAN_WT) + TO_NUMBER(?),
       T.PLAN_TOTL_LEN  = TO_NUMBER(PLAN_TOTL_LEN) + TO_NUMBER(?)
 WHERE T.BILL_NO = ?
   AND T.SEND_PLAN_NO = ?
   AND T.ORD_LN_DLY_PK = ?
          ]]>
	</query>
	<query id="CoreCasCarBill.getBillInfoByBillNo" desc="查询提单信息">
       <![CDATA[
 SELECT T.BILL_STATUS,
       T.LOADVEHICLE_TYPE,
       T.ISPRECLOSE,
       CASE
         WHEN T.BILL_TICKET_STATUS = 0 AND T.OUTSTOCK_TICKET_STATUS = 0 AND
              T.TRANSMNY_TICKET_STATUS = 0 THEN
          0
         WHEN T.BILL_TICKET_STATUS = 2 AND T.OUTSTOCK_TICKET_STATUS = 2 AND
              T.TRANSMNY_TICKET_STATUS = 2 THEN
          2
         ELSE
          1
       END BILL_TICKET_STATUS
  FROM YDM_ZC_BILL_M T
 WHERE T.BILL_NO = ?
   AND T.VALIDFLAG = '1'
        ]]>
	</query>
	<query id="CoreCasCarBill.getBillInfoByBillNoSeq" desc="根据提单序号查询提单信息">
        <![CDATA[
            SELECT BILL_NO_SEQ,
       BILL_NO,
       ORDER_NO,
       ORDER_SEQ,
       DELIVERY_NO,
       SEND_PLAN_NO,
       VSTEL_CODE,
       VSTEL_DESC,
       PLAN_TRANS_TYPE,
       ACT_TRANS_TYPE,
       STATION_NO,
       STATION_NM,
       SPCL_LN_NO,
       SPCL_LN_NM,
       PORT_NO,
       PORT_DESC,
       DELIVY_PLACE_CODE,
       DELIVY_PLACE_NAME,
       SALE_ORG,
       SALE_ORG_DESC,
       CUSTOMER_NO,
       CUSTOMER_NM,
       RECEIV_NO,
       RECEIV_NM,
       STLMT_UNIT_NO,
       STLMT_UNIT_NM,
       CARRY_COMPANY_CODE,
       CARRY_COMPANY_NAME,
       PRD_CLS,
       PRODUCCODE,
       PRODUCNAME,
       STD_CODE,
       STD_NAME,
       STEELCODE,
       STEELNAME,
       PLAN_START_TIME,
       PLAN_END_TIME,
       ACT_START_TIME,
       ACT_END_TIME,
       PLAN_WT,
       PLAN_NUM,
       PLAN_TOTL_LEN,
       ACT_WT,
       ACT_NUM,
       ACT_TOTL_LEN,
       SPEC_CODE,
       SPEC_NAME,
       BILL_STATUS,
       MEMO,
       VALIDFLAG,
       CREATE_NAME,
       CREATE_TIME,
       UPDATE_NAME,
       UPDATE_TIME,
       DELETE_NAME,
       DELETE_TIME,
       LOADVEHICLE_TYPE,
       FST_DRAWEE_UNIT,
       ORD_PK,
       ORD_LN_PK,
       ORD_LN_DLY_PK,
       AGENCY_FL,
       RECEIV_ADDR,
       DELVRY_ADDR,
       PICKUP_FLAG,
       DEPARTMENT_CODE,
       DEPARTMENT_DESC,
       MANAGEMENT_NO,
       MANAGEMENT_NAME
  FROM YDM_ZC_BILL_M T
 WHERE T.BILL_NO = ?
   AND T.VALIDFLAG = '1'
          ]]>
	</query>

	<query id="CoreCasCarBill.getOrdNoInfoByOrdLnPk" desc="查询合同物料信息">
        <![CDATA[
     SELECT T3.PRODUCCODE,
       T3.PRODUCNAME,
       T3.STD_CODE,
       T3.STD_NAME,
       T3.STEELCODE,
       T3.STEELNAME,
       T3.STD_STYLE,
       T3.STD_STYLE_DESC,
       T3.SPEC_CODE,
       T3.SPEC_NAME,
       T3.DIMATER,
       T3.HEIGHT,
       T3.MODEL_CODE,
       T3.MODEL_DESC,
       T3.LEN_NO,
       T3.LEN_DESC,
       T3.LEN_UNIT,
       T3.LEN_MIN,
       T3.LEN_MAX,
       T2.STLMT_UNIT_NO,
       T2.STLMT_UNIT_NM,
       T1.AGENCY_FL,
       T1.PICKUP_FLAG,
       T2.FST_DRAWEE_UNIT,
       T1.RECEIV_ADDR,
       T1.DELVRY_ADDR,
       T1.EXTRA_FLAG
  FROM SLM_ORDER_LINE_DELIVERY T1, SLM_ORDER_HEAD T2, SLM_ORDER_LINE T3
 WHERE T1.ORD_PK = T2.ORD_PK
   AND T1.ORD_LN_PK = T3.ORD_LN_PK
   AND T1.ORD_LN_DLY_PK =?
   AND T1.VALIDFLAG = '1'
   AND T2.VALIDFLAG = '1'
   AND T3.VALIDFLAG = '1'
          ]]>
	</query>

	<query id="CoreCasCarBill.checkMatWeight" desc="验证数据">
	<![CDATA[
         SELECT NVL(SUM(P.ACT_WEIGHT),0),NVL(SUM(P.ACT_COUNT),0),NVL(SUM(P.ACT_LEN),0)
  FROM (SELECT NVL(T1.ACT_WEIGHT,0) AS ACT_WEIGHT,NVL(T1.ACT_COUNT,0) AS ACT_COUNT,NVL(T1.ACT_LEN,0) AS ACT_LEN, ROWNUM
          FROM MAT_GP_M T1, YDM_GP_BUTTRESS T2
         WHERE T1.MAT_NO = T2.MAT_NO
           AND T1.ORD_LN_DLY_PK = '#ORD_LN_DLY_PK#'
           AND T2.STORAGE_NO = '#STORAGE_NO#'
           AND T1.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
           AND NVL(T1.BATCH_NO,'/') = NVL('#BATCH_NO#','/')
           AND T1.GROUD_NO='#GROUD_NO#'
           AND T1.MAT_STATUS = '80150301'
           AND T1.LOCK_FLAG='0'
         ORDER BY T1.MAT_NO) P
 WHERE ROWNUM < ?
		]]>
	</query>

	<query id="CoreCasCarBill.getInventoryCanInfo" desc="查询库存可编制资源信息">
      <![CDATA[
     SELECT *
  FROM (SELECT T.MAT_NO,
               T.LOT_NO,
               T.STOVE_NO,
               T.JUDGE_STOVE_NO,
               T.BATCH_NO,
               T.GROUD_NO,
               T.MATERIAL_NO,
               T.MATERIAL_NAME,
               T.PRODUCCODE,
               T.PRODUCNAME,
               T.JUDGE_GRADECODE,
               T.JUDGE_GRADENAME,
               T.JUDGE_STD_CODE,
               T.JUDGE_STD_NAME,
               T.SPEC_CODE,
               T.SPEC_NAME,
               T.ORDER_NO,
               T.ORDER_SEQ,
               T.ORDER_SEQ_NO,
               T.PLINE_CODE,
               T.PLINE_NAME,
               T.ACT_DIMATER,
               T.ACT_HEIGHT,
               T.ACT_LEN,
               T.ACT_LEN_MIN,
               T.ACT_LEN_MAX,
               T.ACT_COUNT,
               T.ACT_WEIGHT,
               T.ACT_THEORY_WEIGHT,
               T.JUDGE_RESULT_CODE,
               T.PRO_BC,
               T.PRO_BZ,
               T.RPO_TIME,
               T.ORD_PK,
               T.ORD_LN_PK,
               T.ORD_LN_DLY_PK,
               T.ACT_FIX_NUM,
               T.ACT_FIX_LEN
          FROM MAT_GP_M T, YDM_GP_BUTTRESS T1
 WHERE T.MAT_NO = T1.MAT_NO
   AND T.ORD_LN_DLY_PK='#ORD_LN_DLY_PK#'
   AND T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
   AND NVL(T.BATCH_NO,'/') = NVL('#BATCH_NO#','/')
   AND T.GROUD_NO='#GROUD_NO#'
   AND T.MAT_STATUS = '80150301'
   AND T1.STORAGE_NO = '#STORAGE_NO#'
 ORDER BY T.MAT_NO  ) 
 WHERE ROWNUM<?     
        ]]>
	</query>


	<query id="CoreCasCarBill.getBillMMaxSeq" desc="查询提单主表最大序号">
      <![CDATA[
          SELECT NVL(TO_NUMBER(SUBSTR(MAX(T.BILL_NO_SEQ),
                            Length(MAX(T.BILL_NO_SEQ)) - 3)),
           0) + 1 INDEX_SEQ
  FROM YDM_ZC_BILL_M T
 WHERE T.BILL_NO = ?
        ]]>
	</query>
	<query id="CoreCasCarBill.deleteBillCByOrdPkAndJust" desc="合同撤销">
       <![CDATA[
          DELETE FROM YDM_ZC_BILL_C T
 WHERE T.Bill_No = ?
   AND T.ORD_LN_DLY_PK = ?
   AND T.JUDGE_STOVE_NO = ?
   AND NVL(T.BATCH_NO,'/') = NVL(?,'/')
   AND T.GROUP_NO=?
        ]]>
	</query>


	<query id="CoreCasCarBill.deleteMatByOrdPkAndJust" desc="合同撤销">
       <![CDATA[
          UPDATE MAT_GP_M
   SET MAT_STATUS = '80150301', UPDATE_NAME = ?, UPDATE_TIME = SYSDATE
 WHERE MAT_NO IN (SELECT T1.MAT_NO
                    FROM YDM_ZC_BILL_C T1
                   WHERE T1.BILL_NO = ?
                     AND T1.ORD_LN_DLY_PK = ?
                     AND T1.JUDGE_STOVE_NO = ?
                     AND NVL(T1.BATCH_NO,'/') = NVL(?,'/')
                     AND T1.GROUP_NO=?
                     AND T1.VALIDFLAG = '1')
        ]]>
	</query>

	<query id="CoreCasCarBill.queryBillMByOrdPkAndJust" desc="合同撤销查询提单主表量">
       <![CDATA[
        SELECT SUM(NVL(T.PLAN_NUM, 0)) PLAN_NUM, SUM(NVL(T.PLAN_WT, 0)) PLAN_WT,
        SUM(NVL(T.PLAN_TOTL_LEN,0)) PLAN_TOTL_LEN ,T.SEND_PLAN_NO
  FROM YDM_ZC_BILL_M T
 WHERE T.BILL_NO = ?
   AND T.ORD_LN_DLY_PK = ?
   GROUP BY T.SEND_PLAN_NO
        ]]>
	</query>

	<query id="CoreCasCarBill.queryBillCByOrdPkAndJust" desc="合同撤销查询提单从表总量">
       <![CDATA[
        SELECT SUM(NVL(T.ACT_COUNT, 0)) ACT_COUNT,
       SUM(NVL(T.ACT_WEIGHT, 0)) ACT_WEIGHT,
       SUM(NVL(T.ACT_LEN,0)) ACT_LEN
  FROM YDM_ZC_BILL_C T
 WHERE T.BILL_NO = ?
   AND T.ORD_LN_DLY_PK = ?
   AND T.JUDGE_STOVE_NO = ?
   AND NVL(T.BATCH_NO,'/') = NVL(?,'/')
   AND T.GROUP_NO=?
        ]]>
	</query>

	<query id="CoreCasCarBill.updateBillMByOrdPkAndJust" desc="合同撤销修改量">
       <![CDATA[
     UPDATE YDM_ZC_BILL_M T
   SET T.PLAN_WT = ?, T.PLAN_NUM = ?,T.PLAN_TOTL_LEN=?, T.UPDATE_TIME = SYSDATE
 WHERE T.Bill_No = ?
   AND T.ORD_LN_DLY_PK = ?
        ]]>
	</query>

	<query id="CoreCasCarBill.deleteBillMByOrdPkAndJust" desc="合同撤销">
       <![CDATA[
          DELETE FROM YDM_ZC_BILL_M T
 WHERE T.Bill_No = ?
   AND T.ORD_LN_DLY_PK = ?
        ]]>
	</query>
	<query id="CoreCasCarBill.updateSendM" desc="反写计划主表计划量">
       <![CDATA[
 UPDATE YDM_ZC_SENDPLAN_M
   SET ACT_WT      = TO_NUMBER(NVL(ACT_WT, 0)) + TO_NUMBER(?),
       UPDATE_NAME = ?,
       UPDATE_TIME = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')
 WHERE SEND_PLAN_NO = ?
        ]]>
	</query>
	<query id="CoreCasCarBill.updateSendC" desc="反写计划从表计划量">
       <![CDATA[
 UPDATE YDM_ZC_SENDPLAN_C
   SET ACT_WT = TO_NUMBER(NVL(ACT_WT, 0)) + TO_NUMBER(?), 
   UPDATE_NAME = ?, 
   UPDATE_TIME = TO_DATE(?,'YYYY-MM-DD HH24:MI:SS') 
   WHERE SEND_PLAN_NO = ?
    AND ORD_LN_DLY_PK = ?
        ]]>
	</query>
	<query id="CoreCasCarBill.DeleteSendM" desc="修改反写计划主表计划量">
       <![CDATA[
 UPDATE YDM_ZC_SENDPLAN_M
   SET ACT_WT      = TO_NUMBER(NVL(ACT_WT, 0)) - TO_NUMBER(?)
       --UPDATE_NAME = ?,
       --UPDATE_TIME = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')
 WHERE SEND_PLAN_NO = ?
        ]]>
	</query>
	<query id="CoreCasCarBill.DeleteSendC" desc="修改反写计划从表计划量">
       <![CDATA[
 UPDATE YDM_ZC_SENDPLAN_C
   SET ACT_WT = TO_NUMBER(NVL(ACT_WT, 0)) - TO_NUMBER(?)
   --UPDATE_NAME = ?, 
   --UPDATE_TIME = TO_DATE(?,'YYYY-MM-DD HH24:MI:SS') 
   WHERE SEND_PLAN_NO = ?
    AND ORD_LN_DLY_PK = ?
        ]]>
	</query>

	<query id="CoreCasCarBill.queryOrderLinDer" desc="交货行交货地点">
       <![CDATA[
 SELECT T.DELVRY_ADDR FROM SLM_ORDER_LINE_DELIVERY T WHERE T.ORD_LN_DLY_PK = ?  AND T.VALIDFLAG='1'
        ]]>
	</query>
	<query id="CoreCasCarBill.queryOrdLnDlyPkWT" desc="交货行交货量">
       <![CDATA[
 SELECT T.WGT_ESTMT, L.DELVRY_RANGE_MAX
  FROM SLM_ORDER_LINE_DELIVERY T, SLM_ORDER_LINE L
 WHERE T.ORD_PK = L.ORD_PK(+)
   AND T.ORD_LN_PK = L.ORD_LN_PK(+)
   AND T.ORD_LN_DLY_PK = ?
   AND T.VALIDFLAG = '1'
   AND l.VALIDFLAG = '1'

        ]]>
	</query>
	<query id="CoreCasCarBill.queryBillWeight" desc="该合同提单量">
       <![CDATA[
       SELECT NVL(SUM(T.ACT_WEIGHT),0) AS ACT_WEIGHT FROM YDM_ZC_BILL_C T WHERE T.ORD_LN_DLY_PK=? AND T.VALIDFLAG='1'
        ]]>
	</query>
	<query id="CoreCasCarBill.QUERYBILLMATNO" desc="查询提单从表材料号">
       <![CDATA[
       SELECT T.MAT_NO FROM YDM_ZC_BILL_C T WHERE T.BILL_NO=?
        AND T.JUDGE_STOVE_NO=?
        AND NVL(T.BATCH_NO,'/') = NVL(?,'/')
        AND T.GROUP_NO=?
        ORDER BY T.MAT_NO
        ]]>
	</query>
	<query id="CoreCasCarBill.UpdateBillCStoragety" desc="修改提单从表出库地点（铁运）">
       <![CDATA[
      UPDATE YDM_ZC_BILL_C T SET T.STORAGE_NO=? , T.LOCATION_NO=?
       WHERE T.BILL_NO=? AND T.MAT_NO=?
        ]]>
	</query>
	<query id="CoreCasCarBill.UpdateBillCStorage" desc="修改提单从表出库地点">
       <![CDATA[
      UPDATE YDM_ZC_BILL_C T SET T.STORAGE_NO=? , T.LOCATION_NO=?,T.VSTEL=?,
       T.VSTEL_DESC=?
       WHERE T.BILL_NO=? AND T.MAT_NO=?
        ]]>
	</query>
	<query id="CoreCasCarBill.Updatebuttress" desc="修改位置表出库地点">
       <![CDATA[
      UPDATE YDM_GP_BUTTRESS T SET T.STORAGE_NO=? ,T.LOCATION_NO=? WHERE T.MAT_NO=?
        ]]>
	</query>
	<query id="CoreCasCarBill.queryBillMatNoC" desc="查询是否生成提单">
       <![CDATA[
       SELECT T.MAT_NO,T.BILL_NO FROM YDM_ZC_BILL_C T WHERE T.MAT_NO=? AND T.VALIDFLAG='1'
      ]]>
	</query>
	<query id="CoreCasCarBill.DeleteBillNo" desc="删除提单号">
       <![CDATA[
       DELETE YDM_ZC_BILL_NO  WHERE BILL_NO = ?
      ]]>
	</query>
	<query id="CoreCasCarBill.InsertDeryL" desc="新增到提单运输表">
       <![CDATA[
      INSERT INTO YDM_ORDER_DELIVERY_TRANSIT
  (ORD_PK,
   ORD_LN_PK,
   ORD_LN_DLY_PK,
   INDEX_SEQ,
   AGENCY_FL,
   TRANSIT_TYP,
   DESTINATION,
   STATION_NO,
   STATION_NM,
   SPCL_LN_NO,
   SPCL_LN_NM,
   PORT_NO,
   PORT_DESC,
   CARRIER_UNIT,
   RECEIVOR,
   TRANSIT_LN_MNY,
   VALIDFLAG,
   CREATE_NAME,
   CREATE_TIME,
   BILL_NO)
  SELECT T.ORD_PK,
         T.ORD_LN_PK,
         T.ORD_LN_DLY_PK,
         T.INDEX_SEQ,
         T.AGENCY_FL,
         T.TRANSIT_TYP,
         T.DESTINATION,
         T.STATION_NO,
         T.STATION_NM,
         T.SPCL_LN_NO,
         T.SPCL_LN_NM,
         T.PORT_NO,
         T.PORT_DESC,
         T.CARRIER_UNIT,
         T.RECEIVOR,
         T.TRANSIT_LN_MNY,
         T.VALIDFLAG,
         ?,
         TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
         ?
    FROM SLM_ORDER_DELIVERY_TRANSIT T
   WHERE T.ORD_LN_DLY_PK = ? AND T.VALIDFLAG='1'
      
      ]]>
	</query>
	<query id="CoreCasCarBill.queryDeryL" desc="查询提单运输方式">
       <![CDATA[ 
       SELECT T.ORD_LN_DLY_PK FROM YDM_ORDER_DELIVERY_TRANSIT T WHERE T.ORD_LN_DLY_PK=? AND T.BILL_NO=?
         ]]>
	</query>
	<query id="CoreCasCarBill.DeleteTRANSIT" desc="删除提单运输方式">
       <![CDATA[ 
    DELETE YDM_ORDER_DELIVERY_TRANSIT T WHERE T.BILL_NO=? AND T.ORD_LN_DLY_PK=? 
         ]]>
	</query>
	<query id="CoreCasCarBill.DeleteTRANSIT1" desc="删除提单运输方式">
       <![CDATA[ 
    DELETE YDM_ORDER_DELIVERY_TRANSIT T WHERE T.BILL_NO=?
         ]]>
	</query>
		<query id="CoreCasCarBill.queryLockMatNo" desc="查询材料封锁状态">
       <![CDATA[
SELECT T.LOCK_FLAG FROM MAT_GP_M T WHERE T.MAT_NO = ?
        ]]>
	</query>
</queryMap>