<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc = "对基础信息实绩操作">
	<query id = "ComBaseMetalType.query" desc = "查询基础信息">
	<![CDATA[
 SELECT 
       T.ITEM_CODE,
       T.ITEM_NAME,
       T.ARC_CODE,
       T.ARC_ITEM,
       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,
       T.DELETE_NAME,
       TO_CHAR(T.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       DECODE(T.VALIDFLAG,'1','有效','0','无效') VALIDFLAG,
       T.MEMO
 FROM COST_BASE_METAL_TYPE T
 WHERE 1=1
	]]>
	</query>
	<query id = "ComBaseMetalType.queryPliao" desc = "获取物料分类信息">
	<![CDATA[
SELECT T.BASECODE,T.BASENAME 
FROM PUR_BASE_INFO T 
WHERE T.SORTCODE ='1110'
	]]>
	</query>
	
	<query id = "ComBaseMetalType.queryNum" desc = "获取物料分类成本信息">
	<![CDATA[
	SELECT COUNT(*) 
  	FROM COST_BASE_METAL_TYPE
  	WHERE 1 = 1
	]]>
	</query>
	<query id = "ComBaseMetalType.isave" desc = "新增物料成本价格信息">
	<![CDATA[
  INSERT INTO COST_BASE_METAL_TYPE(
        ITEM_CODE,
        ITEM_NAME,
        ARC_CODE,
        ARC_ITEM,
        CREATE_NAME,
        CREATE_TIME,
        MEMO)
 VALUES( 
        '#ITEM_CODE#',
        '#ITEM_NAME#',
        '#ARC_CODE#',
        '#ARC_ITEM#',
        '#CREATE_NAME#',
        SYSDATE,
        '#MEMO#')
	]]>
	</query>
	<query id = "ComBaseMetalType.usave" desc = "修改物料成本价格信息">
	<![CDATA[
 UPDATE COST_BASE_METAL_TYPE T
   SET 
        T.ITEM_CODE = '#ITEM_CODE#',
        T.ITEM_NAME = '#ITEM_NAME#',
        T.ARC_CODE = '#ARC_CODE#',
        T.ARC_ITEM = '#ARC_ITEM#',
        T.UPDATE_NAME = '#UPDATE_NAME#',
        T.UPDATE_TIME = SYSDATE,
        T.MEMO = '#MEMO#'
 WHERE 1=1
	]]>
	</query>
	<query id = "ComBaseMetalType.delete" desc = "删除物料成本价格信息">
	<![CDATA[
UPDATE COST_BASE_METAL_TYPE T
   SET 
   		T.UPDATE_NAME = '#UPDATE_NAME#',
        T.UPDATE_TIME = SYSDATE,
        T.DELETE_NAME = '#DELETE_NAME#',
        T.DELETE_TIME = SYSDATE,
        T.VALIDFLAG = '0'
 WHERE T.ITEM_CODE = '#ITEM_CODE#'
	]]>
	</query>
	<query id = "ComBaseMetalType.resume" desc = "恢复物料成本价格信息">
	<![CDATA[
UPDATE COST_BASE_METAL_TYPE T
   SET 
   		T.UPDATE_NAME = '#UPDATE_NAME#',
        T.UPDATE_TIME = SYSDATE,
        T.DELETE_NAME = '',
        T.DELETE_TIME = '',
        T.VALIDFLAG = '1'
 WHERE T.ITEM_CODE = '#ITEM_CODE#'
	]]>
	</query>
</queryMap>