<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="CRAFT_FILE_LV2_C （生成工具：代码生成工具4.0   访问地址：http://172.16.2.128/tool/）">
    <query id="CraftFileLv2CDAL.Query" desc="查询">
        <![CDATA[
 SELECT 
       T.PK,
       T.FILE_LV2_PK,
       T.PRODUCNAME,
       T.PRODUCCODE,
       T.STEELCODE,
       T.STEELNAME,
       T.STD_CODE,
       T.STD_NAME,
       T.GRADECODE,
       T.GRADENAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.MIN_D,
       T.MAX_D,
       T.MIN_H,
       T.MAX_H,
       T.MIN_D_SIGN,
       T.MAX_D_SIGN,
       T.MIN_H_SIGN,
       T.MAX_H_SIGN,
       T.CRAFT_NO,
       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
 FROM CRAFT_FILE_LV2_C T
 WHERE
     T.VALIDFLAG IN ('1', '#VALIDFLAG#')
     AND T.FILE_LV2_PK = '#FILE_LV2_PK#'
        ]]>
    </query>
    <query id="CraftFileLv2CDAL.QueryByPk" desc="通过主键查询">
        <![CDATA[
 SELECT 
       T.PK,
       T.FILE_LV2_PK,
       T.PRODUCNAME,
       T.PRODUCCODE,
       T.STEELCODE,
       T.STEELNAME,
       T.STD_CODE,
       T.STD_NAME,
       T.GRADECODE,
       T.GRADENAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.MIN_D,
       T.MAX_D,
       T.MIN_H,
       T.MAX_H,
       T.MIN_D_SIGN,
       T.MAX_D_SIGN,
       T.MIN_H_SIGN,
       T.MAX_H_SIGN,
       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
 FROM CRAFT_FILE_LV2_C T
 WHERE
       T.PK = '#PK#'
        ]]>
    </query>
    <query id="CraftFileLv2CDAL.Insert" desc="新增">
        <![CDATA[
 INSERT INTO CRAFT_FILE_LV2_C(
        PK,
        FILE_LV2_PK,
        PRODUCNAME,
        PRODUCCODE,
        STEELCODE,
        STEELNAME,
        STD_CODE,
        STD_NAME,
        GRADECODE,
        GRADENAME,
        MODEL_CODE,
        MODEL_DESC,
        MIN_D,
        MAX_D,
        MIN_H,
        MAX_H,
        MIN_D_SIGN,
        MAX_D_SIGN,
        MIN_H_SIGN,
        MAX_H_SIGN,
        CREATE_NAME,
        CREATE_TIME,
        CRAFT_NO)
 VALUES( 
        '#PK#',
        '#FILE_LV2_PK#',
        '#PRODUCNAME#',
        '#PRODUCCODE#',
        '#STEELCODE#',
        '#STEELNAME#',
        '#STD_CODE#',
        '#STD_NAME#',
        '#GRADECODE#',
        '#GRADENAME#',
        '#MODEL_CODE#',
        '#MODEL_DESC#',
        '#MIN_D#',
        '#MAX_D#',
        '#MIN_H#',
        '#MAX_H#',
        '#MIN_D_SIGN#',
        '#MAX_D_SIGN#',
        '#MIN_H_SIGN#',
        '#MAX_H_SIGN#',
        '#CREATE_NAME#',
        SYSDATE,
        '#CRAFT_NO#')
        ]]>
    </query>
    <query id="CraftFileLv2CDAL.Update" desc="修改">
        <![CDATA[
 UPDATE CRAFT_FILE_LV2_C T
   SET
        T.PRODUCNAME = '#PRODUCNAME#',
        T.PRODUCCODE = '#PRODUCCODE#',
        T.STEELCODE = '#STEELCODE#',
        T.STEELNAME = '#STEELNAME#',
        T.STD_CODE = '#STD_CODE#',
        T.STD_NAME = '#STD_NAME#',
        T.GRADECODE = '#GRADECODE#',
        T.GRADENAME = '#GRADENAME#',
        T.MODEL_CODE = '#MODEL_CODE#',
        T.MODEL_DESC = '#MODEL_DESC#',
        T.MIN_D = '#MIN_D#',
        T.MAX_D = '#MAX_D#',
        T.MIN_H = '#MIN_H#',
        T.MAX_H = '#MAX_H#',
        T.MIN_D_SIGN = '#MIN_D_SIGN#',
        T.MAX_D_SIGN = '#MAX_D_SIGN#',
        T.MIN_H_SIGN = '#MIN_H_SIGN#',
        T.MAX_H_SIGN = '#MAX_H_SIGN#',
        T.UPDATE_NAME = '#UPDATE_NAME#',
        T.UPDATE_TIME = SYSDATE,
        T.CRAFT_NO = '#CRAFT_NO#'
 WHERE
       T.PK = '#PK#'
        ]]>
    </query>
    <query id="CraftFileLv2CDAL.GetMaxPk" desc="获取最大主键">
        <![CDATA[
SELECT LPAD(NVL(MAX(PK), 0) + 1, 5, '0') MAX_VALUE FROM CRAFT_FILE_LV2_C T
        ]]>
    </query>
    <query id="CraftFileLv2CDAL.Delete" desc="作废">
        <![CDATA[
UPDATE CRAFT_FILE_LV2_C T
   SET
       T.VALIDFLAG = '0',
       T.DELETE_NAME = '#DELETE_NAME#',
       T.DELETE_TIME = SYSDATE
WHERE
       T.PK = '#PK#'
        ]]>
    </query>
    <query id="CraftFileLv2CDAL.DeleteByFileLv2Pk" desc="作废">
        <![CDATA[
UPDATE CRAFT_FILE_LV2_C T
   SET
       T.VALIDFLAG = '0',
       T.DELETE_NAME = '#DELETE_NAME#',
       T.DELETE_TIME = SYSDATE
WHERE
       T.FILE_LV2_PK = '#PK#'
        ]]>
    </query>
    <query id="CraftFileLv2CDAL.Resume" desc="恢复">
        <![CDATA[
UPDATE CRAFT_FILE_LV2_C T
   SET
       T.VALIDFLAG = '1',
       T.DELETE_NAME = NULL,
       T.DELETE_TIME = NULL,
       T.UPDATE_NAME = '#UPDATE_NAME#',
       T.UPDATE_TIME = SYSDATE
WHERE
       T.PK = '#PK#'
        ]]>
    </query>
     <query id="CraftFileLv2CDAL.ResumeByFileLv2Pk" desc="恢复">
        <![CDATA[
UPDATE CRAFT_FILE_LV2_C T
   SET
       T.VALIDFLAG = '1',
       T.DELETE_NAME = NULL,
       T.DELETE_TIME = NULL,
       T.UPDATE_NAME = '#UPDATE_NAME#',
       T.UPDATE_TIME = SYSDATE
WHERE
       T.FILE_LV2_PK = '#PK#'
        ]]>
    </query>
</queryMap>