/**
 * 
 */
package com.steering.mes.zgmil.coup;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.DecimalFormat;
import java.util.ArrayList;
import javax.script.ScriptException;

import antlr.collections.List;

import com.steering.comm.db.DBCommon;

import CoreFS.SA06.CoreReturnObject;
import CoreFS.SA08.CoreXmlSqlParsersFactory;
import CoreFS.SC01.CoreConstantData;

import com.steering.comm.db.DBCommon;
import com.steering.common.EntityTool;
import com.steering.mes.zgmil.entity.MilBaseAddressEntity;

/**
 * @author ZJAY 产线操作台电脑IP维护
 */
public class FrmIPAdress extends DBCommon {

	/**
	 * 查询
	 * 
	 * @param MilBase
	 * @return
	 */
	public CoreReturnObject Query(MilBaseAddressEntity MilBase) {
		String sql=CoreXmlSqlParsersFactory.getSql("IPAdress.Query");
		sql = EntityTool.fillSqlByEntity(sql, MilBase);
		return this.getData(sql);
	}

	/**
	 * 查询是否已出现数据
	 * 
	 * @param MilBase
	 * @return
	 */
	public CoreReturnObject isExist(MilBaseAddressEntity MilBase) {
		String sql = CoreXmlSqlParsersFactory.getSql("IPAdress.isExist");
		sql = EntityTool.fillSqlByEntity(sql, MilBase);
		return this.getData(sql);
	}

	/**
	 * 添加记录
	 * 
	 * @param MilBase
	 * @return
	 */
	public CoreReturnObject Add(MilBaseAddressEntity MilBase) {
		ArrayList<String> sqllist = new ArrayList<String>();

		String sql = CoreXmlSqlParsersFactory.getSql("IPAdress.Add");
		sql = EntityTool.fillSqlByEntity(sql, MilBase);
		sqllist.add(sql);
		return this.getDao(CoreConstantData.sysbeanstr).ExcuteTransction(
				sqllist);
	}

	/**
	 * 修改记录
	 * 
	 * @param MilBase
	 * @return
	 */
	public CoreReturnObject Save(MilBaseAddressEntity MilBase) {
		ArrayList<String> sqllist = new ArrayList<String>();

		String sql = CoreXmlSqlParsersFactory.getSql("IPAdress.Save");
		sql = EntityTool.fillSqlByEntity(sql, MilBase);
		sqllist.add(sql);
		return this.getDao(CoreConstantData.sysbeanstr).ExcuteTransction(
				sqllist);
	}

	public CoreReturnObject Delete(MilBaseAddressEntity MilBase) {
		ArrayList<String> sqllist = new ArrayList<String>();

		String sql = CoreXmlSqlParsersFactory.getSql("IPAdress.Delete");
		sql = EntityTool.fillSqlByEntity(sql, MilBase);
		sqllist.add(sql);
		return this.getDao(CoreConstantData.sysbeanstr).ExcuteTransction(
				sqllist);
	}
}
