<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="螺纹检验报告">
	<query id="QcmJyThreadReport.AddThreadReport" desc="新增检测报告">
	<![CDATA[
		INSERT INTO THREAD_INSPECTION_RECORD(
        ORDER_NO,
        AVALUE_BOX,
        TAPER_BOX,
        LEAD_BOX,
        HEIGHT_BOX,
        ADDENDU_BOX,
        AVG_BOX,
        OVALITY_BOX,
        LENGTH_BOX,
        OD_BOX,
        WT_BOX,
        PVALUE_PIN,
        TAPER_PIN,
        LEAD_PIN,
        HEIGHT_PIN,
        ADDENDU_PIN,
        AVG_PIN,
        OVALITY_PIN,
        WT_PIN,
        LENGTH_PIN,
        THREAD_GAUGE,
        VERNIER_CALIPER,
        DEPTH_CALIPER,
        THICKNESS_GAUGE,
        TAPER_GAUGE,
        TOOTH_HEIGHT_GAUGE,
        ADDENDUM_GAUGE,
        TOP_DIAMETER_GAUGE,
        PITCH_GAUGE,
        OTHER,
        REPORTED,
       	APPROVED,
       	REMARKS)
 VALUES( 
        '#ORDER_NO#',
        '#AVALUE_BOX#',
        '#TAPER_BOX#',
        '#LEAD_BOX#',
        '#HEIGHT_BOX#',
        '#ADDENDU_BOX#',
        '#AVG_BOX#',
        '#OVALITY_BOX#',
        '#LENGTH_BOX#',
        '#OD_BOX#',
        '#WT_BOX#',
        '#PVALUE_PIN#',
        '#TAPER_PIN#',
        '#LEAD_PIN#',
        '#HEIGHT_PIN#',
        '#ADDENDU_PIN#',
        '#AVG_PIN#',
        '#OVALITY_PIN#',
        '#WT_PIN#',
        '#LENGTH_PIN#',
        '#THREAD_GAUGE#',
        '#VERNIER_CALIPER#',
        '#DEPTH_CALIPER#',
        '#THICKNESS_GAUGE#',
        '#TAPER_GAUGE#',
        '#TOOTH_HEIGHT_GAUGE#',
        '#ADDENDUM_GAUGE#',
        '#TOP_DIAMETER_GAUGE#',
        '#PITCH_GAUGE#',
        '#OTHER#',
        '#REPORTED#',
       	'#APPROVED#',
       	'#REMARKS#')
	]]>
	</query>
	
	<query id="QcmJyThreadReport.UpdateThreadReport" desc="修改螺纹检验报告">
	<![CDATA[
		UPDATE THREAD_INSPECTION_RECORD T
   SET 
        T.AVALUE_BOX = '#AVALUE_BOX#',
        T.TAPER_BOX = '#TAPER_BOX#',
        T.LEAD_BOX = '#LEAD_BOX#',
        T.HEIGHT_BOX = '#HEIGHT_BOX#',
        T.ADDENDU_BOX = '#ADDENDU_BOX#',
        T.AVG_BOX = '#AVG_BOX#',
        T.OVALITY_BOX = '#OVALITY_BOX#',
        T.LENGTH_BOX = '#LENGTH_BOX#',
        T.OD_BOX = '#OD_BOX#',
        T.WT_BOX = '#WT_BOX#',
        T.PVALUE_PIN = '#PVALUE_PIN#',
        T.TAPER_PIN = '#TAPER_PIN#',
        T.LEAD_PIN = '#LEAD_PIN#',
        T.HEIGHT_PIN = '#HEIGHT_PIN#',
        T.ADDENDU_PIN = '#ADDENDU_PIN#',
        T.AVG_PIN = '#AVG_PIN#',
        T.OVALITY_PIN = '#OVALITY_PIN#',
        T.WT_PIN = '#WT_PIN#',
        T.LENGTH_PIN = '#LENGTH_PIN#',
        T.THREAD_GAUGE = '#THREAD_GAUGE#',
        T.VERNIER_CALIPER = '#VERNIER_CALIPER#',
        T.DEPTH_CALIPER = '#DEPTH_CALIPER#',
        T.THICKNESS_GAUGE = '#THICKNESS_GAUGE#',
        T.TAPER_GAUGE = '#TAPER_GAUGE#',
        T.TOOTH_HEIGHT_GAUGE = '#TOOTH_HEIGHT_GAUGE#',
        T.ADDENDUM_GAUGE = '#ADDENDUM_GAUGE#',
        T.TOP_DIAMETER_GAUGE = '#TOP_DIAMETER_GAUGE#',
        T.PITCH_GAUGE = '#PITCH_GAUGE#',
        T.OTHER = '#OTHER#',
        T.REPORTED = '#REPORTED#',
       	T.APPROVED = '#APPROVED#',
       	T.REMARKS = '#REMARKS#'
 WHERE 1=1 and ORDER_NO = '#ORDER_NO#'
	]]>
	</query>
		
	<query id = "QcmJyThreadReport.deleteThreadReport" desc = "删除螺纹检验报告">
	<![CDATA[
	DELETE FROM THREAD_INSPECTION_RECORD T WHERE T.ORDER_NO = ?
	]]>
	</query>

	<query id = "QcmJyThreadReport.selectThreadReportInfo" desc = "根据合同号   查询是否已有数据">
	<![CDATA[
	select count(1) acount
	  from THREAD_INSPECTION_RECORD T
	 WHERE T.ORDER_NO = ?
	]]>
	</query>

	
	<query id='QcmJyThreadReport.FindThreadReport' desc="查询螺纹检验报告">
	<![CDATA[
		 SELECT 
       T.ORDER_NO,
       T.AVALUE_BOX,
       T.TAPER_BOX,
       T.LEAD_BOX,
       T.HEIGHT_BOX,
       T.ADDENDU_BOX,
       T.AVG_BOX,
       T.OVALITY_BOX,
       T.LENGTH_BOX,
       T.OD_BOX,
       T.WT_BOX,
       T.PVALUE_PIN,
       T.TAPER_PIN,
       T.LEAD_PIN,
       T.HEIGHT_PIN,
       T.ADDENDU_PIN,
       T.AVG_PIN,
       T.OVALITY_PIN,
       T.WT_PIN,
       T.LENGTH_PIN,
       T.THREAD_GAUGE,
       T.VERNIER_CALIPER,
       T.DEPTH_CALIPER,
       T.THICKNESS_GAUGE,
       T.TAPER_GAUGE,
       T.TOOTH_HEIGHT_GAUGE,
       T.ADDENDUM_GAUGE,
       T.TOP_DIAMETER_GAUGE,
       T.PITCH_GAUGE,
       T.OTHER,
       T.REPORTED,
       T.APPROVED,
       T.REMARKS
       
 FROM THREAD_INSPECTION_RECORD T
 WHERE 1=1 
	  ]]>
	</query>
	
</queryMap>