<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="权限功能表查询">
	<query id="CoreTransitLine.BindCmbBuckle" desc="扣型数据源">
		<![CDATA[
			SELECT MODEL_CODE,MODEL_DESC FROM COM_BASE_MODEL ORDER BY MODEL_CODE
		]]>
	</query>

	<query id="CoreTransitLine.SlmBalnceMny" desc="查询合同资金要求">
		<![CDATA[
			SELECT BALNCE_MNY_NO,BALNCE_MNY_SEQ,PAYMENT_NODE,TERM,TERM_UNIT,PAYMENT_RATIO FROM SLM_ORDER_BALNCE_MNY where ORD_PK = ?
		]]>
	</query>

	<query id="CoreTransitLine.BindCmbSpec" desc="订货规格数据源">
		<![CDATA[
			SELECT SPEC_CODE,SPEC_NAME FROM COM_BASE_SPEC ORDER BY SPEC_CODE
		]]>
	</query> 

	<query id="CoreTransitLine.BindCmbSpecADD" desc="新增">
		<![CDATA[
			 INSERT INTO COM_BASE_SPEC_ORDER
							(ORDER_SPEC_CODE,
					        ORDER_SPEC_DESC,
					        SPEC_CODE,
					        SPEC_NAME,
					        CREATE_NAME,
					        CREATE_TIME,
					        VALIDFLAG,
					        MEMO)
							VALUES(
							(SELECT ? || 'DH' ||
							       LPAD((NVL((TO_NUMBER(SUBSTR(MAX(T.ORDER_SPEC_CODE), 10, 6)) + 1), 1)),
							             6,
							             '0') ORDER_SPEC_CODE
							  FROM com_base_spec_order T
							 WHERE T.SPEC_CODE = ?),
							?,?,?,
							?,SYSDATE,
							1,?) 
			  
		]]>
	</query>

	<query id="CoreTransitLine.BindCmbSpecUpdata" desc="修改">
		<![CDATA[
			 UPDATE COM_BASE_SPEC_ORDER set
							ORDER_SPEC_DESC=?, 
							UPDATE_NAME=?, 
							UPDATE_TIME=SYSDATE,
							MEMO=? 
							WHERE ORDER_SPEC_CODE=?
		]]>
	</query>

	<query id="CoreTransitLine.SPECQUERY" desc="查询规格描述">
		<![CDATA[
			SELECT   'FALSE' SPCHK, ORDER_SPEC_CODE, ORDER_SPEC_DESC, SPEC_CODE,
			         SPEC_NAME, CREATE_NAME,
			         TO_CHAR (CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
			         UPDATE_NAME,
			         TO_CHAR (UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
			         DELETE_NAME,
			         TO_CHAR (DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
			         VALIDFLAG, DECODE (VALIDFLAG, '1', '有效', '无效') VALIDFLAGNAME,
			         MEMO
			    FROM COM_BASE_SPEC_ORDER
			   WHERE SPEC_CODE = ? AND VALIDFLAG = '1'
			ORDER BY ORDER_SPEC_CODE
		]]>
	</query>
	
    <query id="CoreCtrlOrderLine.queryYdmZcBillM" desc="修改">
		<![CDATA[
		 SELECT COUNT(1),T.BILL_NO, T.ORDER_NO, T.ORDER_SEQ
		  FROM YDM_ZC_BILL_M T, SLM_ORDER_LINE T1
		 WHERE T.ORD_LN_PK = T1.ORD_LN_PK
		   AND T.VALIDFLAG = '1'
		   AND T1.VALIDFLAG = '1'
		   AND T.BILL_STATUS < '4'
		   AND T1.ORD_LN_PK= ?
		 GROUP BY T.BILL_NO, T.ORDER_NO, T.ORDER_SEQ
		]]>
	</query>
	
	<query id="CoreCtrlOrderLine.queryYdmSendPlan" desc="修改">
		<![CDATA[
		 SELECT COUNT(1),T.SEND_PLAN_NO, T.ORDER_NO, T.ORDER_SEQ
		  FROM YDM_ZC_SENDPLAN_C T, SLM_ORDER_LINE T1,YDM_ZC_SENDPLAN_M T2
		 WHERE T.ORD_LN_PK = T1.ORD_LN_PK
		 AND T.SEND_PLAN_NO=T2.SEND_PLAN_NO
		 AND T1.VALIDFLAG='1'
		 AND T.VALIDFLAG='1'
		 AND T2.VALIDFLAG='1'
		 AND T2.SEND_PLAN_STATUS!='3'
		 AND T1.ORD_LN_PK= ?
		 GROUP BY T.SEND_PLAN_NO, T.ORDER_NO, T.ORDER_SEQ
		]]>
	</query>

</queryMap>