<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="基价管理">

<query id="CorePriceFramePriceLine.queryById" desc="查询数据 ">
	<![CDATA[
 SELECT 
       T.PRICE_Line_ID,
       PRICE_HEAD_ID,
       T.FRAME_ID,
       T.WaiJing_Begin,
       T.WaiJing_End,
       T.BiHou_Begin,
       T.BiHou_End,
       T.Specificion,
       T.PRICE_UNIT,
       T.PRICE_NUM,
     DECODE(VALIDFLAG,'1','有效','0','无效') VALIDFLAG,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.UPDATE_NAME,
       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME
 FROM SLM_PRICE_BASEPRICE_LINE T
 WHERE T.PRICE_HEAD_ID = '#PRICE_HEAD_ID#'     AND T.VALIDFLAG IN ('1', '#VALIDFLAG#')

	]]>
	</query>
	<query id="CorePriceFramePriceLine.insert" desc="查询数据 ">
	<![CDATA[
  INSERT INTO SLM_PRICE_BASEPRICE_LINE(
        PRICE_Line_ID,
        PRICE_HEAD_ID,
        FRAME_ID,
        WaiJing_Begin,
        WaiJing_End,
        BiHou_Begin,
        BiHou_End,
        Specificion,
        PRICE_UNIT,
        PRICE_NUM,
    
        CREATE_NAME,
        CREATE_TIME
    )
 VALUES( 
         
                          (SELECT 'E' || LPAD(TO_NUMBER(NVL(SUBSTR(MAX(PRICE_LINE_ID), 2, 6), '0')) + 1, 6, '0') FROM SLM_PRICE_BASEPRICE_LINE A ),
        '#PRICE_HEAD_ID#',
        '#FRAME_ID#',
        '#WAIJING_BEGIN#',
        '#WAIJING_END#',
        '#BIHOU_BEGIN#',
        '#BIHOU_END#',
        '#SPECIFICION#',
        '#PRICE_UNIT#',
        '#PRICE_NUM#',
    
        '#CREATE_NAME#',
        SYSDATE)

	]]>
	</query>
	
	<query id="CorePriceFramePriceLine.update" desc="查询数据 ">
	<![CDATA[
 UPDATE SLM_PRICE_BASEPRICE_LINE T
   SET 
            T.PRICE_LINE_ID = '#PRICE_LINE_ID#',
        T.PRICE_HEAD_ID = '#PRICE_HEAD_ID#',
        T.FRAME_ID = '#FRAME_ID#',
        T.WAIJING_BEGIN = '#WAIJING_BEGIN#',
        T.WAIJING_END = '#WAIJING_END#',
        T.BIHOU_BEGIN = '#BIHOU_BEGIN#',
        T.BIHOU_END = '#BIHOU_END#',
        T.SPECIFICION = '#SPECIFICION#',
        T.PRICE_UNIT = '#PRICE_UNIT#',
        T.PRICE_NUM = '#PRICE_NUM#',
     
        T.UPDATE_NAME = '#UPDATE_NAME#',
        T.UPDATE_TIME = SYSDATE
 WHERE
T.PRICE_Line_ID = '#PRICE_LINE_ID#'
         AND T.VALIDFLAG = '1'

	]]>
	</query>
	
	<query id="CorePriceFramePriceLine.canResume" desc="查询订货规格">
	<![CDATA[

	        SELECT * FROM  SLM_PRICE_BASEPRICE_LINE  T 
	   WHERE  T.PRICE_Line_ID != '#PRICE_Line_ID#' 
	      AND T.VALIDFLAG = '1'
	     
	]]>
	</query>
	
	<query id="CorePriceFramePriceLine.Delete" desc="删除价格因素范围">
	<![CDATA[
	
	   UPDATE   SLM_PRICE_BASEPRICE_LINE  T 
	   SET T.VALIDFLAG = '0',
	       T.UPDATE_NAME = '#UPDATE_NAME#',
	       T.UPDATE_TIME = SYSDATE
	   WHERE  T.PRICE_Line_ID = '#PRICE_LINE_ID#'
	      AND T.VALIDFLAG = '1'
	     
	]]>
	</query>

	<query id="CorePriceFramePriceLine.Resume" desc="恢复价格因素范围">
	<![CDATA[
	
	   UPDATE  SLM_PRICE_BASEPRICE_LINE  T 
	   SET T.VALIDFLAG = '1',
	       T.UPDATE_NAME =  '#UPDATE_NAME#',
	       T.UPDATE_TIME = SYSDATE
	   WHERE  T.PRICE_Line_ID =  '#PRICE_LINE_ID#' 
	      AND T.VALIDFLAG = '0'
	     
	]]>
	</query>
	
<query id="CorePriceFramePriceLine.getSpecDesc" desc="查询其他类 的规格">
	<![CDATA[
	select a.order_spec_code,a.order_spec_desc from com_base_spec t inner join com_base_spec_order a on t.spec_code = a.spec_code
where t.msc_style='B' or t.msc_style='C'
	     
	]]>
	</query>
	
	
	
	
	
</queryMap>
