<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc = "维护工艺参数">
<query id = "FrmTubTechnological.doQueryData" desc = "查询已维护工艺参数">
<![CDATA[
 SELECT 
       CLASS_NAME,
       PLINE_CODE,
       PLINE_NAME,
       STATION_CODE,
       STATION_DESC,
       MAX(CREATE_NAME) CREATE_NAME,
       MAX(TO_CHAR(CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS')) CREATE_TIME
 FROM MIL_CRAFTWORK_SET
 WHERE VALIDFLAG = '1'
 ]]>
</query>
<query id = "FrmTubTechnological.doQuery" desc = "查询工艺项">
 SELECT 
       CLASS_ID,
       FACTOR_ID,
       FACTOR_NAME,
       FACTOR_VAL
 FROM MIL_CRAFTWORK_SET
 WHERE VALIDFLAG = '1'
 AND CLASS_NAME = ?
 AND STATION_CODE = ?
 AND PLINE_CODE = ?
</query>
<query id = "FrmTubTechnological.doQueryPline" desc = "查询产线">
SELECT T.PLINE_NAME,T.PLINE_CODE FROM COM_BASE_PLINE T WHERE T.VALIDFLAG = '1'
</query>
<query id = "FrmTubTechnological.doQueryStation" desc = "查询工序点">
SELECT T.STATION_DESC,T.STATION_CODE FROM COM_BASE_STATION T WHERE T.PROCESS_CODE = 'D'
</query>
<query id = "FrmTubTechnological.doQueryFactor" desc = "查询工艺项">
<![CDATA[
SELECT T.FACTOR_NAME,T.FACTOR_ID FROM MIL_CRAFTWORK_BASE T WHERE T.VALIDFLAG = '1' AND T.STATION_CODE || '&' LIKE ('%' || ? || '%')
]]>
</query>
<query id = "FrmTubTechnological.doClassId" desc = "生成版本ID">
SELECT 'B' ||
       LPAD(NVL(MAX(SUBSTR(T.CLASS_ID,
                           LENGTH(T.CLASS_ID) - 4)),
                0) + 1,
            5,
            0) CLASS_ID
  FROM MIL_CRAFTWORK_SET T

</query>
<query id = "FrmTubTechnological.doAdd" desc = "插入工艺参数">
 INSERT INTO MIL_CRAFTWORK_SET(
        CLASS_ID,
        CLASS_NAME,
        FACTOR_ID,
        FACTOR_NAME,
        FACTOR_VAL,
        PLINE_CODE,
        PLINE_NAME,
        STATION_CODE,
        STATION_DESC,
        VALIDFLAG,
        CREATE_NAME,
        CREATE_TIME
        )
 VALUES( 
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        ?,
        '1',
        ?,
        TO_DATE(?,'YYYY-MM-DD HH24:MI:SS')
        )
</query>
<query id = "FrmTubTechnological.doUpdateData" desc = "修改工艺项">
UPDATE MIL_CRAFTWORK_SET T
   SET T.FACTOR_ID   = ?,
       T.FACTOR_NAME = ?,
       T.FACTOR_VAL  = ?,
       T.UPDATE_NAME = ?,
       T.UPDATE_TIME = TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')
 WHERE T.CLASS_ID = ?
</query>
<query id = "FrmTubTechnological.doQueryType" desc = "查询工艺类型">
SELECT T.COLUMN_TYPE FROM MIL_CRAFTWORK_BASE T WHERE T.FACTOR_ID = ?
</query>
<query id = "FrmTubTechnological.doDeleteData" desc = "作废工艺项">
DELETE FROM MIL_CRAFTWORK_SET T WHERE T.CLASS_ID = ?
</query>
<query id = "FrmTubTechnological.getCraftSet" desc = "查询是否存在相同产线、工序、版本">
SELECT T.PLINE_CODE, T.STATION_CODE, T.CLASS_NAME
  FROM MIL_CRAFTWORK_SET T
 WHERE T.PLINE_CODE = ?
   AND T.STATION_CODE = ?
   AND T.CLASS_NAME = ?
</query>
</queryMap>