<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="钢管品种对应管理">

	<query id="FrmVarietie.ZB_KIND" desc="查询质保部品名">
		<![CDATA[
	   SELECT  T.KIND
       FROM tabcxzljk T
       WHERE T.CXSTU!='20' AND T.KIND IS NOT NULL AND T.KIND !=''
       AND T.TESTDATE>=? 
       AND T.KIND collate Chinese_PRC_CS_AS_WS NOT IN #pram#
       GROUP BY T.KIND
       ORDER BY T.KIND   
		]]>
	</query>
	
	<query id="FrmVarietie.ZB_STEEL" desc="查询质保部钢级">
		<![CDATA[
     SELECT  T.steellevel
       FROM tabcxzljk T
       WHERE T.CXSTU!='20' AND T.steellevel IS NOT NULL AND T.steellevel !=''
       AND T.TESTDATE>=? 
       AND T.steellevel collate Chinese_PRC_CS_AS_WS NOT IN #pram#
       GROUP BY T.steellevel
       ORDER BY T.steellevel 
		]]>
	</query>
	
	<query id="FrmVarietie.ZB_SPEC" desc="查询质保部规格">
		<![CDATA[
	 SELECT  T.gg
       FROM tabcxzljk T
       WHERE T.CXSTU!='20' AND T.gg IS NOT NULL AND T.gg !=''
       AND T.TESTDATE>=? 
       --AND T.gg collate Chinese_PRC_CS_AS_WS NOT IN #pram#
       GROUP BY T.gg
       ORDER BY T.gg
		]]>
	</query>
	
	<query id="FrmVarietie.ZB_MODEL" desc="查询质保部扣型">
		<![CDATA[
	   SELECT  T.typeofThread
       FROM tabcxzljk T
       WHERE T.CXSTU!='20' AND T.typeofThread IS NOT NULL AND T.typeofThread !=''
       AND T.TESTDATE>=? 
       AND T.typeofThread collate Chinese_PRC_CS_AS_WS NOT IN #pram#
       GROUP BY T.typeofThread
       ORDER BY T.typeofThread
		]]>
	</query>
	
	<query id="FrmVarietie.getZBFactory" desc="查询质保部产线">
		<![CDATA[
	   SELECT  T.factory
       FROM tabcxzljk T
       WHERE T.CXSTU!='20' AND T.factory IS NOT NULL AND T.factory !=''
       AND T.TESTDATE>=? 
       AND T.factory collate Chinese_PRC_CS_AS_WS NOT IN #pram#
       GROUP BY T.factory
       ORDER BY T.factory
		]]>
	</query>
	<query id="FrmVarietie.getZBGrade" desc="查询质保部钢种">
		<![CDATA[
	   SELECT  T.steelgrade
       FROM tabcxzljk T
       WHERE T.CXSTU!='20' AND T.factory IS NOT NULL AND T.steelgrade !=''
       AND T.TESTDATE>=? 
       AND T.steelgrade collate Chinese_PRC_CS_AS_WS NOT IN #pram#
       GROUP BY T.steelgrade
       ORDER BY T.steelgrade
		]]>
	</query>
	<query id="FrmVarietie.GETPRODUCT" desc="查询品名">
		<![CDATA[
	    SELECT 
	    PRODUCNAME,PRODUCCODE,PRODUC_JX,PRODUC_ENG
	    FROM COM_BASE_PRODUCT T
	    WHERE T.VALIDFLAG ='1'
	    ORDER BY PRODUCCODE
		]]>
	</query>
		
	<query id="FrmVarietie.GETSPEC" desc="查询产品规格">
		<![CDATA[
	     SELECT SPEC_NAME,SPEC_CODE
	     FROM COM_BASE_SPEC T
	     WHERE 1 = 1
	     ORDER BY SPEC_CODE
		]]>
	</query>	
	<query id="FrmVarietie.GETSTEEL" desc="查询钢级">
		<![CDATA[
	     SELECT STEELNAME,STEELCODE
	     FROM COM_BASE_STEEL T
	     WHERE T.VALIDFLAG ='1'
	     ORDER BY STEELCODE
		]]>
	</query>
	<query id="FrmVarietie.GETMODEL" desc="查询扣型">
		<![CDATA[
	    SELECT MODEL_DESC,MODEL_CODE
	    FROM COM_BASE_MODEL T
	    WHERE T.VALIDFLAG ='1'
	    ORDER BY MODEL_CODE
		]]>
	</query>
	<query id = "FrmVarietie.getFactory" desc = "查询产线">
	<![CDATA[
	SELECT PLINE_NAME,PLINE_CODE
	    FROM COM_BASE_PLINE T
	    WHERE T.VALIDFLAG ='1'
	    ORDER BY PLINE_CODE
	]]>
	</query>
	
	<query id = "FrmVarietie.getGrade" desc = "查询钢种">
	<![CDATA[
	SELECT GRADENAME,GRADECODE
	    FROM COM_BASE_GRADE T
	    WHERE T.VALIDFLAG ='1'
	    ORDER BY GRADECODE
	]]>
	</query>
	<query id="FrmVarietie.QueryProduct" desc="查询品名对应关系">
		<![CDATA[
	   SELECT * FROM LIN_BASE_PRODUCT WHERE PRODUCCODE=? ORDER BY CREATE_TIME DESC
		]]>
	</query>
		
	<query id="FrmVarietie.QuerySpec" desc="查询产品规格对应关系">
		<![CDATA[
	     SELECT * FROM LIN_BASE_SPEC  WHERE SPEC_CODE=? ORDER BY CREATE_TIME DESC
		]]>
	</query>	
	<query id="FrmVarietie.QuerySteel" desc="查询钢级对应关系">
		<![CDATA[
	    SELECT * FROM LIN_BASE_STEEL  WHERE STEELCODE=? ORDER BY CREATE_TIME DESC
		]]>
	</query>
	<query id="FrmVarietie.QueryModel" desc="查询扣型对应关系">
		<![CDATA[
	    SELECT * FROM LIN_BASE_MODEL  WHERE MODEL_CODE=? ORDER BY CREATE_TIME 
		]]>
	</query>
	<query id="FrmVarietie.queryFactory" desc="查询产线对应关系">
		<![CDATA[
	    SELECT * FROM LIN_BASE_PLINE  WHERE PLINE_CODE=? ORDER BY CREATE_TIME 
		]]>
	</query>
	<query id="FrmVarietie.queryGrade" desc="查询钢种对应关系">
		<![CDATA[
	    SELECT * FROM LIN_BASE_GRADE  WHERE GRADECODE=? ORDER BY CREATE_TIME 
		]]>
	</query>
	<query id="FrmVarietie.addProduct" desc="新增品名对应关系">
		<![CDATA[
	 INSERT INTO LIN_BASE_PRODUCT
	    (PRODUCCODE,
	     PRODUCNAME,
	     PRODUC_JX,
	     PRODUC_ENG,
	     ZB_PRODUCNAME,
	     CREATE_NAME,
	     CREATE_TIME)
	  VALUES
	    (?, ?, ?, ?, ?, ?, SYSDATE)
		]]>
	</query>
	<query id="FrmVarietie.addModel" desc="新增扣型对应关系">
		<![CDATA[
    INSERT INTO LIN_BASE_MODEL
	  (MODEL_CODE, MODEL_DESC, ZB_MODEL_DESC, CREATE_NAME, CREATE_TIME)
	VALUES
	  (?, ?, ?, ?, SYSDATE)
		]]>
	</query>
	<query id="FrmVarietie.addFactory" desc="新增产线对应关系">
		<![CDATA[
    INSERT INTO LIN_BASE_PLINE
	  (PLINE_CODE, PLINE_NAME, ZB_PLINENAME, CREATE_NAME, CREATE_TIME)
	VALUES
	  (?, ?, ?, ?, SYSDATE)
		]]>
	</query>
	<query id="FrmVarietie.addGrade" desc="新增钢种对应关系">
		<![CDATA[
    INSERT INTO LIN_BASE_GRADE
	  (GRADECODE, GRADENAME, ZB_GRADENAME, CREATE_NAME, CREATE_TIME)
	VALUES
	  (?, ?, ?, ?, SYSDATE)
		]]>
	</query>
	
	<query id="FrmVarietie.addSteel" desc="新增钢级对应关系">
		<![CDATA[
	INSERT INTO LIN_BASE_STEEL
	  (STEELCODE, STEELNAME, ZB_STEELNAME, CREATE_NAME, CREATE_TIME)
	VALUES
	  (?, ?, ?, ?, SYSDATE)
		]]>
	</query>
	<query id="FrmVarietie.addSpec" desc="新增规格对应关系">
		<![CDATA[
	 INSERT INTO LIN_BASE_SPEC
	  (SPEC_CODE, SPEC_NAME, ZB_SPEC_NAME, CREATE_NAME, CREATE_TIME)
	VALUES
	  (?, ?, ?, ?, SYSDATE)
		]]>
	</query>
	<query id="FrmVarietie.deleteProduct" desc="删除品名对应关系">
		<![CDATA[
		 DELETE LIN_BASE_PRODUCT
	 WHERE PRODUCCODE = ?
	   AND ZB_PRODUCNAME = ?
		]]>
	</query>
	<query id="FrmVarietie.deleteSteel" desc="删除钢级对应关系">
		<![CDATA[
		DELETE LIN_BASE_STEEL
 WHERE STEELCODE = ?
   AND ZB_STEELNAME = ?
		]]>
	</query>
	<query id="FrmVarietie.deleteSpec" desc="删除规格对应关系">
		<![CDATA[
		DELETE LIN_BASE_SPEC
 WHERE SPEC_CODE = ?
   AND ZB_SPEC_NAME = ?
		]]>
	</query>
	<query id="FrmVarietie.deleteModel" desc="删除扣型对应关系">
		<![CDATA[
		DELETE LIN_BASE_MODEL
 WHERE MODEL_CODE = ?
   AND ZB_MODEL_DESC = ?
		]]>
	</query>
	
	<query id="FrmVarietie.deleteFactory" desc="删除产线对应关系">
		<![CDATA[
		DELETE LIN_BASE_PLINE
 WHERE PLINE_CODE = ?
   AND ZB_PLINENAME = ?
		]]>
	</query>
	<query id="FrmVarietie.deleteGrade" desc="删除钢种对应关系">
		<![CDATA[
		DELETE LIN_BASE_GRADE
 WHERE GRADECODE = ?
   AND ZB_GRADENAME = ?
		]]>
	</query>
	<query id="FrmVarietie.getQueryKind" desc="查询品名对应关系是否存在">
		<![CDATA[
		SELECT * FROM lin_base_product 
		]]>
	</query>
	<query id="FrmVarietie.getQuerySpec" desc="查询规格对应关系是否存在">
		<![CDATA[
		SELECT * FROM lin_base_spec 
		]]>
	</query>
	<query id="FrmVarietie.getQuerySteel" desc="查询钢级对应关系是否存在">
		<![CDATA[
		SELECT * FROM lin_base_steel 
		]]>
	</query>
	<query id="FrmVarietie.getQueryModel" desc="查询扣型对应关系是否存在">
		<![CDATA[
		SELECT * FROM lin_base_model 
		]]>
	</query>
	
	<query id="FrmVarietie.getQueryFactory" desc="查询产线对应关系是否存在">
		<![CDATA[
		SELECT * FROM LIN_BASE_PLINE 
		]]>
	</query>
	<query id="FrmVarietie.getQueryGrade" desc="查询钢种对应关系是否存在">
		<![CDATA[
		SELECT * FROM LIN_BASE_GRADE 
		]]>
	</query>
	<query id="FrmVarietie.getQueryKind1" desc="查询品名对应关系是否存在">
		<![CDATA[
		SELECT * FROM lin_base_product WHERE ZB_PRODUCNAME=?
		]]>
	</query>
	<query id="FrmVarietie.getQuerySpec1" desc="查询规格对应关系是否存在">
		<![CDATA[
		SELECT * FROM lin_base_spec WHERE ZB_SPEC_NAME=?
		]]>
	</query>
	<query id="FrmVarietie.getQuerySteel1" desc="查询钢级对应关系是否存在">
		<![CDATA[
		SELECT * FROM lin_base_steel WHERE ZB_STEELNAME=?
		]]>
	</query>
	<query id="FrmVarietie.getQueryModel1" desc="查询扣型对应关系是否存在">
		<![CDATA[
		SELECT * FROM lin_base_model WHERE ZB_MODEL_DESC= ?
		]]>
	</query>
	<query id="FrmVarietie.getQueryFactory1" desc="查询产线对应关系是否存在">
		<![CDATA[
		SELECT * FROM LIN_BASE_PLINE WHERE ZB_PLINENAME=?
		]]>
	</query>
	<query id="FrmVarietie.getQueryGrade1" desc="查询钢种对应关系是否存在">
		<![CDATA[
		SELECT * FROM LIN_BASE_GRADE WHERE ZB_GRADENAME=?
		]]>
	</query>
</queryMap>