<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="镦拔扩产线能力">

	<query id="FrmBaseMaterialEPl.getBaseMaterialE" desc="查询基础镦拔扩物料">
             <![CDATA[
               SELECT T.IN_MATERIAL_NO,T.IN_MATERIAL_DESC,T.OUT_MATERIAL_NO,T.OUT_MATERIAL_DESC FROM SLM_BASE_MATERIAL_E T 
               WHERE T.IN_MATERIAL_NO=? AND T.OUT_MATERIAL_NO=?
                 ]]>
	</query>

	<query id="FrmBaseMaterialEPl.getBaseMaterialEPl" desc="查询镦拔扩物料产线能力">
             <![CDATA[
               SELECT T1.IN_MATERIAL_NO,
       T2.IN_MATERIAL_DESC,
       T1.OUT_MATERIAL_NO,
       T2.OUT_MATERIAL_DESC,
       T1.PLINE_CODE,
       T1.PLINE_NAME,
       T1.HR_CAPCTY,
       T1.PRD_RATE,
       DECODE(T1.DISABLE_FL,'1','True','False') DISABLE_FL,
       T1.CROP_HEAD,
       T1.CROP_END,
       T1.WASTE_RATE,
       DECODE(T1.AUDIT_FLAG,'0','无效','1','未审核','2','已生效') AUDIT_FLAG,
       T1.CREATE_NAME,
       TO_CHAR(T1.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T1.UPDATE_NAME,
       TO_CHAR(T1.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       T1.DELETE_NAME,
       TO_CHAR(T1.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       T1.UPSETTING_LENGTH,
       T1.PLINE_LEVEL
  FROM SLM_BASE_MATERIAL_E_PL T1, SLM_BASE_MATERIAL_E T2
 WHERE T1.IN_MATERIAL_NO = T2.IN_MATERIAL_NO
   AND T1.OUT_MATERIAL_NO = T2.OUT_MATERIAL_NO
   AND T1.IN_MATERIAL_NO = ?
   AND T1.OUT_MATERIAL_NO = ?

                 ]]>
	</query>

	<query id="FrmBaseMaterialEPl.updateBaseMaterialEPl" desc="修改镦拔扩物料产线能力">
             <![CDATA[
               UPDATE SLM_BASE_MATERIAL_E_PL T
   SET T.HR_CAPCTY        = '#HR_CAPCTY#',
       T.PRD_RATE         = '#PRD_RATE#',
       T.DISABLE_FL       = '#DISABLE_FL#',
       T.CROP_HEAD        = '#CROP_HEAD#',
       T.CROP_END         = '#CROP_END#',
       T.WASTE_RATE       = '#WASTE_RATE#',
       T.UPDATE_NAME      = '#UPDATE_NAME#',
       T.UPDATE_TIME      = SYSDATE,
       T.UPSETTING_LENGTH = '#UPSETTING_LENGTH#',
       T.PLINE_LEVEL      = '#PLINE_LEVEL#'
 WHERE T.IN_MATERIAL_NO = '#IN_MATERIAL_NO#'
   AND T.OUT_MATERIAL_NO = '#OUT_MATERIAL_NO#'
   AND T.PLINE_CODE = '#PLINE_CODE#'
                 ]]>
	</query>

</queryMap>