package com.steering.mes.mcp.coup;

import java.util.ArrayList;
import com.steering.comm.db.DBCommon;
import CoreFS.SA06.CoreReturnObject;
import CoreFS.SA08.CoreXmlSqlParsersFactory;
import CoreFS.SC01.CoreConstantData;

public class FrmConfiguration extends DBCommon {

    /***
     * 查询
     * @param name 项目名称
     * @param plineDesc 产线名称
     * @return
     */
    public CoreReturnObject getSinglePlan(String name, String plineDesc) {
        return this.getDataBySqlID("", new Object[] { name, plineDesc });
    }

    /***
     * 查询产线
     * @return
     */
    public CoreReturnObject getQueryPline() {
        return this.getDataBySqlID("FrmConfiguration.getQueryPline");
    }

    /***
     * 查询检测项目配置
     * @return
     */
    public CoreReturnObject getQueryPhosphateItem(ArrayList<String> pram) {
        return this.getDataBySqlID("FrmConfiguration.getQueryPhosphateItem", pram
                .toArray());
    }
    /***
     * 新增检测项目配置
     * @return
     */
    public CoreReturnObject getAddPhosphateItem(ArrayList<ArrayList<String>> pram) {
        ArrayList<String> sqllist = new ArrayList<String>();
        ArrayList<Object[]> parmlist = new ArrayList<Object[]>();
        for (int i = 0; i < pram.size(); i++) {
            sqllist.add(CoreXmlSqlParsersFactory.getSql("FrmConfiguration.getAddPhosphateItem"));
            parmlist.add(pram.get(i).toArray());
        }
        return this.getDao(CoreConstantData.sysbeanstr).ExcuteTransction(
                sqllist, parmlist); //执行事务处理（多个非查询， 自动提交、回滚）
    }
    /***
     * 修改检测项目配置
     * @return
     */
    public CoreReturnObject getUpdatePhosphateItem(ArrayList<ArrayList<String>> pram) {
        ArrayList<String> sqllist = new ArrayList<String>();
        ArrayList<Object[]> parmlist = new ArrayList<Object[]>();
        for (int i = 0; i < pram.size(); i++) {
            sqllist.add(CoreXmlSqlParsersFactory.getSql("FrmConfiguration.getUpdatePhosphateItem"));
            parmlist.add(pram.get(i).toArray());
        }
        return this.getDao(CoreConstantData.sysbeanstr).ExcuteTransction(
                sqllist, parmlist); //执行事务处理（多个非查询， 自动提交、回滚）
    }
    /***
     * 删除检测项目配置
     * @return
     */
    public CoreReturnObject getDeletePhosphateItem(ArrayList<ArrayList<String>> pram) {
        ArrayList<String> sqllist = new ArrayList<String>();
        ArrayList<Object[]> parmlist = new ArrayList<Object[]>();
        for (int i = 0; i < pram.size(); i++) {
            sqllist.add(CoreXmlSqlParsersFactory.getSql("FrmConfiguration.getDeletePhosphateItem"));
            parmlist.add(pram.get(i).toArray());
        }
        return this.getDao(CoreConstantData.sysbeanstr).ExcuteTransction(
                sqllist, parmlist); //执行事务处理（多个非查询， 自动提交、回滚）
    }
}
