<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="接箍磷化检测实绩">
<!-- 
	<query id="CoupThreadingService.ProcessPlan.SingleQuery" desc="作业计划简单查询">
        <![CDATA[
         SELECT T.plan_no, T.HEAT_NO, T.BATCH_NO, T.PLANSTATUS
		   FROM PLN_ZY_JG_PROCESS T
		  WHERE T.PLAN_TIME BETWEEN TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS') AND
		        TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')
		    AND T.LOT_NO || '&' LIKE '%' || ? || '%'
		    AND T.HEAT_NO || '&' LIKE '%' || ? || '%'
		    AND T.BATCH_NO || '&' LIKE '%' || ? || '%'
		    
        ]]>
	</query>
 -->	
	
	<query id="PhosphateResultService.ProcessPlan.CoupProcessPlan" desc="作业计划查询">
        <![CDATA[
         SELECT T.PLINE_CODE, T.LOT_NO,  T.HEAT_NO, T.BATCH_NO,T.IF_MONITOR_JG,
         T.PLAN_TIME,T.PLAN_USETIME
		   FROM PLN_ZY_JG_PROCESS T 
		  WHERE T.COUPCUT_BATCH_ID in (?)
		    
        ]]>
	</query>
	
	<query id="PhosphateResultService.ProcessPlan.CoupProcessItem" desc="检测项配置表查询">
        <![CDATA[
         select T.PROCEDUR_NO,T.TEST_ITEMS,T.SPAN,T.SETTING_TEMPERATURE,T.ITEM_NO,T.PLINE_CODE 
			from COUPLING_PHOSPHATE_ITEM T
        ]]>
	</query>
	
	<query id="PhosphateResultService.ProcessPlan.CoupProcessRD" desc="接箍磷化检验结果表查询">
        <![CDATA[
         select T.DETAIL_NO,T.ITEM_NO,T.TEST_RESULT_F,T.TEST_RESULT_T,T.DOSAGE,T.TEMPERATURE
			from COUPLING_PHOSPHATE_RESULT_D T
			WHERE T.RESULT_NO=?
        ]]>
	</query>
	
	<query id="PhosphateResultService.ProcessPlan.AddCoupProcessRD" desc="新增接箍磷化检验结果">
        <![CDATA[
         INSERT INTO COUPLING_PHOSPHATE_RESULT_D
                    (ITEM_NO,
                    TEST_RESULT_F,
                    TEST_RESULT_T,
                    DOSAGE,
                    TEMPERATURE,
                    RESULT_NO,
                    DETAIL_NO)
            VALUES
                   (?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?)
        ]]>
	</query>
	
	<query id="PhosphateResultService.ProcessPlan.UpdateCoupProcessRD" desc="修改接箍磷化检验结果">
		<![CDATA[
			 UPDATE COUPLING_PHOSPHATE_RESULT_D set
							ITEM_NO=?, 
							TEST_RESULT_F=?,
							TEST_RESULT_T=?,
							DOSAGE=?,
							TEMPERATURE=?
							WHERE RESULT_NO =? and DETAIL_NO=?
		]]>
	</query>
	
	<query id="PhosphateResultService.ProcessPlan.GetPhosphateResultAndCoupPlan" desc="作业计划和实绩查询">
        <![CDATA[
         SELECT T.PLINE_CODE, T.LOT_NO,  T.HEAT_NO, T.BATCH_NO,T.IF_MONITOR_JG,
         T.PLAN_TIME,T.PLAN_USETIME,
        	C.MEMBRANCE_THICK,
         		C.ADHESION,
               	C.ANTI_CORROSION,
                    C.REACTION_TIME,
                    C.SURFACE_CONDITION,
                    C.PRODUCER,
                    C.PRODUCER_TIME,
                    C.COL_SHIFT,
                    C.COL_GROUP,
                    C.COL_USER,
                    C.COL_TIME
		   FROM PLN_ZY_JG_PROCESS T,COUPLING_PHOSPHATE_RESULT C
		  WHERE T.COUPCUT_BATCH_ID =?
		  and C.PLAN_NO = T.COUPCUT_BATCH_ID
		    
        ]]>
	</query>

	
	<query id="PhosphateResultService.ProcessPlan.GetPhosphateResult" desc="根据计划号查询磷化检测实绩">
        <![CDATA[
         SELECT MEMBRANCE_THICK,
         		ADHESION,
                ANTI_CORROSION,
                    REACTION_TIME,
                    SURFACE_CONDITION,
                    PRODUCER,
                    PRODUCER_TIME,
                    COL_SHIFT,
                    COL_GROUP,
                    COL_USER,
                    COL_TIME
		   FROM COUPLING_PHOSPHATE_RESULT
		  WHERE PLAN_NO = ?
		    
        ]]>
	</query>
	
	<query id="PhosphateResultService.ProcessPlan.UpdatePhosphateResult" desc="修改">
		<![CDATA[
			 UPDATE COUPLING_PHOSPHATE_RESULT set
							MEMBRANCE_THICK=?, 
							ADHESION=?, 
							ANTI_CORROSION=?,
							REACTION_TIME=?,
							SURFACE_CONDITION=?,
							PRODUCER=?,
							PRODUCER_TIME=TO_DATE(?, 'yyyy-mm-dd hh24:mi:ss'),
							COL_SHIFT=?,
                    		COL_GROUP=?,
                    		COL_USER=?,
                    		COL_TIME=TO_DATE(?, 'yyyy-mm-dd hh24:mi:ss'),
                    		PLINE_CODE=?
							WHERE PLAN_NO =?
		]]>
	</query>
	
	<query id="PhosphateResultService.ProcessPlan.AddPhosphateResult" desc="新增磷化检测实绩">
        <![CDATA[
         INSERT INTO COUPLING_PHOSPHATE_RESULT
                    (RESULT_NO,
                    MEMBRANCE_THICK,
                    ADHESION,
                    ANTI_CORROSION,
                    REACTION_TIME,
                    SURFACE_CONDITION,
                    PRODUCER,
                    PRODUCER_TIME,
                    COL_SHIFT,
                    COL_GROUP,
                    COL_USER,
                    COL_TIME,
                    PLINE_CODE,
                    PLAN_NO)
            VALUES
                   (COUPLING_RESULT_SEQUENCE.Nextval,
                   	?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?,
                    TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),
                    ?,
                    ?,
                    ?,
                    TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),
                    ?,
                    ?)
		    
        ]]>
	</query>
</queryMap>