<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="基价框架配置管理">
	<query id="CorePriceBaseFrame.query" desc="查询数据 ">
	<![CDATA[
  SELECT 
       T.FRAME_ID,
       T.X_1_FACTOR_ID,
       T.X_2_FACTOR_ID,
       T.X_3_FACTOR_ID,
       T.X_4_FACTOR_ID,
       T.X_5_FACTOR_ID,
       T.X_6_FACTOR_ID,
       T.X_7_FACTOR_ID,
       T.X_8_FACTOR_ID,
       T.Y_1_FACTOR_ID,
       T.Y_2_FACTOR_ID,
      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_BASEFRAME_SET T
 WHERE  1=1
  AND VALIDFLAG IN ('1', ?)
 
	     
	]]>
	</query>
	<query id="CorePriceBaseFrame.queryRange" desc="查询数据 ">
	<![CDATA[
    SELECT 
       T.BR_ID,
       T.FRAME_ID,
       T.FACTORCLASSIFY_ID,
       T.FACTORCLASSIFY_NAME,
       T.FACTOR_VAL,
       T.FACTOR_MIN_SIGN,
       T.FACTOR_MIN_VAL,
       T.FACTOR_MAX_SIGN,
       T.FACTOR_MAX_VAL,
        DECODE(T.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_BASEFRAME_CLASSIFY T
 WHERE  T.FRAME_ID= ?
  AND VALIDFLAG IN ('1', ?)
 
	     
	]]>
	</query>
		<query id="CorePriceBaseFrame.queryFacName" desc="查询价格因素">
	<![CDATA[
	
	  SELECT T.FACTOR_NAME,T.FACTOR_ID FROM SLM_PRICE_FACTOR T
	  WHERE T.VALIDFLAG = '1'
	     
	]]>
	</query>
	
		<query id="CorePriceBaseFrame.queryRangeName" desc="查询价格因素范围">
	<![CDATA[
	select t.class_d_id,t.class_d_name FROM SLM_PRICE_FACTOR_CLASSIFY T
	where t.validflag=1 
	     
	]]>
	</query>
	<query id="CorePriceBaseFrame.insert" desc="查询订货规格">
	<![CDATA[
 INSERT INTO SLM_PRICE_BASEFRAME_SET(
        FRAME_ID,
        X_1_FACTOR_ID,
        X_2_FACTOR_ID,
        X_3_FACTOR_ID,
        X_4_FACTOR_ID,
        X_5_FACTOR_ID,
        X_6_FACTOR_ID,
        X_7_FACTOR_ID,
        X_8_FACTOR_ID,
        Y_1_FACTOR_ID,
        Y_2_FACTOR_ID,
     
        CREATE_NAME,
        CREATE_TIME
    )
 VALUES( 
        '#FRAME_ID#',
        '#X1_FACTOR_ID#',
        '#X2_FACTOR_ID#',
        '#X3_FACTOR_ID#',
        '#X4_FACTOR_ID#',
        '#X5_FACTOR_ID#',
        '#X6_FACTOR_ID#',
        '#X7_FACTOR_ID#',
        '#X8_FACTOR_ID#',
        '#Y1_FACTOR_ID#',
        '#Y2_FACTOR_ID#',
      
        '#CREATE_NAME#',
        SYSDATE
       )
	       
	]]>
	</query>
	<query id="CorePriceBaseFrame.insertRange" desc="查询订货规格">
	<![CDATA[
  INSERT INTO SLM_PRICE_BASEFRAME_CLASSIFY(
        BR_ID,
        FRAME_ID,
        FACTORCLASSIFY_ID,
        FACTORCLASSIFY_NAME,
        FACTOR_VAL,
        FACTOR_MIN_SIGN,
        FACTOR_MIN_VAL,
        FACTOR_MAX_SIGN,
        FACTOR_MAX_VAL,
      
        CREATE_NAME,
        CREATE_TIME)
 VALUES( 
        '#BR_ID#',
        '#FRAME_ID#',
        '#FACTORCLASSIFY_ID#',
        '#FACTORCLASSIFY_NAME#',
        '#FACTOR_VAL#',
        '#FACTOR_MIN_SIGN#',
        '#FACTOR_MIN_VAL#',
        '#FACTOR_MAX_SIGN#',
        '#FACTOR_MAX_VAL#',
       
        '#CREATE_NAME#',
        SYSDATE)
       
	       
	]]>
	</query>
	<query id="CorePriceBaseFrame.update" desc="更新基价框架">
	<![CDATA[
	 UPDATE SLM_PRICE_BASEFRAME_SET T
   SET 
        T.FRAME_ID = '#FRAME_ID#',
        T.X_1_FACTOR_ID = '#X1_FACTOR_ID#',
        T.X_2_FACTOR_ID = '#X2_FACTOR_ID#',
        T.X_3_FACTOR_ID = '#X3_FACTOR_ID#',
        T.X_4_FACTOR_ID = '#X4_FACTOR_ID#',
        T.X_5_FACTOR_ID = '#X5_FACTOR_ID#',
        T.X_6_FACTOR_ID = '#X6_FACTOR_ID#',
        T.X_7_FACTOR_ID = '#X7_FACTOR_ID#',
        T.X_8_FACTOR_ID = '#X8_FACTOR_ID#',
        T.Y_1_FACTOR_ID = '#Y1_FACTOR_ID#',
        T.Y_2_FACTOR_ID = '#Y2_FACTOR_ID#',
       
     
        T.UPDATE_NAME = '#UPDATE_NAME#',
        T.UPDATE_TIME = SYSDATE
 WHERE
T.FRAME_ID = '#FRAME_ID#'  AND T.VALIDFLAG = '1'
 
	]]>
	</query>
	<query id="CorePriceBaseFrame.canResume" desc="查询订货规格">
	<![CDATA[
	
	   SELECT * FROM  SLM_PRICE_BASEFRAME_SET  T 
	   WHERE  T.FRAME_ID != '#FRAME_ID#' 
	   
	      AND T.VALIDFLAG = '1'
	     
	]]>
	</query>
	<query id="CorePriceBaseFrame.Delete" desc="删除价格因素范围">
	<![CDATA[
	
	   UPDATE   SLM_PRICE_BASEFRAME_SET  T 
	   SET T.VALIDFLAG = '0',
	       T.UPDATE_NAME = '#UPDATE_NAME#',
	       T.UPDATE_TIME = SYSDATE
	   WHERE  T.FRAME_ID = '#FRAME_ID#' 
	      AND T.VALIDFLAG = '1'
	     
	]]>
	</query>

	<query id="CorePriceBaseFrame.Resume" desc="恢复价格因素范围">
	<![CDATA[
	
	   UPDATE  SLM_PRICE_BASEFRAME_SET  T 
	   SET T.VALIDFLAG = '1',
	       T.UPDATE_NAME =  '#UPDATE_NAME#',
	       T.UPDATE_TIME = SYSDATE
	   WHERE  T.FRAME_ID = '#FRAME_ID#' 
	      AND T.VALIDFLAG = '0'
	     
	]]>
	</query>
	</queryMap>
