<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="检验报告">
	
	<query id="QcmJyTestReport.AddTestReport" desc="新增检测报告">
	<![CDATA[
		INSERT INTO QCM_JY_VISUAL_REPORT 
		(ORDER_NO,
		ITEMS,
		STANDARD,
		RESULT,
		INSTRUMENT_MODEL,
		CREATE_NAME,
		CREATE_TIME,
		UPDATE_NAME,
		UPDATE_TIME, 
		 REPORTED,
         APPROVED,
         REMARKS)
		VALUES(?,?,?,?,?,?,SYSDATE,null,null,?,?,?)
	]]>
	</query>
	
	<query id="QcmJyTestReport.UpdateTestReport" desc="修改检测报告">
	<![CDATA[
		UPDATE QCM_JY_VISUAL_REPORT Q
		SET
		    Q.STANDARD = ?,
		    Q.RESULT = ?,
		    Q.INSTRUMENT_MODEL = ?,
		    Q.UPDATE_NAME = ?,
		    Q.UPDATE_TIME  = SYSDATE
		 WHERE Q.ORDER_NO = ? AND Q.ITEMS = ?
	]]>
	</query>
	<query id="QcmJyTestReport.UpdateTestReport2" desc="修改检测报告">
	<![CDATA[
		UPDATE QCM_JY_VISUAL_REPORT Q
		SET
		    Q.REPORTED =?,
        	Q.APPROVED =?,
        	Q.REMARKS =?
		 WHERE Q.ORDER_NO = ?
	]]>
	</query>
		
	<query id = "QcmJyQueryFrm.deleteTestReport" desc = "删除">
	<![CDATA[
	DELETE FROM QCM_JY_VISUAL_REPORT Q WHERE Q.ORDER_NO = ? AND Q.ITEMS = ?
	]]>
	</query>

	<query id = "QcmJyTestReport.selectReportName" desc = "根据合同号 、项目  查询是否已有数据">
	<![CDATA[
	select count(1) acount
	  from QCM_JY_VISUAL_REPORT q
	 WHERE q.order_no = ?
	   and q.items = ?
	]]>
	</query>

	
	<query id='QcmJyQueryFrm.FindItemsList' desc="查询Items项目列">
	<![CDATA[
		select t.basename ITEMS from COM_BASE_INFO t WHERE T.SORTCODE = '4112'
	]]>
	</query>
	
	<query id='QcmJyQueryFrm.FindTestReport' desc="查询检测报告">
	<![CDATA[
	SELECT ORDER_NO,
         ITEMS,
         STANDARD,
         RESULT,
         INSTRUMENT_MODEL,
         CREATE_NAME,
         TO_CHAR(CREATE_TIME,
         'YYYY-MM-DD HH24:MI:SS') CREATE_TIME, UPDATE_NAME, 
         TO_CHAR(UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
         REPORTED,
         APPROVED,
         REMARKS
FROM QCM_JY_VISUAL_REPORT 
 WHERE 1=1
  ]]>
</query>
	
</queryMap>