<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="产线操作台电脑IP维护">
	<query id="IPAdress.Query" desc="查询数据">
		SELECT
		IP_ADDRESS1，
		IP_ADDRESS2，
		IP_ADDRESS3，
		IP_ADDRESS4，
		CASE PROCESS_NO
		WHEN 'GP' THEN '管排锯操作'
		WHEN 'JZ' THEN '矫直操作'
		WHEN 'ET' THEN '涡流探伤操作'
		WHEN 'MT' THEN '漏磁探伤操作'
		WHEN 'UT' THEN '超声波探伤操作'
		END AS PROCESS_NO,
		OPERAT_CODE,
		OPERAT_NAME,
		CASE PLINE_CODE
		WHEN 'C008' THEN '250机组'
		WHEN 'C009' THEN '258机组'
		WHEN 'C010' THEN '168机组'
		WHEN 'C017' THEN '460机组'
		WHEN 'C012' THEN 'ASSEL机组'
		WHEN 'C072' THEN '天淮508机组'
		END AS PLINE_CODE,
		PROCESS_NO   AS PROCESS,
		PLINE_CODE  AS PLINE,
		REMARK
		FROM MIL_BASE_ADDRESS
		WHERE
		1=1
		AND PROCESS_NO  like '%' ||'#PROCESS_NO#'|| '%'
        AND OPERAT_CODE  like  '%' ||'#OPERAT_CODE#'|| '%'
        AND PLINE_CODE  like '%' ||'#PLINE_CODE#'|| '%'
     </query>
        
     <query id="IPAdress.isExist" desc="查询是否已出现数据">
       SELECT 
       IP_ADDRESS3,
       IP_ADDRESS4,
       IP_ADDRESS1,
       IP_ADDRESS2,
       PROCESS_NO,
       OPERAT_CODE,
       OPERAT_NAME,
       PLINE_CODE,
       REMARK
       FROM MIL_BASE_ADDRESS
       WHERE
       1=1
       AND  PROCESS_NO='#PROCESS_NO#'
       AND  OPERAT_CODE='#OPERAT_CODE#'
       AND  PLINE_CODE='#PLINE_CODE#'
        </query>
       
       <query id="IPAdress.Add" desc="添加记录">
         INSERT INTO MIL_BASE_ADDRESS(
        IP_ADDRESS3,
        IP_ADDRESS4,
        IP_ADDRESS1,
        IP_ADDRESS2,
        PROCESS_NO,
        OPERAT_CODE,
        OPERAT_NAME,
        PLINE_CODE,
        REMARK)
 VALUES( 
        '#IP_ADDRESS3#',
        '#IP_ADDRESS4#',
        '#IP_ADDRESS1#',
        '#IP_ADDRESS2#',
        '#PROCESS_NO#',
        '#OPERAT_CODE#',
        '#OPERAT_NAME#',
        '#PLINE_CODE#',
        '#REMARK#')
       </query>
       
       <query id="IPAdress.Save" desc="修改记录">
        UPDATE MIL_BASE_ADDRESS
        SET 
        IP_ADDRESS3 = '#IP_ADDRESS3#',
        IP_ADDRESS4 = '#IP_ADDRESS4#',
        IP_ADDRESS1 = '#IP_ADDRESS1#',
        IP_ADDRESS2 = '#IP_ADDRESS2#',
        REMARK = '#REMARK#'
        WHERE
        1=1
        AND  PROCESS_NO='#PROCESS_NO#'
        AND  OPERAT_CODE='#OPERAT_CODE#'
        AND  PLINE_CODE='#PLINE_CODE#'
       </query>
       <query id="IPAdress.Delete" desc="删除数据">
       DELETE FROM   MIL_BASE_ADDRESS  
       WHERE
       1=1
       AND  PROCESS_NO='#PROCESS_NO#'
       AND  OPERAT_CODE='#OPERAT_CODE#'
       AND  PLINE_CODE='#PLINE_CODE#'
       </query>


</queryMap>