package com.steering.pss.sale.order;

import CoreFS.SA06.CoreReturnObject;
import java.sql.SQLException;
import java.util.ArrayList;

import CoreFS.SA08.CoreXmlSqlParsersFactory;

import com.steering.comm.db.DBCommon;

public class CoreOrderLen extends DBCommon {
	
	
	/**
     * 专用线基础信息查询
     * @param includeDeleted 是否包含已删除数据
     * @param name 专用线描述
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
	public CoreReturnObject GetLenNoByLenTyp() {
		CoreReturnObject cro =  this.getDataBySqlID("CoreOrderLen.GetLenNoByLenTyp");
		return cro;
	}
	
	
	/**
     * 专用线基础信息查询
     * @param includeDeleted 是否包含已删除数据
     * @param name 专用线描述
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
	public CoreReturnObject GetLenNo() {
		CoreReturnObject cro =  this.getDataBySqlID("CoreOrderLen.GetLenNo");
		return cro;
	}
	
	 
	
	
	/**
     * 专用线基础信息查询
     * @param includeDeleted 是否包含已删除数据
     * @param name 专用线描述
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
	public CoreReturnObject isRepeat(String lenDesc) {
		Object[] obj = new Object[] { lenDesc };
        return this.getDataBySqlID("CoreOrderLen.isRepeat",obj);
	}
	
	/**
     * 专用线基础信息查询
     * @param includeDeleted 是否包含已删除数据
     * @param name 专用线描述
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
	public CoreReturnObject doQuery(String lenNo) {
		Object []obj = new Object[]{lenNo};
        return this.getDataBySqlID("CoreOrderLen.QUERY",obj);
	}
	
	public CoreReturnObject doQuery1(String lenNo) {
		Object []obj = new Object[]{lenNo};
        return this.getDataBySqlID("CoreOrderLen.QUERY1",obj);
	}
	
	
	/**
     * 专用线基础信息修改
     * @param parm 参数
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
	public CoreReturnObject doUpdate(ArrayList<Object> parm) {
		CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreOrderLen.doUpdate");
		try {
			cro = this.getDao("TgDao").ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	
	/**
     * 专用线基础信息新增
     * @param parm 参数
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
	public CoreReturnObject doAdd(ArrayList<Object> parm) {
		CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreOrderLen.doAdd");
		try {
			cro = this.getDao("TgDao").ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	
	/**
     * 专用线基础信息删除或恢复
     * @param plineCodes 产线代码集合
     * @param operator 操作人
     * @param isDelete true删除 false恢复
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
    public CoreReturnObject doDelete(ArrayList<Object> parm) {  	
    	CoreReturnObject cro = new CoreReturnObject();
		String strSql = CoreXmlSqlParsersFactory.getSql("CoreOrderLen.doDelete");
		try {
			cro = this.getDao("TgDao").ExcuteNonQuery(strSql, parm.toArray());
		} catch (SQLException e) {
			cro = cro.SetErrInfo(e.getMessage());
		}
		return cro;
	}
	
	
}
