<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="">

    <query id="IMscDao.getMsc" desc="查询冶金规范根据产品码">
         <![CDATA[
     SELECT MSC, MSC_DESC, USE_CODE, USE_DESC, DEPARTMENT_CODE, DEPARTMENT_DESC, UNIT_CODE,
            UNIT_DESC, MSC_STYLE, USER_COUNT, PRODUCCODE, PRODUCNAME, STD_CODE, STD_NAME,
            STEELCODE,STEELNAME, STD_STYLE, STD_STYLE_DESC, NEW_PROC_CODE, NEW_PROC_DESC,
            ALLOW_NK, MSC_SEQ,MSC_DESC_SEQ, CREATE_NAME, CREATE_TIME, UPDATE_NAME, UPDATE_TIME,
            DELETE_NAME, DELETE_TIME,VALIDFLAG, MEMO, FILE_JPEG, PRODUC_HEAD, UNIT_CODE_PROCESS,
            UNIT_DESC_PROCESS, MSC_OLD, USE_CODE_OLD, REMARK, AUDIT_NAME, AUDIT_TIME,
            VALIDFLAG_NK, AUDIT_NAME_NK, AUDIT_TIME_NK, REMARK_NK
       FROM COM_MSC T 
      WHERE T.MSC=?
         ]]>
	</query>
	
	<query id="IMscDao.getMscByPsc" desc="根据产品码查询有效冶金规范码">
         <![CDATA[
   SELECT A.MSC
     FROM COM_MSC A
     JOIN COM_PSC_R_MSC B
       ON A.MSC = B.MSC
    WHERE B.PSC = ?
      AND TRIM(A.MSC_SEQ) IS NULL
      AND A.VALIDFLAG != 'D'
         ]]>
	</query>
	
	
	<query id="IMscDao.updateMscStatus" desc="修改MSC设计明细">
         <![CDATA[
  UPDATE SLM_ORD_DESIGN_STS_TKLG_LST
   SET DESIGN_STS = ?,
       DESIGN_STS_RS   = ?,
       DESIGN_STS_DESC = ?,
       MSC             = ?,
       DESIGN_OBJ_KEY  = ?,
       UNIT_CODE       = ?,
       UNIT_DESC       = ?
 WHERE DESGIN_KEY = ?
   AND ORD_LN_PK = ?
   AND LST_ITEM = ?
         ]]>
	</query>
	
	<query id="IMscDao.getPscUnit" desc="根据产品码管理科室">
         <![CDATA[
  SELECT UNIT_CODE, UNIT_DESC
  FROM COM_PSC T
 WHERE T.PSC = ?
   AND T.VALIDFLAG = 1
         ]]>
	</query>
	
	<query id="IMscDao.updateDesignMsc" desc="修改质量设计MSC">
         <![CDATA[
  UPDATE SLM_ORD_DESIGN_MSC
     SET MSC = ?, MSC_DESC = ?, MSC_STYLE = ?
   WHERE DESGIN_KEY = ?
         ]]>
	</query>
	
</queryMap>