<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="适用产线">
	<query id="IProLineManageDao.getProLineByProcessCode" desc="通过工序查询适用产线">
         <![CDATA[
      SELECT PLINE_CODE,
       PLINE_NAME,
       PASS_CODE,
       PASS_NAME,
       MODEL_CODE,
       MODEL_DESC,
       INDEX_SEQ,
       MIN_D,
       MAX_D,
       MIN_H,
       MAX_H,
       SPEC_JG,
       SPEC_JG_DESC,
       WELL_CODE,
       WELL_NAME,
       CREATE_NAME,
       CREATE_TIME,
       UPDATE_NAME,
       UPDATE_TIME,
       DELETE_NAME,
       DELETE_TIME,
       VALIDFLAG,
       MEMO,
       SPEC_CODE,
       SPEC_NAME,
       MODEL_STYLE,
       PROCESS_CDOE_C,
       PROCESS_DESC_C,
       PROCESS_STYLE
  FROM COM_MSC_PLINE_R_SPEC A
 WHERE A.PLINE_CODE IN (SELECT B.PLINE_CODE
                          FROM COM_BASE_PLINE B
                         WHERE B.PROCESS_CODE = ?
                           AND B.VALIDFLAG = '1')
   AND A.VALIDFLAG = '1'
             ]]>
	</query>

	<query id="IProLineManageDao.getBaseLine" desc="通过基础适用产线">
         <![CDATA[
            SELECT PLINE_CODE,
       PLINE_NAME,
       DEPARTMENT_CODE,
       DEPARTMENT_DESC,
       CREATE_NAME,
       CREATE_TIME,
       UPDATE_NAME,
       UPDATE_TIME,
       DELETE_NAME,
       DELETE_TIME,
       VALIDFLAG,
       MEMO,
       PROCESS_CODE,
       PROCESS_DESC,
       PLINE_CODE_OLD,
       LENGTH_MIN,
       LENGTH_MAX,
       LENGTH_COLDBED,
       LENGTH_MAX_RING,
       LENGTH_MIN_RING,
       LENGTH_MIN_TUBE,
       LENGTH_MAX_TUBE,
       BURNOUT_RATE
  FROM COM_BASE_PLINE T
 WHERE T.PROCESS_CODE = ?
   AND T.VALIDFLAG = '1'
             ]]>
	</query>

	<query id="IProLineManageDao.getLineBySpec" desc="通过产品规格找适用产线">
         <![CDATA[
SELECT PLINE_CODE,
       PLINE_NAME,
       MIN(PASS_CODE) PASS_CODE,
       MIN(PASS_NAME) PASS_NAME,
       MIN(MODEL_CODE) MODEL_CODE,
       MIN(MODEL_DESC) MODEL_DESC,
       MIN(INDEX_SEQ) INDEX_SEQ,
       MIN(MIN_D) MIN_D,
       MIN(MAX_D) MAX_D,
       MIN(MIN_H) MIN_H,
       MIN(MAX_H) MAX_H,
       MIN(SPEC_JG) SPEC_JG,
       MIN(SPEC_JG_DESC) SPEC_JG_DESC,
       MIN(WELL_CODE) WELL_CODE,
       MIN(WELL_NAME) WELL_NAME,
       MIN(CREATE_NAME)CREATE_NAME ,
       MIN(CREATE_TIME) CREATE_TIME,
       MIN(UPDATE_NAME) UPDATE_NAME,
       MIN(UPDATE_TIME) UPDATE_TIME,
       MIN(DELETE_NAME) DELETE_NAME,
       MIN(DELETE_TIME) DELETE_TIME,
       MIN(VALIDFLAG) VALIDFLAG,
       MIN(MEMO) MEMO,
       MIN(SPEC_CODE) SPEC_CODE,
       MIN(SPEC_NAME) SPEC_NAME,
       MIN(MODEL_STYLE) MODEL_STYLE,
       MIN(PROCESS_CDOE_C) PROCESS_CDOE_C,
       MIN(PROCESS_DESC_C) PROCESS_DESC_C,
       MIN(PROCESS_STYLE) PROCESS_STYLE
  FROM COM_MSC_PLINE_R_SPEC D
 WHERE D.INDEX_SEQ IN
       (SELECT CODE_JG
          FROM COM_MSC_JG_R_SPEC T
         WHERE T.CODE_JG IN (SELECT TO_CHAR(A.INDEX_SEQ)
                               FROM COM_MSC_PLINE_R_SPEC A
                              WHERE A.PLINE_CODE IN
                                    (SELECT B.PLINE_CODE
                                       FROM COM_BASE_PLINE B
                                      WHERE B.PROCESS_CODE = ?
                                        AND B.VALIDFLAG = '1')
                                AND INSTR(A.MODEL_CODE, ?) > 0
                                AND A.VALIDFLAG = '1')
           AND INSTR(T.SPEC_CODE, ?) > 0
           AND T.VALIDFLAG = '1')
   AND D.VALIDFLAG = '1'
   GROUP BY D.PLINE_CODE, D.PLINE_NAME
             ]]>
	</query>


	<query id="IProLineManageDao.getLineByCustAndProduc" desc="通过最终客户、品名找认证产线">
         <![CDATA[
            SELECT CUSTOMER_NO,
       CUSTOMER_NM,
       PRODUCCODE,
       PRODUCNAME,
       PLINE_CODE,
       PLINE_NAME,
       PROCESS_CDOE,
       PROCESS_DESC,
       CREATE_NAME,
       CREATE_TIME,
       UPDATE_NAME,
       UPDATE_TIME,
       DELETE_NAME,
       DELETE_TIME,
       VALIDFLAG,
       MEMO
  FROM COM_BASE_CUSTOM_R_PLINE T
 WHERE T.CUSTOMER_NO = ?
   AND T.PRODUCCODE = ?
             ]]>
	</query>
</queryMap>