<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="COM_BASE_IMPACT （生成工具：代码生成工具4.0   访问地址：http://172.16.2.128/tool/）">
    <query id="ComBaseImpactDAL.Query" desc="查询">
        <![CDATA[
SELECT T.ID,
       DECODE(T.ALLOW_ARC, '0', 'False', '1', 'True') ALLOW_ARC,
       T.MIN_SIDE_ARC,
       T.MIN_ABOVE_ARC,
       T.PROCESS_SURPLUS,
       T.MIN_IMPACT,
       T.COOL_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.DELETE_NAME,
       TO_CHAR(T.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       DECODE(T.VALIDFLAG, '1', '有效', '0', '无效') VALIDFLAG,
       T.MEMO
  FROM COM_BASE_IMPACT T
 WHERE UPPER(DECODE({0}, NULL, '1', T.MIN_IMPACT)) LIKE
       '%' || UPPER(NVL({0}, '1')) || '%'
   AND T.VALIDFLAG IN ('1', {1})
        ]]>
    </query>
    <query id="ComBaseImpactDAL.QueryByPk" desc="通过主键查询">
        <![CDATA[
 SELECT 
       T.ID,
       T.ALLOW_ARC,
       T.MIN_SIDE_ARC,
       T.MIN_ABOVE_ARC,
       T.PROCESS_SURPLUS,
       T.MIN_IMPACT,
       T.COOL_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.DELETE_NAME,
       TO_CHAR(T.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       T.VALIDFLAG,
       T.MEMO
 FROM COM_BASE_IMPACT T
 WHERE
       T.ID = '#ID#'
        ]]>
    </query>
    <query id="ComBaseImpactDAL.Insert" desc="新增">
        <![CDATA[
 INSERT INTO COM_BASE_IMPACT(
        ID,
        ALLOW_ARC,
        MIN_SIDE_ARC,
        MIN_ABOVE_ARC,
        PROCESS_SURPLUS,
        MIN_IMPACT,
        COOL_MEMO,
        CREATE_NAME,
        CREATE_TIME,
        MEMO)
 VALUES( 
        '#ID#',
        '#ALLOW_ARC#',
        '#MIN_SIDE_ARC#',
        '#MIN_ABOVE_ARC#',
        '#PROCESS_SURPLUS#',
        '#MIN_IMPACT#',
        '#COOL_MEMO#',
        '#CREATE_NAME#',
        SYSDATE,
        '#MEMO#')
        ]]>
    </query>
    <query id="ComBaseImpactDAL.Update" desc="修改">
        <![CDATA[
 UPDATE COM_BASE_IMPACT T
   SET 
        T.ID = '#ID#',
        T.ALLOW_ARC = '#ALLOW_ARC#',
        T.MIN_SIDE_ARC = '#MIN_SIDE_ARC#',
        T.MIN_ABOVE_ARC = '#MIN_ABOVE_ARC#',
        T.PROCESS_SURPLUS = '#PROCESS_SURPLUS#',
        T.MIN_IMPACT = '#MIN_IMPACT#',
        T.COOL_MEMO = '#COOL_MEMO#',
        T.UPDATE_NAME = '#UPDATE_NAME#',
        T.UPDATE_TIME = SYSDATE,
        T.MEMO = '#MEMO#'
 WHERE
       T.ID = '#ID#'
        ]]>
    </query>
    <query id="ComBaseImpactDAL.GetMaxPk" desc="获取最大主键">
        <![CDATA[
SELECT LPAD(NVL(MAX(ID), 0) + 1, 4, '0') MAX_VALUE FROM COM_BASE_IMPACT T
        ]]>
    </query>
    <query id="ComBaseImpactDAL.Delete" desc="作废">
        <![CDATA[
DECLARE
BEGIN
  UPDATE COM_BASE_IMPACT T
     SET T.VALIDFLAG   = '0',
         T.DELETE_NAME = '#DELETE_NAME#',
         T.DELETE_TIME = SYSDATE
   WHERE T.ID = '#ID#';

  UPDATE COM_BASE_IMPACT_C T
     SET T.VALIDFLAG   = '0',
         T.DELETE_NAME = '#DELETE_NAME#',
         T.DELETE_TIME = SYSDATE
   WHERE T.ID = '#ID#';
   
   UPDATE COM_BASE_IMPACT_TEMP_C T
     SET T.VALIDFLAG   = '0',
         T.DELETE_NAME = '#DELETE_NAME#',
         T.DELETE_TIME = SYSDATE
   WHERE T.ID = '#ID#';
END;
        ]]>
    </query>
    <query id="ComBaseImpactDAL.Resume" desc="恢复">
        <![CDATA[
UPDATE COM_BASE_IMPACT T
   SET
       T.VALIDFLAG = '1',
       T.DELETE_NAME = NULL,
       T.DELETE_TIME = NULL,
       T.UPDATE_NAME = '#UPDATE_NAME#',
       T.UPDATE_TIME = SYSDATE
WHERE
       T.ID = '#ID#'
        ]]>
    </query>
     <query id="ComBaseImpactDAL.getItemC" desc="获取试验尺寸">
        <![CDATA[
SELECT DISTINCT T.ITEM_CODE_C ITEM_CODE, A.ITEM_NAME
  FROM com_base_spline_length T
  LEFT JOIN COM_BASE_PHY_ITEM A
    ON A.ITEM_CODE = T.ITEM_CODE_C
 WHERE T.VALIDFLAG = '1'
        ]]>
    </query>
</queryMap>