<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="产线与仓库管理分组关联">

	<query id="FrmBasePlineGroup.doQuery" desc="产线与仓库管理分组信息">
		<![CDATA[
	SELECT PLINE_CODE_M,
       PLINE_NAME_M,
       PLINE_CODE_C,
       PLINE_NAME_C,
       STOCK_GROUP_CODE,
       STOCK_GROUP_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,STORAGE_NO,STORAGE_NAME
  FROM COM_BASE_PLINE_R_GROUP
WHERE 1=1
		]]>
	</query>

	<query id="FrmBasePlineGroup.doAdd" desc="新增">
		<![CDATA[
		INSERT INTO COM_BASE_PLINE_R_GROUP
  (PLINE_CODE_M,
   PLINE_NAME_M,
   PLINE_CODE_C,
   PLINE_NAME_C,
   STOCK_GROUP_CODE,
   STOCK_GROUP_NAME,
   CREATE_NAME,
   CREATE_TIME,STORAGE_NO,STORAGE_NAME)
VALUES
  (?, ?, ?, ?, ?, ?, ?, SYSDATE,?,?)
			  
		]]>
	</query>
	<query id="FrmBasePlineGroup.doUpdate" desc="修改">
		<![CDATA[
			UPDATE COM_BASE_PLINE_R_GROUP
   SET 
       STOCK_GROUP_CODE = ?,
       STOCK_GROUP_NAME = ?,
       UPDATE_NAME      = ?,
       UPDATE_TIME      = SYSDATE,
       STORAGE_NO   =?,
       STORAGE_NAME =?
 WHERE PLINE_CODE_M = ?
   AND PLINE_CODE_C = ?
		]]>
	</query>
	<!-- 
	PLINE_CODE_M     = ?,
       PLINE_NAME_M     = ?,
       PLINE_CODE_C     = ?,
       PLINE_NAME_C     = ?,
	 -->
	<query id="FrmBasePlineGroup.doDelete" desc="删除">
		<![CDATA[
			DELETE COM_BASE_PLINE_R_GROUP
 WHERE PLINE_CODE_M = ?
   AND PLINE_CODE_C = ?
		]]>
	</query>
	<query id="FrmBasePlineGroup.getGroupStoage" desc="管理分组">
		SELECT T.BASECODE,T.BASENAME FROM COM_BASE_INFO T WHERE T.SORTCODE=? AND
		T.VALIDFLAG='1'
	</query>
	<query id="FrmBasePlineGroup.storageRepeatCode" desc="判断是否唯一">
SELECT PLINE_CODE_C, PLINE_NAME_C
  FROM COM_BASE_PLINE_R_GROUP T
 WHERE T.PLINE_CODE_M=?
 AND T.PLINE_CODE_C = ?
	</query>
	<query id="FrmBasePlineGroup.doPlineCodeQuery" desc="查询产线">
		SELECT T.PLINE_CODE, T.PLINE_NAME
  FROM COM_BASE_PLINE T
 WHERE T.VALIDFLAG = '1'
 ORDER BY T.PLINE_NAME ASC	
	</query>
		<query id="FrmBasePlineGroup.getStationQuery" desc="查询到站">
		  SELECT STATION_NM,STATION_NO FROM SLM_BASE_STATION WHERE VALIDFLAG='1' ORDER  BY  STATION_NM ASC
	</query>
		<query id="FrmBasePlineGroup.getBsStorage" desc="查询仓库">
		  SELECT T.STORAGE_NO,T.STORAGE_NAME FROM YDM_BS_STORAGE T WHERE T.VALIDFLAG='1' ORDER BY T.STORAGE_NAME ASC
	</query>
</queryMap>
