<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="质量设计管理科室">

	<query id="CoreDesignDept.saveDept" desc="保存管理科室">
		<![CDATA[
	 INSERT INTO SLM_ORD_DESIGN_DEPT(
        ORD_LN_PK,
        DEPT_CODE,
        DEPT_DESC,
        DELIVY_DEPT_CODE,
        DELIVY_DEPT_DESC,
        TECH_DEPT_CODE,
        TECH_DEPT_DESC,
        USER_NAME)
 VALUES( 
        '#ORD_LN_PK#',
        '#DEPT_CODE#',
        '#DEPT_DESC#',
        '#DELIVY_DEPT_CODE#',
        '#DELIVY_DEPT_DESC#',
        '#TECH_DEPT_CODE#',
        '#TECH_DEPT_DESC#',
        '#USER_NAME#')
		]]>
	</query>

	<query id="CoreDesignDept.deleteDept" desc="删除管理科室">
		<![CDATA[
	DELETE FROM SLM_ORD_DESIGN_DEPT T WHERE T.ORD_LN_PK=?
		]]>
	</query>
	
	<query id="CoreDesignDept.getMscDept" desc="查询MSC管理科室">
		<![CDATA[
	SELECT B.DEPARTMENT_CODE,
       B.DEPARTMENT_DESC,
       B.UNIT_CODE,
       B.UNIT_DESC,
       B.UNIT_CODE_PROCESS,
       B.UNIT_DESC_PROCESS
  FROM COM_MSC B
 WHERE B.MSC =
       (SELECT A.MSC　FROM SLM_ORDER_LINE A WHERE A.ORD_LN_PK = ? AND A.VALIDFLAG = '1')
   AND B.VALIDFLAG != '0'
		]]>
	</query>

</queryMap>