<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="状态明细">

	<query id="IStatusDao.addDesignStsTklg" desc="增加质量设计合同行">
         <![CDATA[
        insert into slm_ord_design_sts_tklg
                    (desgin_key,ord_ln_pk,design_sts,prdcyc_meet,
                     validflag,create_name,create_time,update_name,
                     update_time,delete_name,delete_time)
             values
                    (?,?,'W','W','1',?,sysdate,null,null,null,null)
         ]]>
	</query>

	<query id="IStatusDao.updateDesignStsTklg" desc="修改质量设计合同行">
         <![CDATA[
       update slm_ord_design_sts_tklg
          set design_sts  = ?,prdcyc_meet = ?,update_name = ?,update_time =sysdate
        where desgin_key = ?
         ]]>
	</query>

	<query id="IStatusDao.addDesignStatus" desc="增加质量设计明细">
         <![CDATA[
    INSERT INTO SLM_ORD_DESIGN_STS_TKLG_LST(
        DESGIN_KEY,
        ORD_LN_PK,
        SEQ_INDEX,
        LST_ITEM,
        DESIGN_STS,
        DESIGN_STS_RS,
        DESIGN_STS_DESC,
        PSC,
        MSC,
        USE_CODE,
        FINAL_USER,
        GRADECODE,
        DESIGN_OBJ_KEY,
        UNIT_CODE,
        UNIT_DESC,
        VALIDFLAG,
        CREATE_NAME,
        CREATE_TIME,
        UPDATE_NAME,
        UPDATE_TIME,
        DELETE_NAME,
        DELETE_TIME)
 VALUES( 
        '#DESGIN_KEY#',
        '#ORD_LN_PK#',
        '#SEQ_INDEX#',
        '#LST_ITEM#',
        '#DESIGN_STS#',
        '#DESIGN_STS_RS#',
        '#DESIGN_STS_DESC#',
        '#PSC#',
        '#MSC#',
        '#USE_CODE#',
        '#FINAL_USER#',
        '#GRADECODE#',
        '#DESIGN_OBJ_KEY#',
        '#UNIT_CODE#',
        '#UNIT_DESC#',
        DEFAULT,
        '#CREATE_NAME#',
        SYSDATE,
        NULL,
        NULL,
        NULL,
        NULL)
         ]]>
	</query>

	<query id="IStatusDao.updateDesignStatus" desc="修改质量设计明细">
         <![CDATA[
   UPDATE SLM_ORD_DESIGN_STS_TKLG_LST
   SET DESIGN_STS      = ?,
       DESIGN_STS_RS   = ?,
       DESIGN_STS_DESC = ?,
       MSC             = ?,
       USE_CODE        = ?,
       GRADECODE       = ?,
       DESIGN_OBJ_KEY  = ?,
       UNIT_CODE       = ?,
       UNIT_DESC       = ?,
       UPDATE_NAME     = ?,
       UPDATE_TIME     = NULL,
       PSC             = ?
 WHERE DESGIN_KEY = ?
   AND ORD_LN_PK = ?
   AND LST_ITEM = ?
         ]]>
	</query>

	<query id="IStatusDao.getDesignStatus" desc="查詢质量设计明细">
         <![CDATA[
   select desgin_key,
       ord_pk,
       ord_ln_pk,
       lst_item,
       design_sts,
       design_sts_rs,
       unit_code,
       unit_desc,
       validflag,
       create_name,
       create_time,
       update_name,
       update_time,
       delete_name,
       delete_time
  from slm_ord_design_sts_tklg_lst a
 where a.desgin_key = ?
   and a.ord_pk = ?
   and a.ord_ln_pk = ?
   and a.lst_item = ?
         ]]>
	</query>
</queryMap>