<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="">
	<query id="FrmReportDefault.Query" desc="">
		<![CDATA[
           SELECT * FROM HTT_REPORT_DEFAULT T WHERE PLINE_CODE = ?  AND REPORT_NO = NVL(?,T.REPORT_NO)
           ORDER BY  PLINE_CODE,REPORT_NO, COLUMN_VISIBLE DESC,ORIGIN_X,ORIGIN_Y,REPORT_COLUMN
	  ]]>
	</query>


	<query id="FrmReportDefault.Query1" desc="">
		<![CDATA[
           SELECT * FROM HTT_REPORT_DEFAULT T WHERE PLINE_CODE = ?  AND REPORT_NO = NVL(?,T.REPORT_NO)  AND MACHINE_NO =  NVL(?,T.MACHINE_NO)
           ORDER BY  PLINE_CODE,REPORT_NO, COLUMN_VISIBLE DESC,ORIGIN_X,ORIGIN_Y, REPORT_COLUMN
	  ]]>
	</query>

	<query id="FrmReportDefault.QueryAll" desc="">
		<![CDATA[
          SELECT DISTINCT pline_code,NVL((SELECT pline_name FROM Com_Base_Pline WHERE pline_code=t.pline_code),'默认') pline_name,  report_no,machine_no  FROM htt_report_default t ORDER BY pline_name,report_no,machine_No
	  ]]>
	</query>


	<query id="FrmReportDefault.UpdateDefault" desc="">
		<![CDATA[
   UPDATE HTT_REPORT_DEFAULT
   SET PLINE_CODE       = '#PLINE_CODE#',
       REPORT_NO        = '#REPORT_NO#',
       REPORT_COLUMN    = '#REPORT_COLUMN#',
       COLUMN_TYPE      = '#COLUMN_TYPE#',
       TEXT_DEFAULT     = '#TEXT_DEFAULT#',
       DROPLIST_DEFULT  = '#DROPLIST_DEFULT#',
       DROPLIST_USED    = '#DROPLIST_USED#',
       REPORT_SEQ       = '#REPORT_SEQ#',
       COLUMN_VISIBLE   = '#COLUMN_VISIBLE#',
       ORIGIN_X         = '#ORIGIN_X#',
       ORIGIN_Y         = '#ORIGIN_Y#',
       SPAN_X           = '#SPAN_X#',
       SPAN_Y           = '#SPAN_Y#',
       CELL_SIZE_WIDTH  = '#CELL_SIZE_WIDTH#',
       CELL_SIZE_HIGH   = '#CELL_SIZE_HIGH#',
       LABEL_SIZE_WIDTH = '#LABEL_SIZE_WIDTH#',
       LABEL_SIZE_HIGH  = '#LABEL_SIZE_HIGH#',
       CHECK_NULL = '#CHECK_NULL#'
 WHERE PLINE_CODE = '#PLINE_CODE#'
   AND REPORT_NO = '#REPORT_NO#'
   AND REPORT_COLUMN = '#REPORT_COLUMN#'
   AND MACHINE_NO = '#MACHINE_NO#'
	  ]]>
	</query>

	<query id="FrmReportDefault.AddDefault" desc="">
		<![CDATA[
INSERT INTO HTT_REPORT_DEFAULT
  (PLINE_CODE,
   REPORT_NO,
   REPORT_COLUMN,
   COLUMN_TYPE,
   TEXT_DEFAULT,
   DROPLIST_DEFULT,
   DROPLIST_USED,
   REPORT_SEQ,
   COLUMN_VISIBLE,
   ORIGIN_X,
   ORIGIN_Y,
   SPAN_X,
   SPAN_Y,
   CELL_SIZE_WIDTH,
   CELL_SIZE_HIGH,
   LABEL_SIZE_WIDTH,
   LABEL_SIZE_HIGH,
   CHECK_NULL,
   MACHINE_NO)
VALUES
  ('#PLINE_CODE#',
   '#REPORT_NO#',
   '#REPORT_COLUMN#',
   '#COLUMN_TYPE#',
   '#TEXT_DEFAULT#',
   '#DROPLIST_DEFULT#',
   '#DROPLIST_USED#',
   '#REPORT_SEQ#',
   '#COLUMN_VISIBLE#',
   '#ORIGIN_X#',
   '#ORIGIN_Y#',
   '#SPAN_X#',
   '#SPAN_Y#',
   '#CELL_SIZE_WIDTH#',
   '#CELL_SIZE_HIGH#',
   '#LABEL_SIZE_WIDTH#',
   '#LABEL_SIZE_HIGH#',
   '#CHECK_NULL#',
   '#MACHINE_NO#')

	  ]]>
	</query>

	<query id="FrmReportDefault.DeleteDefault" desc="">
		<![CDATA[
   DELETE FROM HTT_REPORT_DEFAULT
 WHERE PLINE_CODE = '#PLINE_CODE#'
   AND REPORT_NO = '#REPORT_NO#'
   AND REPORT_COLUMN = '#REPORT_COLUMN#'
	  ]]>
	</query>


	<query id="FrmReportDefault.DeleteDefault1" desc="">
		<![CDATA[
   DELETE FROM HTT_REPORT_DEFAULT
 WHERE PLINE_CODE = ?
   AND REPORT_NO = ?
   AND MACHINE_NO = ?
	  ]]>
	</query>

	<query id="FrmReportDefault.Copy" desc="">
		<![CDATA[
   INSERT INTO HTT_REPORT_DEFAULT
  (PLINE_CODE,
   REPORT_NO,
   REPORT_COLUMN,
   COLUMN_TYPE,
   TEXT_DEFAULT,
   DROPLIST_DEFULT,
   DROPLIST_USED,
   REPORT_SEQ,
   COLUMN_VISIBLE,
   ORIGIN_X,
   ORIGIN_Y,
   SPAN_X,
   SPAN_Y,
   CELL_SIZE_WIDTH,
   CELL_SIZE_HIGH,
   LABEL_SIZE_WIDTH,
   LABEL_SIZE_HIGH,
   CHECK_NULL,
   MACHINE_NO)
  SELECT ?,
         ?,
         REPORT_COLUMN,
         COLUMN_TYPE,
         TEXT_DEFAULT,
         DROPLIST_DEFULT,
         DROPLIST_USED,
         REPORT_SEQ,
         COLUMN_VISIBLE,
         ORIGIN_X,
         ORIGIN_Y,
         SPAN_X,
         SPAN_Y,
         CELL_SIZE_WIDTH,
         CELL_SIZE_HIGH,
         LABEL_SIZE_WIDTH,
         LABEL_SIZE_HIGH,
         CHECK_NULL,
         ?
    FROM HTT_REPORT_DEFAULT
    WHERE PLINE_CODE = ?
    AND REPORT_NO =?
    AND MACHINE_NO =?

	  ]]>
	</query>




	<query id="FrmReportDefault.getReportColumns" desc="">
		<![CDATA[
SELECT  REPLACE(UT.COLUMN_NAME,'_ID','_NAME') COLUMN_NAME , REPLACE(UC.COMMENTS,'ID','') COMMENTS
  FROM USER_TAB_COLUMNS UT
 INNER JOIN USER_COL_COMMENTS UC
    ON UT.TABLE_NAME = UC.TABLE_NAME
   AND UT.COLUMN_NAME = UC.COLUMN_NAME
 WHERE UT.TABLE_NAME = 'HTT_CRACK_DETECTION_PARA'
   AND UT.COLUMN_NAME NOT IN ('HEAT_PLAN_NO',
                             'JUDGE_STOVE_NO',
                             'BATCH_NO',
                             'REPORT_NO',
                             'SHIFT',
                             'PRO_DATE',
                             'CREATE_DATE',
                             'REPORT_PATH',
                             'RESULT_NO')
 ORDER BY UC.COLUMN_NAME
		]]>
	</query>

</queryMap>