<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="CRAFT_LG2_CIC （生成工具：代码生成工具4.0   访问地址：http://172.16.2.128/tool/）">
    <query id="CraftLg2CicDAL.Query" desc="查询">
        <![CDATA[
SELECT T.CIC_GID,
       T.XH,
       T.CHEM_CODE,
       T.CHEM_NAME,
       T.CHEM_TYPE,
       DECODE(T.CHEM_TYPE, 'A', '单一元素', 'B', '复合元素') CHEM_TYPE_DESC,
       T.CHEM_FORMULA,
       T.STDMIN_SIGN,
       T.STDMIN,
       T.STDMAX_SIGN,
       T.STDMAX,
       T.STDTARGET,
       T.ELE_CODE,
       T.ELE_NAME,
       T.ELE_MIN_SIGN,
       T.ELE_MIN,
       T.ELE_MAX_SIGN,
       T.ELE_MAX,
       T.MEMO
  FROM CRAFT_LG2_CIC T
  LEFT JOIN COM_BASE_CHEM B
    ON B.CHEM_CODE = T.CHEM_CODE, CRAFT_LG2_M A
 WHERE A.CRAFT_NO = {0}
   AND A.CIC_GID = T.CIC_GID
 ORDER BY B.CHEM_SEQ ASC
        ]]>
    </query>
    <query id="CraftLg2CicDAL.QueryByPk" desc="通过主键查询">
        <![CDATA[
 SELECT 
       T.CIC_GID,
       T.XH,
       T.CHEM_CODE,
       T.CHEM_NAME,
       T.CHEM_TYPE,
       T.CHEM_FORMULA,
       T.STDMIN_SIGN,
       T.STDMIN,
       T.STDMAX_SIGN,
       T.STDMAX,
       T.STDTARGET,
       T.ELE_CODE,
       T.ELE_NAME,
       T.ELE_MIN_SIGN,
       T.ELE_MIN,
       T.ELE_MAX_SIGN,
       T.ELE_MAX,
       T.MEMO
 FROM CRAFT_LG2_CIC T
 WHERE
       T.CIC_GID = '#CIC_GID#'
       AND T.XH = '#XH#'
        ]]>
    </query>
    <query id="CraftLg2CicDAL.Insert" desc="新增">
        <![CDATA[
 INSERT INTO CRAFT_LG2_CIC(
        CIC_GID,
        XH,
        CHEM_CODE,
        CHEM_NAME,
        CHEM_TYPE,
        CHEM_FORMULA,
        STDMIN_SIGN,
        STDMIN,
        STDMAX_SIGN,
        STDMAX,
        STDTARGET,
        ELE_CODE,
        ELE_NAME,
        ELE_MIN_SIGN,
        ELE_MIN,
        ELE_MAX_SIGN,
        ELE_MAX,
        MEMO)
 VALUES( 
        '#CIC_GID#',
        '#XH#',
        '#CHEM_CODE#',
        '#CHEM_NAME#',
        '#CHEM_TYPE#',
        '#CHEM_FORMULA#',
        '#STDMIN_SIGN#',
        '#STDMIN#',
        '#STDMAX_SIGN#',
        '#STDMAX#',
        '#STDTARGET#',
        '#ELE_CODE#',
        '#ELE_NAME#',
        '#ELE_MIN_SIGN#',
        '#ELE_MIN#',
        '#ELE_MAX_SIGN#',
        '#ELE_MAX#',
        '#MEMO#')
        ]]>
    </query>
    <query id="CraftLg2CicDAL.Update" desc="修改">
        <![CDATA[
 UPDATE CRAFT_LG2_CIC T
   SET 
        T.CIC_GID = '#CIC_GID#',
        T.XH = '#XH#',
        T.CHEM_CODE = '#CHEM_CODE#',
        T.CHEM_NAME = '#CHEM_NAME#',
        T.CHEM_TYPE = '#CHEM_TYPE#',
        T.CHEM_FORMULA = '#CHEM_FORMULA#',
        T.STDMIN_SIGN = '#STDMIN_SIGN#',
        T.STDMIN = '#STDMIN#',
        T.STDMAX_SIGN = '#STDMAX_SIGN#',
        T.STDMAX = '#STDMAX#',
        T.STDTARGET = '#STDTARGET#',
        T.ELE_CODE = '#ELE_CODE#',
        T.ELE_NAME = '#ELE_NAME#',
        T.ELE_MIN_SIGN = '#ELE_MIN_SIGN#',
        T.ELE_MIN = '#ELE_MIN#',
        T.ELE_MAX_SIGN = '#ELE_MAX_SIGN#',
        T.ELE_MAX = '#ELE_MAX#',
        T.MEMO = '#MEMO#'
 WHERE
       T.CIC_GID = '#CIC_GID#'
       AND T.XH = '#XH#'
        ]]>
    </query>
    <query id="CraftLg2CicDAL.GetMaxPk" desc="获取最大主键">
        <![CDATA[
SELECT NVL(MAX(CIC_GID), 0) + 1 MAX_VALUE FROM CRAFT_LG2_CIC T
        ]]>
    </query>
    <query id="CraftLg2CicDAL.Delete" desc="作废">
        <![CDATA[
UPDATE CRAFT_LG2_CIC T
   SET
       T.VALIDFLAG = '0',
       T.DELETE_NAME = '#DELETE_NAME#',
       T.DELETE_TIME = SYSDATE
WHERE
       T.CIC_GID = '#CIC_GID#'
       AND T.XH = '#XH#'
        ]]>
    </query>
    <query id="CraftLg2CicDAL.Resume" desc="恢复">
        <![CDATA[
UPDATE CRAFT_LG2_CIC T
   SET
       T.VALIDFLAG = '1',
       T.DELETE_NAME = NULL,
       T.DELETE_TIME = NULL,
       T.UPDATE_NAME = '#UPDATE_NAME#',
       T.UPDATE_TIME = SYSDATE
WHERE
       T.CIC_GID = '#CIC_GID#'
       AND T.XH = '#XH#'
        ]]>
    </query>
</queryMap>