<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="生产产线与工序点对应管理">
	<query id="CoreProductionPlane.GetStation" desc="查询">
		<![CDATA[
			
       SELECT 'TRUE' CHK,
       T2.PLINE_CODE,
       T2.PLINE_NAME,
       T2.STATION_CODE,
       T2.STATION_DESC,
       T2.STATION_ID,
       T2.MEMO
       FROM COM_MSC_STATION_R_PLINE T2
       WHERE T2.PLINE_CODE = ?
       UNION
       SELECT 'FALSE' CHK,
       PLINE_CODE,
       PLINE_NAME,
       STATION_CODE,
       STATION_DESC,
       STATION_ID,
       T.MEMO
       FROM COM_BASE_STATION T, COM_BASE_PLINE T1
       WHERE T.PROCESS_CODE = T1.PROCESS_CODE
       AND T1.PLINE_CODE = ? AND T.VALIDFLAG='1'
       AND T1.VALIDFLAG='1'
       AND T.STATION_CODE NOT IN (SELECT STATION_CODE
                                FROM COM_MSC_STATION_R_PLINE
                               WHERE PLINE_CODE = ?)

		]]>
	</query>
	<query id="CoreProductionPlane.GetPLine" desc="查询">
		<![CDATA[
	   SELECT 
       PROCESS_CODE,
       PROCESS_DESC,
       PLINE_CODE,
       PLINE_NAME
       FROM COM_BASE_PLINE 
       WHERE VALIDFLAG='1'
		]]>
	</query>
	<query id="CoreProductionPlane.ADD" desc="新增">
		<![CDATA[
		 INSERT INTO COM_MSC_STATION_R_PLINE
        ( 
         PLINE_CODE,
         PLINE_NAME,
         STATION_CODE,
         STATION_DESC,
         STATION_ID,
         CREATE_NAME,
         CREATE_TIME,
         VALIDFLAG,
         MEMO)
         VALUES  (?,?,?, ?, ?, ?,SYSDATE,'1', ?)
			 
		]]>
	</query>
	<query id="CoreProductionPlane.DELETE" desc="新增">
		<![CDATA[	          
          DELETE FROM COM_MSC_STATION_R_PLINE WHERE PLINE_CODE = ?
		]]>
	</query>
</queryMap>