<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="接箍制程">
	<query id="IJGplDao.getJGpl" desc="查询接箍制程">  
             <![CDATA[ 
            SELECT T.MSC,T.MSC_PLINE, T.WHOLE_BACKLOG, T.WHOLE_BACKLOG_DESC, T.AUTO_CRAFT
  FROM COM_MSC_BACKLOG T
 WHERE T.MSC = ?
   AND T.VALIDFLAG != '0'
               ]]>
	</query>

	<query id="IJGplDao.saveJGpl" desc="保存接箍制程">  
             <![CDATA[ 
             INSERT INTO SLM_ORD_DESIGN_MSC_JG_PL(
        DESGIN_KEY,
        CODE_JG,
        MSC_PLINE,
        WHOLE_BACKLOG,
        WHOLE_BACKLOG_DESC,
        SET_FL,
        WARN_DESC,
        ORD_LN_PK,
        AUTO_CRAFT)
 VALUES( 
        '#DESGIN_KEY#',
        '#CODE_JG#',
        '#MSC_PLINE#',
        '#WHOLE_BACKLOG#',
        '#WHOLE_BACKLOG_DESC#',
        '#SET_FL#',
        '#WARN_DESC#',
        '#ORD_LN_PK#',
        '#AUTO_CRAFT#')
               ]]>
	</query>

	<query id="IJGplDao.getJGPlSti" desc="接箍制程工序点">
	 <![CDATA[
	          SELECT T.MSC_PLINE,
       B.WHOLE_BACKLOG,
       B.WHOLE_BACKLOG_DESC,
       T.BACKLOG_SEQ,
       T.PROCESS_CODE,
       T.PROCESS_DESC,
       T.PROCESS_SEQ,
       T.STATION_CODE,
       T.STATION_DESC,
       C.PROCESS_CODE_C,
       C.PROCESS_DESC_C,
       C.MEMO,
       T.STATION_ID,
       A.STATION_TYPE
  FROM COM_MSC_STATION T
  LEFT JOIN COM_BASE_STATION A
    ON T.STATION_CODE = A.STATION_CODE
  LEFT JOIN COM_MSC_BACKLOG B
    ON T.MSC_PLINE = B.MSC_PLINE
  JOIN COM_MSC_PROCESS C
    ON T.MSC = C.MSC
   AND T.MSC_PLINE = C.MSC_PLINE
   AND T.PROCESS_CODE = C.PROCESS_CODE
   AND T.MSC = B.MSC
 WHERE T.MSC = ?
   AND T.MSC_PLINE = ?
  -- AND T.PROCESS_CODE = ?
   AND T.VALIDFLAG = '1'
   AND A.VALIDFLAG = '1'
   AND B.VALIDFLAG != '0'
	        ]]>
	</query>

	<query id="IJGplDao.saveJGPlSti" desc="保存接箍制程工序点">  
             <![CDATA[ 
              INSERT INTO SLM_ORD_DESIGN_MSC_JG_PL_STI(
        DESGIN_KEY,
        CODE_JG,
        MSC_PLINE,
        WHOLE_BACKLOG,
        WHOLE_BACKLOG_DESC,
        BACKLOG_SEQ,
        PROCESS_CODE,
        PROCESS_DESC,
        PROCESS_SEQ,
        PROCESS_CODE_C,
        PROCESS_DESC_C,
        STATION_ID,
        STATION_CODE,
        STATION_DESC,
        STATION_TYPE,
        MEMO
        )
 VALUES( 
        '#DESGIN_KEY#',
        '#CODE_JG#',
        '#MSC_PLINE#',
        '#WHOLE_BACKLOG#',
        '#WHOLE_BACKLOG_DESC#',
        '#BACKLOG_SEQ#',
        '#PROCESS_CODE#',
        '#PROCESS_DESC#',
        '#PROCESS_SEQ#',
        '#PROCESS_CODE_C#',
        '#PROCESS_DESC_C#',
        '#STATION_ID#',
        '#STATION_CODE#',
        '#STATION_DESC#',
        '#STATION_TYPE#',
        '#MEMO#')
               ]]>
	</query>

	<query id="IJGplDao.saveJGLine" desc="保存接箍制程产线">  
             <![CDATA[ 
     INSERT INTO SLM_ORD_DESIGN_MSC_JG_LINE
  (DESGIN_KEY,
   MSC_PLINE,
   PROCESS_CODE,
   PLINE_CODE,
   PLINE_NAME,
   WELL_CODE,
   WELL_NAME)
VALUES
  (?, ?, ?, ?, ?, ?, ?)
               ]]>
	</query>

</queryMap>