<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="权限功能表查询">

	

	<query id="CoreMaterialAdministration.GetPhyMax" desc="根据小类获取大类别">
		<![CDATA[
			select T.phy_type_m ,B.PHY_TYPE
			from COM_BASE_PHY_C T ,COM_BASE_PHY_B B
			 where T.phy_code=?
			 AND T.PHY_TYPE_M = B.phy_code
			 AND B.VALIDFLAG = '1'
		]]>
	</query>

	<query id="CoreMaterialAdministration.GetMaxItem_R" desc="获取关联表最大id。">
		<![CDATA[
			select max(Item_CODE) from COM_BASE_PHY_R_ITEM
		]]>
	</query>


	<query id="CoreMaterialAdministration.GetITEM_F" desc="根据材质项目代码获取多个温度、尺寸、方向">
		<![CDATA[
			select 
			'FALSE' CHK,
			T.PHY_TYPE_C,
			T.PHY_TYPE,
			T.ITEM_CODE_F,
			T.ITEM_CODE_F ITEM_CODE_F2,
			T.ITEM_CODE_C,
			T.ITEM_CODE_C ITEM_CODE_C2,
			T.ITEM_CODE_W,
			T.ITEM_CODE_W ITEM_CODE_W2,
			T.PHY_CODE,
			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,
			T.VALIDFLAG,
			decode(T.VALIDFLAG,'1','有效','无效') VALIDFLAGNAME,
			T.MEMO
			from COM_BASE_PHY_R_ITEM T
			where T.PHY_TYPE_C=?
			ORDER BY ITEM_CODE_F
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.GetPhyRPos" desc="查询检验项与温度和位置的关系">
		<![CDATA[
select 'FALSE' CHK,
       T.ITEM_CODE_W,
       T.ITEM_CODE_W ITEM_CODE_W2,
       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,
       T.VALIDFLAG,
       decode(T.VALIDFLAG, '1', '有效', '无效') VALIDFLAGNAME,
       T.MEMO
  from COM_BASE_PHY_R_POS T
 where T.PHY_CODE = {0}
 ORDER BY ITEM_CODE_W
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.InsertPos" desc="保存检验项关系">
		<![CDATA[
INSERT INTO COM_BASE_PHY_R_POS
  (PHY_CODE, ITEM_CODE_W, CREATE_NAME, CREATE_TIME)
VALUES
  ({0}, {1}, {2}, SYSDATE)
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.UpdatePos" desc="保存检验项关系">
		<![CDATA[
UPDATE COM_BASE_PHY_R_POS
   SET PHY_CODE    = {0},
       ITEM_CODE_W = {1},
       UPDATE_NAME = {2},
       UPDATE_TIME = SYSDATE
 WHERE PHY_CODE = {0}
 AND ITEM_CODE_W = {3}
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.DeletePos" desc="保存检验项关系">
		<![CDATA[
UPDATE COM_BASE_PHY_R_POS T
   SET T.VALIDFLAG = '0', T.DELETE_NAME = {0}, T.DELETE_TIME = SYSDATE
 WHERE T.PHY_CODE = {1}
   AND NVL(T.ITEM_CODE_P, '1') = NVL({2}, '1')
   AND NVL(T.ITEM_CODE_W, '1') = NVL({3}, '1')
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.ResumePos" desc="保存检验项关系">
		<![CDATA[
UPDATE COM_BASE_PHY_R_POS T
   SET T.VALIDFLAG = '1', T.DELETE_NAME = NULL, T.DELETE_TIME = NULL
 WHERE T.PHY_CODE = {1}
   AND NVL(T.ITEM_CODE_P, '1') = NVL({2}, '1')
   AND NVL(T.ITEM_CODE_W, '1') = NVL({3}, '1')
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.GetITEM_FADD" desc="温度、尺寸、方向新增">
		<![CDATA[
			INSERT INTO COM_BASE_PHY_R_ITEM
							(
							PHY_TYPE,
							PHY_TYPE_C,
						    ITEM_CODE_F,
						    ITEM_CODE_C,
					        CREATE_NAME,
					        CREATE_TIME,
					        VALIDFLAG,
					        MEMO)
							VALUES(?,?,?,
							?,?,SYSDATE,
							'1',?)
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.GetITEM_FUPDATE" desc="温度、尺寸、方向修改">
		<![CDATA[
UPDATE COM_BASE_PHY_R_ITEM
   SET ITEM_CODE_F = '#ITEM_CODE_F2#',
       ITEM_CODE_C = '#ITEM_CODE_C2#',
       UPDATE_NAME = '#UPDATE_NAME#',
       UPDATE_TIME = SYSDATE,
       MEMO        = '#MEMO#'
 WHERE PHY_TYPE_C = '#PHY_TYPE_C#'
   AND #ITEM_CODE_F_CONDITION#
   AND #ITEM_CODE_C_CONDITION#
		]]>
	</query>
	

	<query id="CoreMaterialAdministration.PHYQUERY" desc="权限功能">
		<![CDATA[
			SELECT  T.PHY_CODE,
				    T.PHY_TYPE,
					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,
					T.VALIDFLAG,
					decode(T.VALIDFLAG,'1','有效','无效') VALIDFLAGNAME,
					T.MEMO,
					T.SAMPLE_COUNT,
					T.PHY_DEPTID,
					T.PHY_DEPTNAME
				FROM COM_BASE_PHY_B T
				   WHERE T.VALIDFLAG in ('1' , ?)
				   AND lower(T.PHY_TYPE)||'&' LIKE '%' || lower(?) || '%'
				ORDER BY T.PHY_CODE ASC
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.PHYADD" desc="新增">
		<![CDATA[
			 INSERT INTO COM_BASE_PHY_B
							(PHY_CODE,
					        PHY_TYPE,
					        CREATE_NAME,
					        CREATE_TIME,
					        VALIDFLAG,
					        MEMO,
					        SAMPLE_COUNT,
					        PHY_DEPTID,
					        PHY_DEPTNAME)
							VALUES(?,?,
							?,TO_DATE(?, 'yyyy-mm-dd hh24:mi:ss'),
							?,?, ?,?,?)
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.PHYMODIFY" desc="修改">
		<![CDATA[
			 UPDATE COM_BASE_PHY_B set
							PHY_TYPE=?, 
							UPDATE_NAME=?, 
							UPDATE_TIME=TO_DATE(?, 'yyyy-mm-dd hh24:mi:ss'),
							MEMO=?,
							SAMPLE_COUNT = ?,
							PHY_DEPTID   = ?,
					        PHY_DEPTNAME = ?
							WHERE PHY_CODE=?
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.PHYDELETE" desc="作废">
		<![CDATA[
			 UPDATE COM_BASE_PHY_B T
			   SET T.DELETE_NAME = ?, T.DELETE_TIME = SYSDATE, T.VALIDFLAG = '0'
			 WHERE T.PHY_CODE = ?
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.PHYRESUME" desc="恢复">
		<![CDATA[
			UPDATE COM_BASE_PHY_B T
               SET T.DELETE_NAME = '', T.DELETE_TIME = '', T.VALIDFLAG = '1'
             WHERE T.PHY_CODE = ?
		]]>
	</query>
	
	
	
	
	<query id="CoreMaterialAdministration.PHYCQUERY" desc="材质小类查询">
		<![CDATA[
SELECT T.PHY_CODE,
       T.PHY_TYPE,
       T.PHY_TYPE_M,
       A.PHY_TYPE PHY_TYPE_NAME_M,
       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,
       T.VALIDFLAG,
       decode(T.VALIDFLAG, '1', '有效', '无效') VALIDFLAGNAME,
       T.MEMO,
       T.PHY_DEPTID,
       T.PHY_DEPTNAME,
       T.ORDER_SEQ,
       T.SPLINE_COUNT
  FROM COM_BASE_PHY_C T
  LEFT JOIN COM_BASE_PHY_B A
    ON T.PHY_TYPE_M = A.PHY_CODE
 WHERE T.VALIDFLAG in ('1', ?)
   AND lower(T.PHY_TYPE) || '&' LIKE '%' || lower(?) || '%'
 ORDER BY T.PHY_CODE ASC
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.PHYCADD" desc="新增">
		<![CDATA[
INSERT INTO COM_BASE_PHY_C
  (PHY_CODE,
   PHY_TYPE,
   PHY_TYPE_M,
   CREATE_NAME,
   CREATE_TIME,
   VALIDFLAG,
   MEMO,
   PHY_DEPTID,
   PHY_DEPTNAME,
   ORDER_SEQ,
   SPLINE_COUNT)
VALUES
  (?, ?, ?, ?, TO_DATE(?, 'yyyy-mm-dd hh24:mi:ss'), ?, ?, ?, ?, ?, ?)  
		]]>
	</query>
	<query id="CoreMaterialAdministration.PHYCMODIFY" desc="修改">
		<![CDATA[
UPDATE COM_BASE_PHY_C
   SET PHY_TYPE     = ?,
       PHY_TYPE_M   = ?,
       UPDATE_NAME  = ?,
       UPDATE_TIME  = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS'),
       MEMO         = ?,
       PHY_DEPTID   = ?,
       PHY_DEPTNAME = ?,
       ORDER_SEQ = ?,
       SPLINE_COUNT = ?
 WHERE PHY_CODE = ?
		]]>
	</query>
	<query id="CoreMaterialAdministration.PHYCDELETE" desc="作废">
		<![CDATA[
			 UPDATE COM_BASE_PHY_C T
			   SET T.DELETE_NAME = ?, T.DELETE_TIME = SYSDATE, T.VALIDFLAG = '0'
			 WHERE T.PHY_CODE = ?
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.PHYCRESUME" desc="恢复">
		<![CDATA[
			UPDATE COM_BASE_PHY_C T
               SET T.DELETE_NAME = '', T.DELETE_TIME = '', T.VALIDFLAG = '1'
             WHERE T.PHY_CODE = ?
		]]>
	</query>
	
	
	<query id="CoreMaterialAdministration.PHYPROJECTQUERY" desc="权限功能">
		<![CDATA[
SELECT T.PHY_CODE,
       T.PHY_NAME,
       T.PHY_TYPE,
       (SELECT A.PHY_TYPE
          FROM COM_BASE_PHY_B A
         WHERE A.PHY_CODE = B.PHY_TYPE_M) PHY_TYPE_NAME,
       T.PHY_TYPE_C,
       B.PHY_TYPE PHY_TYPE_NAME_C,
       T.PHY_UNIT,
       T.HOUR_READY,
       T.HOUR_TEST,
       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,
       T.VALIDFLAG,
       DECODE(T.VALIDFLAG, '1', '有效', '无效') VALIDFLAGNAME,
       T.MEMO,
       (SELECT REPLACE(WM_CONCAT(STATION_CODE), ',', ';')
          FROM COM_BASE_PHY_R_STATION
         WHERE PHY_CODE = T.PHY_CODE) STATION_CODE,
       (SELECT REPLACE(WM_CONCAT(STATION_DESC), ',', ';')
          FROM COM_BASE_PHY_R_STATION
         WHERE PHY_CODE = T.PHY_CODE) STATION_DESC,
         T.ORDER_SEQ
  FROM COM_BASE_PHY T
  LEFT JOIN COM_BASE_PHY_C B
    ON T.PHY_TYPE_C = B.PHY_CODE
 WHERE T.VALIDFLAG IN ('1', ?)
   AND LOWER(T.PHY_NAME) || '&' LIKE '%' || LOWER(?) || '%'
 ORDER BY PHY_CODE
		]]>
	</query>
	<query id="CoreMaterialAdministration.PHYPROJECTADD" desc="新增">
		<![CDATA[
			 INSERT INTO COM_BASE_PHY
							(PHY_CODE,
					        PHY_NAME,
					        PHY_TYPE,
							PHY_TYPE_C,
					        PHY_UNIT,
					        HOUR_READY,
					        HOUR_TEST,
					        CREATE_NAME,
					        CREATE_TIME,
					        VALIDFLAG,
					        MEMO,
					        ORDER_SEQ)
							VALUES(?,?,?,?,?,?,?,
							?,TO_DATE(?, 'yyyy-mm-dd hh24:mi:ss'),
							?,?, ?)
							
			  
		]]>
	</query>
	<query id="CoreMaterialAdministration.delBasePhyRStation" desc="删除检验项和工序点关系表">
		<![CDATA[
DELETE FROM COM_BASE_PHY_R_STATION T WHERE T.PHY_CODE = ?
		]]>
	</query>
	<query id="CoreMaterialAdministration.insertBasePhyRStation" desc="新增检验项和工序点关系表">
		<![CDATA[
 INSERT INTO COM_BASE_PHY_R_STATION
   (PHY_CODE,
    PHY_NAME,
    STATION_CODE,
    STATION_DESC,
    CREATE_NAME,
    CREATE_TIME)
 VALUES
   (?, ?, ?, ?, ?, SYSDATE)  
		]]>
	</query>
	<query id="CoreMaterialAdministration.PHYPROJECTMODIFY" desc="修改">
		<![CDATA[
			 UPDATE COM_BASE_PHY set
							PHY_NAME=?, 
							PHY_TYPE=?, 
							PHY_TYPE_C=?, 
							PHY_UNIT=?,
							HOUR_READY=?,
							HOUR_TEST=?,
							UPDATE_NAME=?, 
							UPDATE_TIME=TO_DATE(?, 'yyyy-mm-dd hh24:mi:ss'),
							MEMO=?,
							ORDER_SEQ = ?
							WHERE PHY_CODE=?
		]]>
	</query>
	<query id="CoreMaterialAdministration.PHYPROJECTDELETE" desc="作废">
		<![CDATA[
			 UPDATE COM_BASE_PHY T
			   SET T.DELETE_NAME = ?, T.DELETE_TIME = SYSDATE, T.VALIDFLAG = '0'
			 WHERE T.PHY_CODE = ?
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.PHYPROJECTRESUME" desc="恢复">
		<![CDATA[
			UPDATE COM_BASE_PHY T
               SET T.DELETE_NAME = '', T.DELETE_TIME = '', T.VALIDFLAG = '1'
             WHERE T.PHY_CODE = ?
		]]>
	</query>
	

	<query id="CoreMaterialAdministration.ITEMQUERY" desc="权限功能">
		<![CDATA[
			SELECT  ITEM_CODE,
				    ITEM_NAME,
				    ITEM_STYLE,
				    DECODE(ITEM_STYLE, 'A', '试验方向', 'B', '试验温度', 'C', '试样尺寸', 'D', '试验位置', '未定义') ITEM_STYLENAME,			
					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,
					ORDER_SEQ
				FROM COM_BASE_PHY_ITEM
				   WHERE VALIDFLAG in ('1' , ?)
				   AND lower(ITEM_NAME)||'&' LIKE '%' || lower(?) || '%'
				   ORDER BY ITEM_CODE
		]]>
	</query>
	<query id="CoreMaterialAdministration.ITEMADD" desc="新增">
		<![CDATA[
			 INSERT INTO COM_BASE_PHY_ITEM
							(ITEM_CODE,
					        ITEM_NAME,
					        ITEM_STYLE,
					        CREATE_NAME,
					        CREATE_TIME,
					        VALIDFLAG,
					        MEMO,
					        ORDER_SEQ)
							VALUES(?,?,?,
							?,TO_DATE(?, 'yyyy-mm-dd hh24:mi:ss'),
							?,?, ?)
							
			  
		]]>
	</query>
	<query id="CoreMaterialAdministration.ITEMMODIFY" desc="修改">
		<![CDATA[
			 UPDATE COM_BASE_PHY_ITEM set
			 				ITEM_CODE =?,
							ITEM_NAME=?, 
							ITEM_STYLE=?, 
							UPDATE_NAME=?, 
							UPDATE_TIME=TO_DATE(?, 'yyyy-mm-dd hh24:mi:ss'),
							MEMO=?,
							ORDER_SEQ = ?
							WHERE ITEM_CODE=?
		]]>
	</query>
	<query id="CoreMaterialAdministration.ITEMDELETE" desc="作废">
		<![CDATA[
			 UPDATE COM_BASE_PHY_ITEM T
			   SET T.DELETE_NAME = ?, T.DELETE_TIME = SYSDATE, T.VALIDFLAG = '0'
			 WHERE T.ITEM_CODE = ?
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.ITEMRESUME" desc="恢复">
		<![CDATA[
			UPDATE COM_BASE_PHY_ITEM T
               SET T.DELETE_NAME = '', T.DELETE_TIME = '', T.VALIDFLAG = '1'
             WHERE T.ITEM_CODE = ?
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.getComBaseStd" desc="检验标准号">
		<![CDATA[
			SELECT STD_CODE,STD_NAME FROM COM_BASE_STD T WHERE T.STDSTYLE ='S'
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.getMaxItem_Code" desc="获取最大的材质项目补充代码">
		<![CDATA[
			SELECT MAX(T.ITEM_CODE) FROM COM_BASE_PHY_ITEM T
				WHERE T.ITEM_CODE LIKE ? || '%'
		]]>
	</query>
	
	
	<query id="CoreMaterialAdministration.getMaxPhyCode" desc="获取最大的材质项目基础代码">
		<![CDATA[
			SELECT MAX(PHY_CODE) FROM COM_BASE_PHY T
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.getMaxPhy_C_Code" desc="获取最大的材质小类代码">
		<![CDATA[
			SELECT MAX(PHY_CODE) FROM COM_BASE_PHY_C T 
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.getMaxPhyStdCode" desc="获取最大的材质大类代码">
		<![CDATA[
			SELECT MAX(T.PHY_CODE) FROM COM_BASE_PHY_B T 
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.iSExistPhyStd" desc="是否存在质大类名称">
		<![CDATA[
			SELECT COUNT(1) FROM COM_BASE_PHY_B T WHERE T.PHY_TYPE = ?
			AND T.PHY_CODE != ? AND T.VALIDFLAG = '1'
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.iSExistPhy_C" desc="是否存在质小类名称">
		<![CDATA[
			SELECT COUNT(1) FROM COM_BASE_PHY_C T WHERE T.PHY_TYPE = ?
			AND T.PHY_CODE != ?
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.iSExistPhy" desc="是否存在材质检验项名称">
		<![CDATA[
			SELECT COUNT(1) FROM COM_BASE_PHY T WHERE T.PHY_NAME = ?
			AND T.PHY_CODE != ?
			AND T.PHY_TYPE_C = ? 
			AND T.VALIDFLAG = '1'
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.iSExistPhyItem" desc="是否存在材质项目补充名称">
		<![CDATA[
			SELECT COUNT(1) FROM COM_BASE_PHY_ITEM T WHERE T.ITEM_NAME = ?
			AND T.ITEM_CODE != ?
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.queryPhy2" desc="查询试样组">
		<![CDATA[
SELECT B.PHY_CODE PHY_TYPE,
        B.PHY_TYPE PHY_TYPE_NAME,
        C.PHY_CODE PHY_TYPE_C,
        C.PHY_TYPE PHY_TYPE_NAME_C,
        (SELECT COUNT(1)
           FROM COM_BASE_PHY_R_ITEM A
          WHERE A.PHY_TYPE_C = C.PHY_CODE) COUNT1
   FROM COM_BASE_PHY_B B, COM_BASE_PHY_C C
  WHERE B.PHY_CODE = C.PHY_TYPE_M
    AND B.VALIDFLAG = '1'
    AND C.VALIDFLAG = '1'
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.queryPhy3" desc="查询检验项">
		<![CDATA[
SELECT *
  FROM (SELECT T.PHY_NAME,
               T.PHY_CODE,
               B.PHY_TYPE PHY_NAME_B,
               C.PHY_TYPE PHY_NAME_C,
               (SELECT COUNT(1)
                  FROM COM_BASE_PHY_R_POS A
                 WHERE A.PHY_CODE = T.PHY_CODE) CNT
          FROM COM_BASE_PHY T
          LEFT JOIN COM_BASE_PHY_B B
            ON B.PHY_CODE = T.PHY_TYPE
          LEFT JOIN COM_BASE_PHY_C C
            ON T.PHY_TYPE_C = C.PHY_CODE
         WHERE T.VALIDFLAG = 1) TT
 ORDER BY TT.PHY_NAME_B, TT.PHY_NAME_C, TT.PHY_NAME
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.loadItem" desc="加载材质项目补充数据">
		<![CDATA[
			SELECT ITEM_CODE, ITEM_NAME FROM COM_BASE_PHY_ITEM T WHERE T.ITEM_STYLE = ?
			ORDER BY T.ORDER_SEQ, T.ITEM_NAME
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.loadSizeItem" desc="加载检验项对应的尺寸数据">
		<![CDATA[
SELECT A.ITEM_CODE, A.ITEM_NAME
  FROM COM_BASE_PHY_R_SIZE A, COM_BASE_PHY B
 WHERE B.PHY_TYPE_C = {0}
   AND B.PHY_CODE = A.PHY_CODE
 GROUP BY A.ITEM_CODE, A.ITEM_NAME
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.getMaxPhy_R_ItemCode" desc="获取最大的项目关系代码">
		<![CDATA[
			SELECT MAX(T.PHY_CODE) FROM COM_BASE_PHY_R_ITEM T
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.deleteOrResumePhy_R_Item" desc="作废或者恢复材质项目关系数据">
		<![CDATA[
			UPDATE COM_BASE_PHY_R_ITEM T
				   SET T.VALIDFLAG = '#VALIDFLAG#',
				   T.DELETE_NAME = DECODE('#DELETE_NAME#', '0', '#DELETE_NAME#', '1', ''),
				   T.DELETE_TIME = DECODE('#DELETE_NAME#', '0', SYSDATE, '1', '')
				 WHERE T.PHY_TYPE_C = '#PHY_TYPE_C#'
				   AND #ITEM_CODE_F_CONDITION#
				   AND #ITEM_CODE_C_CONDITION#
				   AND #ITEM_CODE_W_CONDITION#
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.isExistItem_R" desc="是否存在试样组关系数据">
		<![CDATA[
SELECT COUNT(1)
  FROM COM_BASE_PHY_R_ITEM T
 WHERE 1 = 1
   #ITEM_CODE_C#
   #ITEM_CODE_F#
   AND T.PHY_TYPE_C = '#PHY_TYPE_C#'
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.isExistPos_R" desc="是否存在材质关系数据">
		<![CDATA[
SELECT COUNT(1)
  FROM COM_BASE_PHY_R_POS T
 WHERE NVL(T.ITEM_CODE_W, '1') = NVL({0}, '1')
   AND T.PHY_CODE = {1}
   AND NVL(T.ITEM_CODE_W, '1') <> NVL({2}, '1')
		]]>
	</query>
	
	<query id="CoreMaterialAdministration.getPhyMinInfo" desc="是否存在材质关系数据">
		<![CDATA[
SELECT T.PHY_CODE PHY_CODE_MIN, T.PHY_TYPE PHY_NAME_MIN, 'False' CHK
  FROM COM_BASE_PHY_C T
 WHERE T.VALIDFLAG = '1'
		]]>
	</query>
</queryMap>