<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="加工打捆实绩">
	<query id="FrmBundingResult.getQueryExpandResult" desc="查打捆实绩">
        <![CDATA[
    SELECT *
  FROM MCH_BUNDLING_RESULT T
 WHERE T.HEAT_PLAN_NO = ? AND BATCH_NO =?
        ]]>
	</query>


	<query id="FrmBundingResult.queryResultNo" desc="查询实绩最大实绩编号">
		<![CDATA[
		  SELECT ? || TO_CHAR(SYSDATE, 'yyyyMMDD') ||
         LPAD(NVL(MAX(TO_NUMBER(SUBSTR(RESULT_NO, LENGTH(RESULT_NO) - 5))),
                  0) + 1,
              6,
              '0') RESULT_NO
    FROM  MCH_BUNDLING_RESULT
   WHERE RESULT_NO LIKE ? || TO_CHAR(SYSDATE, 'yyyyMMDD') || '______'
			]]>
	</query>

	<query id="FrmBundingResult.AddResult" desc="增加实绩">
		<![CDATA[

   INSERT INTO MCH_BUNDLING_RESULT
     (RESULT_NO,
      HEAT_PLAN_NO,
      BATCH_NO,
      PLINE_CODE,
      PLINE_NAME,
      IF_MONITOR_RCL,
      PRDCR_NO,
      PRODUCER,
      PRODUCER_TIME,
      BUNDLING_NUM,
      PRO_NUM,
      PRO_WT,
      FAIL_NUM,
      FAIL_WT,
      PRO_SHIFT,
      PRO_GROUP,
      PRO_USER,
      PRO_TIME,
      JUDGE_STOVE_NO,MEMO,BUNDING_TYPE_CODE,BUNDING_TYPE_NAME,BUNDING_PER_NUM,INCLUDE_SHORT)
   VALUES
     ('#RESULT_NO#',
      '#HEAT_PLAN_NO#',
      '#BATCH_NO#',
      '#PLINE_CODE#',
      '#PLINE_NAME#',
      '#IF_MONITOR_RCL#',
      '#PRDCR_NO#',
      '#PRODUCER#',
      '#PRODUCER_TIME#',
      '#BUNDLING_NUM#',
      '#PRO_NUM#',
      '#PRO_WT#',
      '#FAIL_NUM#',
      '#FAIL_WT#',
      '#PRO_SHIFT#',
      '#PRO_GROUP#',
      '#PRO_USER#',
      TO_DATE('#PRO_TIME#', 'YYYY-MM-DD HH24:MI:SS'),
      '#JUDGE_STOVE_NO#','#MEMO#','#BUNDING_TYPE_CODE#','#BUNDING_TYPE_NAME#','#BUNDING_PER_NUM#','#INCLUDE_SHORT#')
			]]>
	</query>


	<query id="FrmBundingResult.DeleteResult" desc="删除实绩">
		<![CDATA[
DELETE FROM MCH_BUNDLING_RESULT WHERE RESULT_NO =?

			]]>
	</query>


</queryMap>