<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="QCM_ZBS_TEMPLATE_R_MSC_SPEC">
    <query id="QcmZbsTemplateRMscSpecDAL.Query" desc="查询">
        <![CDATA[
 SELECT T.PRIMARY_KEY,
       T.MIN_D_SIGN,
       T.MIN_D,
       T.MAX_D_SIGN,
       T.MAX_D,
       T.MIN_H_SIGN,
       T.MIN_H,
       T.MAX_H_SIGN,
       T.MAX_H,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.SPEC_JG,
       T.SPEC_JG_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.DELETE_NAME,
       TO_CHAR(T.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       DECODE(T.VALIDFLAG, '0', '无效', '1', '有效') VALIDFLAG,
       T.MEMO
  FROM QCM_ZBS_TEMPLATE_R_MSC_SPEC T, QCM_ZBS_TEMPLATE_R_MSC A
 WHERE T.TEMPLATE_R_MSC_PK = A.PRIMARY_KEY
   AND A.PRIMARY_KEY = '#PRIMARY_KEY#'
   AND A.VALIDFLAG IN ('1', '#VALIDFLAG#')
   AND T.VALIDFLAG IN ('1', '#VALIDFLAG#')
        ]]>
    </query>
    <query id="QcmZbsTemplateRMscSpecDAL.QueryByPk" desc="通过主键查询">
        <![CDATA[
 SELECT 
       T.XH,
       T.MIN_D_SIGN,
       T.MIN_D,
       T.MAX_D_SIGN,
       T.MAX_D,
       T.MIN_H_SIGN,
       T.MIN_H,
       T.MAX_H_SIGN,
       T.MAX_H,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.SPEC_JG,
       T.SPEC_JG_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.DELETE_NAME,
       TO_CHAR(T.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       T.VALIDFLAG,
       T.MEMO
 FROM QCM_ZBS_TEMPLATE_R_MSC_SPEC T
 WHERE
       T.PRIMARY_KEY = '#PRIMARY_KEY#'
        ]]>
    </query>
    <query id="QcmZbsTemplateRMscSpecDAL.Insert" desc="新增">
        <![CDATA[
 INSERT INTO QCM_ZBS_TEMPLATE_R_MSC_SPEC(
        MIN_D_SIGN,
        MIN_D,
        MAX_D_SIGN,
        MAX_D,
        MIN_H_SIGN,
        MIN_H,
        MAX_H_SIGN,
        MAX_H,
        MODEL_CODE,
        MODEL_DESC,
        SPEC_JG,
        SPEC_JG_DESC,
        CREATE_NAME,
        CREATE_TIME,
        MEMO,
        PRIMARY_KEY,
        TEMPLATE_R_MSC_PK)
 VALUES( 
        '#MIN_D_SIGN#',
        '#MIN_D#',
        '#MAX_D_SIGN#',
        '#MAX_D#',
        '#MIN_H_SIGN#',
        '#MIN_H#',
        '#MAX_H_SIGN#',
        '#MAX_H#',
        '#MODEL_CODE#',
        '#MODEL_DESC#',
        '#SPEC_JG#',
        '#SPEC_JG_DESC#',
        '#CREATE_NAME#',
        SYSDATE,
        '#MEMO#',
        '#PRIMARY_KEY#',
        '#TEMPLATE_R_MSC_PK#')
        ]]>
    </query>
    <query id="QcmZbsTemplateRMscSpecDAL.Update" desc="修改">
        <![CDATA[
 UPDATE QCM_ZBS_TEMPLATE_R_MSC_SPEC T
   SET 
        T.MIN_D_SIGN = '#MIN_D_SIGN#',
        T.MIN_D = '#MIN_D#',
        T.MAX_D_SIGN = '#MAX_D_SIGN#',
        T.MAX_D = '#MAX_D#',
        T.MIN_H_SIGN = '#MIN_H_SIGN#',
        T.MIN_H = '#MIN_H#',
        T.MAX_H_SIGN = '#MAX_H_SIGN#',
        T.MAX_H = '#MAX_H#',
        T.MODEL_CODE = '#MODEL_CODE#',
        T.MODEL_DESC = '#MODEL_DESC#',
        T.SPEC_JG = '#SPEC_JG#',
        T.SPEC_JG_DESC = '#SPEC_JG_DESC#',
        T.UPDATE_NAME = '#UPDATE_NAME#',
        T.UPDATE_TIME = SYSDATE,
        T.MEMO = '#MEMO#'
 WHERE
       T.PRIMARY_KEY = '#PRIMARY_KEY#'
        ]]>
    </query>
    <query id="QcmZbsTemplateRMscSpecDAL.GetMaxPk" desc="获取最大主键">
        <![CDATA[
SELECT NVL(MAX(T.PRIMARY_KEY), 0) + 1 MAX_VALUE FROM QCM_ZBS_TEMPLATE_R_MSC_SPEC T
        ]]>
    </query>
    <query id="QcmZbsTemplateRMscSpecDAL.Delete" desc="作废">
        <![CDATA[
UPDATE QCM_ZBS_TEMPLATE_R_MSC_SPEC T
   SET
       T.VALIDFLAG = '0',
       T.DELETE_NAME = '#DELETE_NAME#',
       T.DELETE_TIME = SYSDATE
WHERE
       T.PRIMARY_KEY = '#PRIMARY_KEY#'
        ]]>
    </query>
    <query id="QcmZbsTemplateRMscSpecDAL.DeleteByParentPk" desc="作废">
        <![CDATA[
UPDATE QCM_ZBS_TEMPLATE_R_MSC_SPEC T
   SET
       T.VALIDFLAG = '0',
       T.DELETE_NAME = '#DELETE_NAME#',
       T.DELETE_TIME = SYSDATE
WHERE
       T.TEMPLATE_R_MSC_PK = '#PRIMARY_KEY#'
        ]]>
    </query>
    <query id="QcmZbsTemplateRMscSpecDAL.Resume" desc="恢复">
        <![CDATA[
UPDATE QCM_ZBS_TEMPLATE_R_MSC_SPEC T
   SET
       T.VALIDFLAG = '1',
       T.DELETE_NAME = NULL,
       T.DELETE_TIME = NULL,
       T.UPDATE_NAME = '#UPDATE_NAME#',
       T.UPDATE_TIME = SYSDATE
WHERE
       T.PRIMARY_KEY = '#PRIMARY_KEY#'
        ]]>
    </query>
</queryMap>