package com.xt.hb.utils
{
	import com.xt.hb.object.FieldObject;
	import com.xt.hb.utils.ConstUtil;
	

	public class FieldsUtility
	{
		public function FieldsUtility()
		{
		}
		
		public static function getShowFields(layerId:String):Array
		{
			var arr:Array = new Array();
			if(layerId.indexOf("#") > 0)
				layerId = layerId.substring(0,layerId.indexOf("#"));
			switch(layerId)
			{
				case ConstUtil.L_ID_MT:
				{
					arr.push(new FieldObject("码头名称","NAME"));
					arr.push(new FieldObject("经营人","JYRMC"));
					arr.push(new FieldObject("港区名称","GQMC"));
					arr.push(new FieldObject("港口名称","GKMC"));
					arr.push(new FieldObject("码头用途","MTYT"));
					arr.push(new FieldObject("主要货类","ZYHL"));
					arr.push(new FieldObject("年货物通过能力（万吨）","NHWTGNL"));
					arr.push(new FieldObject("设计物通过能力（万吨）","SJHWTTL"));
					arr.push(new FieldObject("码头设计前沿水深（米）","MTSJQYSS"));
					break;
				}
				case ConstUtil.L_ID_BW: 
				{
					arr.push(new FieldObject("泊位名称","NAME"));
					arr.push(new FieldObject("经营人","JYRMC"));
					arr.push(new FieldObject("港区名称","GQMC"));
					arr.push(new FieldObject("港口名称","GKMC"));
					arr.push(new FieldObject("泊位用途","BWYT"));
					arr.push(new FieldObject("设计靠泊能力（吨）","SJKBNL"));
					arr.push(new FieldObject("年货物通过能力（万吨）","NHWTGML"));
					arr.push(new FieldObject("服务类型","FWLX"));
					arr.push(new FieldObject("是否危险品泊位","WXPBW"));
					break;
				}
				case ConstUtil.L_ID_JYR: 
				{
					arr.push(new FieldObject("经营人","NAME"));
					arr.push(new FieldObject("港区名称","GQMC"));
					arr.push(new FieldObject("港口名称","GKMC"));
					arr.push(new FieldObject("安全负责人联系电话","AQFZRLXDH"));
					arr.push(new FieldObject("经营许可证号","GKJYXKZH"));
					arr.push(new FieldObject("是否持有危险货物作业附证","SFWHQY"));
					arr.push(new FieldObject("主要作业货种","ZYHZ"));
					break;
				}
				case ConstUtil.L_ID_GQ: 
				{
					arr.push(new FieldObject("港区名称","NAME"));
					arr.push(new FieldObject("港口名称","GKMC"));
					arr.push(new FieldObject("港区面积(万平方米)","GQMJ"));
					arr.push(new FieldObject("陆域面积(万平方米)","LYMJ"));
					arr.push(new FieldObject("水域面积(万平方米)","SYMJ"));
					arr.push(new FieldObject("港区描述","REMARK"));
					break;
				}
				case ConstUtil.L_ID_AQ_QSK: 
				{
					arr.push(new FieldObject("取水口名称","qskmc"));
					arr.push(new FieldObject("管理单位","gldw"));
					arr.push(new FieldObject("联系电话","lxdh"));
					arr.push(new FieldObject("平均取水量(吨/天)","pjqsl"));
					arr.push(new FieldObject("用途","yt"));
					break;
				}
				case ConstUtil.L_ID_CBYJ: 
				{
					arr.push(new FieldObject("区域名称","areaname"));
					arr.push(new FieldObject("备注","bz"));
					break;
				}
				case ConstUtil.L_ID_GPS:
				{
					arr.push(new FieldObject("经度","jd"));
					arr.push(new FieldObject("纬度","wd"));
					arr.push(new FieldObject("速度","sd"));
					arr.push(new FieldObject("接受时间","recvdate"));
					break;
				}
				//end
				default:
				{
					arr.push(new FieldObject("名称","NAME"));
					break;
				}
			}
			return arr;
		}
		
		public static function getTitleByLayerID(layerID:String):String
		{
			switch(layerID)
			{
				case ConstUtil.L_ID_BW:
				{
					return "泊位详情：";
				}
				case ConstUtil.L_ID_MT:
				{
					return "码头详情：";
				}
				case ConstUtil.L_ID_JYR:
				{
					return "经营人详情：";
				}
				case ConstUtil.L_ID_GQ:
				{
					return "港区详情：";
				}
				case ConstUtil.L_ID_AQ_QSK:
				{
					return "取水口详情：";
				}
				case ConstUtil.L_ID_CBYJ:
				{
					return "区域详情：";
				}
				case ConstUtil.L_ID_GPS:
				{
					return "GPS：";
				}
				default:
				{
					break;
				}
			}
			return "";
		}
		
		public function queryTable(type:String,where:String):Array
		{
			//此处根据在系统界面中选择的书香表以及输入的查询条件，实现对指定表的查询，并返回相应的数据集
			return null;
		}
		
		public function updateRecord(type:String,entity:Object):int
		{
			//此处实现对已经查询出来的某条记录的编辑操作，并将编辑后的信息保存到数据库中
			return 0;
		}
		
		public function delelteRecord(type:String,id:String):int
		{
			//此处实现对已经查询出来的某条记录的删除操作，并删除数据表中对应的记录
			return 0;
		}
	}
}