<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="芯棒产线适用规格">

	<query id="FrmBaseMandrelSpec.initDimater" desc="初始化芯棒直径">
         <![CDATA[
         SELECT T.MANDREL_ID, T.DIAMETER_MANDREL
  FROM COM_BASE_MANDREL T
 ORDER BY T.DIAMETER_MANDREL
                 ]]>
	</query>

	<query id="FrmBaseMandrelSpec.query" desc="查询">
         <![CDATA[
   SELECT 
       T.RELATION_ID,
       T.MANDREL_ID,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.MIN_D,
       T.MAX_D,
       T.MIN_H,
       T.MAX_H,
       T.DIAMETER_MANDREL,
       T.PASS_CODE,
       T.PASS_NAME,
       T.MEMO,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.UPDATE_NAME,
       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME
 FROM COM_BASE_MANDREL_SPEC T
 WHERE
 1=1
                 ]]>
	</query>

<query id="FrmBaseMandrelSpec.query1" desc="查询">
         <![CDATA[
   SELECT 
       T.RELATION_ID,
       T.MANDREL_ID,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.MIN_D,
       T.MAX_D,
       T.MIN_H,
       T.MAX_H,
       T.DIAMETER_MANDREL,
       T.PASS_CODE,
       T.PASS_NAME,
       T.MEMO,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.UPDATE_NAME,
       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       T.LEN_SINGER_BILL
 FROM COM_BASE_MANDREL_SPEC T
 WHERE
 1=1
                 ]]>
	</query>
	<query id="FrmBaseMandrelSpec.add" desc="新增">
         <![CDATA[
          INSERT INTO COM_BASE_MANDREL_SPEC(
        RELATION_ID,
        MANDREL_ID,
        PLINE_CODE,
        PLINE_NAME,
        MIN_D,
        MAX_D,
        MIN_H,
        MAX_H,
        DIAMETER_MANDREL,
        PASS_CODE,
        PASS_NAME,
        MEMO,
        CREATE_NAME,
        CREATE_TIME,
        LEN_SINGER_BILL)
 VALUES( 
        (SELECT nvl(MAX(TO_number(RELATION_ID)),0)+1 from COM_BASE_MANDREL_SPEC) ,
        '#MANDREL_ID#',
        '#PLINE_CODE#',
        '#PLINE_NAME#',
        '#MIN_D#',
        '#MAX_D#',
        '#MIN_H#',
        '#MAX_H#',
        '#DIAMETER_MANDREL#',
        '#PASS_CODE#',
        '#PASS_NAME#',
        '#MEMO#',
        '#CREATE_NAME#',
        SYSDATE,
        '#LEN_SINGER_BILL#')
                 ]]>
	</query>


	<query id="FrmBaseMandrelSpec.update" desc="修改">
         <![CDATA[
          UPDATE COM_BASE_MANDREL_SPEC T
   SET 
        T.MANDREL_ID = '#MANDREL_ID#',
        T.PLINE_CODE = '#PLINE_CODE#',
        T.PLINE_NAME = '#PLINE_NAME#',
        T.MIN_D = '#MIN_D#',
        T.MAX_D = '#MAX_D#',
        T.MIN_H = '#MIN_H#',
        T.MAX_H = '#MAX_H#',
        T.DIAMETER_MANDREL = '#DIAMETER_MANDREL#',
        T.PASS_CODE = '#PASS_CODE#',
        T.PASS_NAME = '#PASS_NAME#',
        T.MEMO = '#MEMO#',
        T.UPDATE_NAME = '#UPDATE_NAME#',
        T.UPDATE_TIME = SYSDATE,
        T.LEN_SINGER_BILL='#LEN_SINGER_BILL#'
 WHERE
T.RELATION_ID = '#RELATION_ID#'
                 ]]>
	</query>

	<query id="FrmBaseMandrelSpec.delete" desc="删除">
         <![CDATA[
         DELETE FROM COM_BASE_MANDREL_SPEC T WHERE T.RELATION_ID=?
                 ]]>
	</query>

</queryMap>