<?xml version="1.0" encoding="UTF-8"?>

<queryMap desc = "轧管统计">

<query id = "FrmOfflineProcess.JudgeBaseInfo" desc = "查产线">
<![CDATA[
	SELECT T.PLINE_CODE   plineCode,
       T.PLINE_NAME   plineName,
       T.PROCESS_DESC processDesc,
       T2.BASENAME    factoryDesc,
       T3.BASENAME    checkStationDesc
  FROM COM_BASE_PLINE T
  LEFT JOIN COM_BASE_INFO T2
    ON T2.BASECODE = T.FACTORY_CODE
  LEFT JOIN COM_BASE_INFO T3
    ON T3.BASECODE = T.CHECK_STATION
 WHERE T.VALIDFLAG = '1'

 ]]>
</query>

<query id = "FrmOfflineProcess.doAudit" desc = "修改处置方式">
    <![CDATA[
     update OFFLINE_PROCESS set  DISPOSAL_OPINION = ?,IS_AUDIT = ? ,REASON1 = ?,REASON2 =?,REASON3=?
     where RESULT_NO = ?
    ]]>
</query>

<query id = "FrmOfflineProcess.selectByid"> 
  <![CDATA[
     select count(1) acount from   OFFLINE_PROCESS_AUDIT where RESULT_NO = ?
   ]]>
</query>

<query id ="FrmOfflineProcess.QueryOfflineAudits">
 <![CDATA[
   select  t3.ID ,t3.AUDIT_MAN2 审批人,to_char(t3.AUDIT_TIME2, 'yyyy-mm-dd hh24:mi:ss') 审批时间, t3.MEMO2 审批意见,t3.AUDIT_DEP2 审批部门,case when t3.AUDIT_STATE2 = '0' then '等待审批' when t3.AUDIT_STATE2 = '1' then '开始审批' when t3.AUDIT_STATE2 = '2' then '审批通过' when t3.AUDIT_STATE2 = '3' then '审批失败' end 审批状态  from offline_process t1,offline_process_audit t2,offline_process_audit_s t3
    where t1.result_no = t2.result_no
     and t2.id = t3.id
 ]]>
</query>

<query id = "FrmOfflineProcess.doSave">
  update OFFLINE_PROCESS t set t.Reason1 = ? ,t.Reason2 = ?,t.Reason3 = ?,ANALYSIS_RESULTS =?,PLINE_NAME_RESPONSE = ?,DISPOSAL_OPINION = ?,DISPOSAL_OPINION_SCHEDULE=?,memo = ?
  where t.result_no = ?
</query>
<query id = "FrmOfflineProcess。doAddAudit">
<![CDATA[
   insert into OFFLINE_PROCESS_AUDIT (RESULT_NO,AUDIT_MAN1,AUDIT_TIME1,AUDIT_STATE1,AUDIT_DEP1,MEMO1)
   values(?,?,sysdate,?,?,?)
   
 ]]>
</query>

<query id = "FrmOfflineProcess.QueryOfflineProcess" desc = "查询">
<![CDATA[
SELECT T.RESULT_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.STATION_CODE,
       T.STATION_DESC,
       T.HEAT_PLAN_NO,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.BATCH_GROUD_NO,
       T.STOVE_NO,
       T.FLAG_STOVE_NO,
       T.TARGET,
       T.PROCESS_CDOE,
       T.PROCESS_DESC,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.STEELCODE,
       T.STEELNAME,
       T.GRADECODE,
       T.GRADENAME,
       T.SPEC_CODE,
       T.SPEC_NAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.STD_CODE,
       T.STD_NAME,
       T.STD_STYLE,
       T.STD_STYLE_DESC,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.CRAFT_FILE_NO,
       T.CUSTOMER_NO,
       T.CUSTOMER_NM,
       T.OFFLINE_NUM,
       T.OFFLINE_WT,
       T.RE_NUM,
       T.RE_WT,
       T.GROUP_NUM,
       T.GROUP_WT,
       T.SUBCONTRACT_NO,
       T.SUBCONTRACT_NO_SEQ,
       T.SUBCONTRACT_NUM,
       T.SUBCONTRACT_WT,
       TO_CHAR(T.SUBCONTRACT_TIME, 'YYYY-MM-DD HH24:MI:SS') SUBCONTRACT_TIME,
       T.SUBCONTRACT_NAME,
       T.SUBCONTRACTCOMPLETE_NUM,
       T.SUBCONTRACTCOMPLETE_WT,
       T.HB_FP_NUM,
       T.HB_FP_WT,
       TO_CHAR(T.SUBCONTRACTCOMPLETE_TIME, 'YYYY-MM-DD HH24:MI:SS') SUBCONTRACTCOMPLETE_TIME,
       T.SUBCONTRACTCOMPLETE_NAME,
       TO_CHAR(T.OFFLINE_TIME, 'YYYY-MM-DD HH24:MI:SS') OFFLINE_TIME,
       TO_CHAR(T.RE_TIME, 'YYYY-MM-DD HH24:MI:SS') RE_TIME,
       T.MEMO,
       T.REASON1,
       T.REASON2,
       T.REASON3,
       T.ANALYSIS_RESULTS,
       T.PLINE_CODE_RESPONSE,
       T.PLINE_NAME_RESPONSE,
       T.PLINE_CODE_A,
       T.PLINE_NAME_A,
       T.PLINE_CODE_D,
       T.PLINE_NAME_D,
       T.PLINE_CODE_E,
       T.PLINE_NAME_E,
       T.PLINE_CODE_F,
       T.PLINE_NAME_F,
       T.DISPOSAL_OPINION_SCHEDULE,
       TO_CHAR(T.DELVRY_EDATE, 'YYYY-MM-DD HH24:MI:SS') DELVRY_EDATE
  FROM OFFLINE_PROCESS T
 WHERE 1 = 1
 ]]>
</query>



</queryMap>
