<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="检测项目配置">
	<query id="FrmMachine.getQueryGx" desc="查询工序点">
        <![CDATA[
   SELECT T.BASECODE, T.BASENAME
  FROM COM_BASE_INFO T
 WHERE T.SORTCODE = ?
 AND T.BASECODE IN ('700302','700305')
   AND T.VALIDFLAG = '1'
        ]]>
	</query>
		<query id="FrmMachine.getQuerySoue" desc="查询车丝编号">
        <![CDATA[
       (SELECT NULL BASECODE,NULL BASENAME FROM DUAL
       UNION ALL
   SELECT T.BASECODE, T.BASENAME
  FROM COM_BASE_INFO T
 WHERE T.SORTCODE = ?
   AND T.VALIDFLAG = '1') order by basecode asc
        ]]>
	</query>
	<query id="FrmMachine.getQueryPline" desc="查询产线">
        <![CDATA[
SELECT T.PLINE_CODE,T.PLINE_NAME FROM COM_BASE_PLINE T WHERE T.PROCESS_CODE=? AND T.VALIDFLAG='1'
        ]]>
	</query>
<query id="FrmMachine.getQueryPhosphateItem" desc="查询机床对应用户">
        <![CDATA[
SELECT MACHINE_NO, MACHINE_NAME,
       MACHINE_USER1,
         MACHINE_USER2,
       COL_USER,
       TO_CHAR(COL_TIME,'YYYY-MM-DD HH24:MI:SS') COL_TIME,
       UPDATE_USER,
       TO_CHAR(UPDATE_TIME,'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       PROCESS_NO,MACHINE_GROUP,PLINE_NO
  FROM COUPLING_MACHINE_USER
 WHERE MACHINE_NAME || '&' LIKE '%' || ? || '%'
 AND MACHINE_GROUP || '&' LIKE '%' || ? || '%'
 ORDER BY MACHINE_NO asc
        ]]>
	</query>
	<query id="FrmMachine.queryMachine" desc="查询机床对应用户">
        <![CDATA[
SELECT MACHINE_NAME,
       MACHINE_NO,
       MACHINE_USER1,
       PROCESS_NO,
       MACHINE_GROUP,
       PLINE_NO,
       MACHINE_USER2
  FROM COUPLING_MACHINE_USER
 WHERE MACHINE_NO = ?

      ]]>
	</query>
	<query id="FrmMachine.getAddPhosphateItem" desc="新增机床对应用户">
        <![CDATA[
INSERT INTO COUPLING_MACHINE_USER
  (MACHINE_NO,MACHINE_NAME, COL_USER, COL_TIME,PROCESS_NO,PLINE_NO)
VALUES
  (?,?, ?, TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),?,?)
        ]]>
	</query>
	<query id="FrmMachine.getAddOperation" desc="新增机床操作工">
        <![CDATA[
INSERT INTO COUPLING_OPERATION
  (ID, MACHINE_NO, MACHINE_NAME, PLINE_NO, MACHINE_USER1, MACHINE_USER2, PRO_BC, PRO_BZ, PROCESS_NO, COL_USER, COL_TIME)
VALUES
  ((SELECT NVL(MAX(ID),0)+1 FROM COUPLING_OPERATION T), ?, ?, ?, ?, ?, ?, ?, ?, ?, TO_DATE(?,'YYYY-MM-DD HH24;MI:SS'))
        ]]>
	</query>
	<query id="FrmMachine.getUpdatePhosphateItem" desc="修改机床对应用户">
        <![CDATA[
UPDATE COUPLING_MACHINE_USER
   SET MACHINE_NAME = ?,
       UPDATE_USER  = ?,
       UPDATE_TIME  = TO_DATE(?,'YYYY-MM-DD HH24:MI:SS'),
       MACHINE_NO=?,
       PLINE_NO=?
 WHERE MACHINE_NO=?
 AND PLINE_NO=?
        ]]>
	</query>
	<query id="FrmMachine.getUpdateOperation" desc="修改机床操作工">
        <![CDATA[
UPDATE COUPLING_OPERATION
   SET MACHINE_NO    = ?,
       MACHINE_NAME  = ?,
       PLINE_NO      = ?,
       MACHINE_USER1 = ?,
       MACHINE_USER2 = ?,
       PRO_BC        = ?,
       PRO_BZ        = ?,
       UPDATE_USER   = ?,
       UPDATE_TIME   = TO_DATE(?,'YYYY-MM-DD HH24:MI:SS')
 WHERE ID = ?

        ]]>
	</query>
	<query id="FrmMachine.getDeletePhosphateItem" desc="删除机床对应用户">
        <![CDATA[
DELETE COUPLING_MACHINE_USER WHERE MACHINE_NO=?  
        ]]>
	</query>
		<query id="FrmMachine.getDeleteOper" desc="删除机床对应用户">
        <![CDATA[
DELETE COUPLING_OPERATION WHERE MACHINE_NO = ? AND PROCESS_NO =?
        ]]>
	</query>
	<query id="FrmMachine.getQueryOperation" desc="查询机床对应操作工信息">
        <![CDATA[
        SELECT ID,
       MACHINE_NO,
       MACHINE_NAME,
       PLINE_NO,
       MACHINE_USER1,
       MACHINE_USER2,
       PRO_BC,
       PRO_BZ,
       PROCESS_NO,
       COL_USER,
       COL_TIME,
       UPDATE_USER,
       UPDATE_TIME
  FROM COUPLING_OPERATION
 WHERE PLINE_NO = ?
   AND MACHINE_NO = ?
   AND PROCESS_NO = ?
        ]]>
	</query>
</queryMap>