package com.steering.pss.qcm;

import CoreFS.SA08.CoreXmlSqlParsersFactory;
import java.util.*;
import CoreFS.SA06.CoreReturnObject;
import com.steering.comm.db.DBCommon;
 
@SuppressWarnings("unchecked")
public class JGRSteel extends DBCommon {

    public CoreReturnObject GetGrid1() {
        return this.getDataBySqlID("JGRSteel.InitJGRSTEEL"); // 钢级代码
    }

    /**
     * Title: doQuery
     * Description: 查询钢级名称 并统计关联的条数
     * @param steelcode 钢级代码
     * @return
     */
    public CoreReturnObject doQuery(String steelcode) {
        Object[] obj = new Object[] { steelcode, steelcode };
        return this.getDataBySqlID("JGRSteel.QUERY", obj); 
    }
    
    public CoreReturnObject doAdd(ArrayList<Object> params, String activecode) {
        CoreReturnObject cro = new CoreReturnObject();
        ArrayList<Object> sqlIDList = new ArrayList<Object>();
        ArrayList<Object[]> parmlist = new ArrayList<Object[]>();
        sqlIDList.add(CoreXmlSqlParsersFactory.getSql("JGRSteel.DELETE"));
        parmlist.add(new Object[] { activecode });
        if (params.size() > 0) {
            for (int i = 0; i < params.size(); i++) {
                ArrayList<Object> list = (ArrayList<Object>) params.get(i);
                parmlist.add(list.toArray());
                sqlIDList.add(CoreXmlSqlParsersFactory.getSql("JGRSteel.ADD"));
            }
        }
        cro = this.getDao("TgDao").ExcuteTransction(sqlIDList, parmlist);
        return cro;
    }
}
