<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="扣型加长">
	<query id="FrmBaseModelLen.doQuery" desc="查询扣型加长">
		<![CDATA[	
SELECT T.ID,
       T.LEN_TOLERA_MIN,
       T.LEN_TOLERA_MAX,
       T.MODEL_CODE,
       T.MODEL_DESC,
       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.MEMO,
       T.DIAMETER_MIN,
       T.DIAMETER_MAX,
       T.WALLTHICK_MIN,
       T.WALLTHICK_MAX,
       T.LEN_LONGER_MIN,
       T.LEN_LONGER_MAX,
       T.JG_NUM
  FROM COM_BASE_MODEL_LEN T 
  WHERE 1=1
		]]>
	</query>
	<query id="FrmBaseModelLen.doQueryMaxId" desc="查询扣型加长">
		<![CDATA[	
		SELECT 'KXJC' || LPAD(SUBSTR(NVL(MAX(T.ID), '00000'), -5, 5) + 1, 5, '0') AS ID_MAX
  FROM COM_BASE_MODEL_LEN T	
				]]>
	</query>
	<query id="FrmBaseModelLen.doQueryModel" desc="查询扣型">
		<![CDATA[
		SELECT T.MODEL_CODE,T.MODEL_DESC FROM COM_BASE_MODEL T WHERE 1=1 ORDER BY T.MODEL_DESC ASC
			]]>
	</query>
	<query id="FrmBaseModelLen.doAdd" desc="新增">
		<![CDATA[
INSERT INTO COM_BASE_MODEL_LEN
  (ID,
   LEN_TOLERA_MIN,
   LEN_TOLERA_MAX,
   MODEL_CODE,
   MODEL_DESC,
   CREATE_NAME,
   CREATE_TIME,
   MEMO,
   DIAMETER_MIN,
   DIAMETER_MAX,
   WALLTHICK_MIN,
   WALLTHICK_MAX,
   LEN_LONGER_MIN,
   LEN_LONGER_MAX,
   JG_NUM)
VALUES
  (?, ?, ?, ?, ?, ?, SYSDATE, ?, ?, ?, ?, ?, ?, ?, ?)
			]]>
	</query>
	<query id="FrmBaseModelLen.doUpdate" desc="修改">
		<![CDATA[

UPDATE COM_BASE_MODEL_LEN
   SET LEN_TOLERA_MIN = ?,
       LEN_TOLERA_MAX = ?,
       MODEL_CODE     = ?,
       MODEL_DESC     = ?,
       UPDATE_NAME    = ?,
       UPDATE_TIME    = SYSDATE,
       MEMO           = ?,
       DIAMETER_MIN   = ?,
       DIAMETER_MAX   = ?,
       WALLTHICK_MIN  = ?,
       WALLTHICK_MAX  = ?,
       LEN_LONGER_MIN = ?,
       LEN_LONGER_MAX = ?,
       JG_NUM		  = ?
 WHERE ID = ?
			]]>
	</query>
	<query id="FrmBaseModelLen.doDelete" desc="删除">
		<![CDATA[
DELETE COM_BASE_MODEL_LEN WHERE ID = ?
			]]>
	</query>
</queryMap>