  /**
   * Generate time : 2009-11-21 16:31:27
   * Version : 1.0.1.V20070717
   */
package com.baosight.sts.st.xs.domain;

import java.math.BigDecimal;
import com.baosight.iplat4j.util.NumberUtils;
import java.util.Date;
import com.baosight.iplat4j.util.DateUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.ep.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.util.StringUtils;
/**
 * STXS1001 
 *  
 */
public class STXS1001 extends DaoEPBase {

	private String segNo = " ";		// 业务单元代码
	private String userId = " ";		// 优惠对象ALL为所有对象
	private String saleType = " ";		// 销售性质ALL为所有合同
	private String productTypeId = " ";		// 品种代码ALL为所有品种代码
	private String favorType = " ";		// 优惠类型10客户优惠,20员工优惠，30提单优惠
	private String shopsign = " ";		// 牌号ALL为所有牌号
	private Long accsetNo = new Long(0);	// 帐套序号
	private String userSegNo = " ";		// 对应业务员业务单元代码
	private BigDecimal favorAmount = new BigDecimal("0");		// 优惠金额
	private String modiPerson = " ";		// 更新人
	private Date modiDate;	// 更新日期
	private String favorId = "";
	private String favorStatus = " ";
	private String userName = " ";
	private String productTypeDesc = " ";
	private String userSegName = " ";

	/**
	 * initialize the metadata 
	 */
	public void initMetaData() {
		EiColumn eiColumn;
		
	eiColumn = new EiColumn("segNo");
	eiColumn.setPrimaryKey(true);
	eiColumn.setFieldLength(20);	
	eiColumn.setDescName("业务单元代码");
	eiMetadata.addMeta(eiColumn);
	
	eiColumn = new EiColumn("userId");
	eiColumn.setPrimaryKey(true);
	eiColumn.setFieldLength(30);	
	eiColumn.setDescName("优惠对象ALL为所有对象");
	eiMetadata.addMeta(eiColumn);
	
	eiColumn = new EiColumn("saleType");
	eiColumn.setPrimaryKey(true);
	eiColumn.setFieldLength(10);	
	eiColumn.setDescName("销售性质ALL为所有合同");
	eiMetadata.addMeta(eiColumn);
	
	eiColumn = new EiColumn("productTypeId");
	eiColumn.setPrimaryKey(true);
	eiColumn.setFieldLength(10);	
	eiColumn.setDescName("品种代码ALL为所有品种代码");
	eiMetadata.addMeta(eiColumn);
	
	eiColumn = new EiColumn("favorType");
	eiColumn.setPrimaryKey(true);
	eiColumn.setFieldLength(10);	
	eiColumn.setDescName("优惠类型10客户优惠,20员工优惠，30提单优惠");
	eiMetadata.addMeta(eiColumn);
	
	eiColumn = new EiColumn("shopsign");
	eiColumn.setPrimaryKey(true);
	eiColumn.setFieldLength(50);	
	eiColumn.setDescName("牌号ALL为所有牌号");
	eiMetadata.addMeta(eiColumn);
	
	eiColumn = new EiColumn("accsetNo");
	eiColumn.setType("N");
	eiColumn.setScaleLength(0);
	eiColumn.setFieldLength(11);
	eiColumn.setDescName("帐套序号");
	eiMetadata.addMeta(eiColumn);
	
	eiColumn = new EiColumn("userSegNo");
	eiColumn.setFieldLength(20);	
	eiColumn.setDescName("对应业务员业务单元代码");
	eiMetadata.addMeta(eiColumn);
	
	eiColumn = new EiColumn("favorAmount");
	eiColumn.setType("N");
	eiColumn.setScaleLength(6);
	eiColumn.setFieldLength(18);
	eiColumn.setDescName("优惠金额");
	eiMetadata.addMeta(eiColumn);
	
	eiColumn = new EiColumn("modiPerson");
	eiColumn.setFieldLength(30);	
	eiColumn.setDescName("更新人");
	eiMetadata.addMeta(eiColumn);
	
	eiColumn = new EiColumn("modiDate");
	eiColumn.setDescName("更新日期");
	eiMetadata.addMeta(eiColumn);
	
	
	eiColumn = new EiColumn("favorId");
	eiColumn.setFieldLength(10);
	eiColumn.setDescName("");
	eiMetadata.addMeta(eiColumn);
	
	eiColumn = new EiColumn("favorStatus");
	eiColumn.setPrimaryKey(true);
	eiColumn.setFieldLength(10);	
	eiColumn.setDescName("");
	eiMetadata.addMeta(eiColumn);
	
	eiColumn = new EiColumn("userName");
	eiColumn.setPrimaryKey(true);
	eiColumn.setFieldLength(100);	
	eiColumn.setDescName("");
	eiMetadata.addMeta(eiColumn);
	
	eiColumn = new EiColumn("productTypeDesc");
	eiColumn.setPrimaryKey(true);
	eiColumn.setFieldLength(100);	
	eiColumn.setDescName("");
	eiMetadata.addMeta(eiColumn);
	
	eiColumn = new EiColumn("userSegName");
	eiColumn.setPrimaryKey(true);
	eiColumn.setFieldLength(100);	
	eiColumn.setDescName("");
	eiMetadata.addMeta(eiColumn);
	}
	/**
	 * the constructor
	 */
	public STXS1001() {
		initMetaData();
	}
	
	/**
	 * get the segNo - 业务单元代码
	 * @return the segNo
	 */
	public String getSegNo() {
		return this.segNo;
	}
	
	/**
	 * set the segNo - 业务单元代码
	 */
	public void setSegNo(String segNo) {
		this.segNo = segNo;
	}
	
	/**
	 * get the userId - 优惠对象ALL为所有对象
	 * @return the userId
	 */
	public String getUserId() {
		return this.userId;
	}
	
	/**
	 * set the userId - 优惠对象ALL为所有对象
	 */
	public void setUserId(String userId) {
		this.userId = userId;
	}
	
	/**
	 * get the saleType - 销售性质ALL为所有合同
	 * @return the saleType
	 */
	public String getSaleType() {
		return this.saleType;
	}
	
	/**
	 * set the saleType - 销售性质ALL为所有合同
	 */
	public void setSaleType(String saleType) {
		this.saleType = saleType;
	}
	
	/**
	 * get the productTypeId - 品种代码ALL为所有品种代码
	 * @return the productTypeId
	 */
	public String getProductTypeId() {
		return this.productTypeId;
	}
	
	/**
	 * set the productTypeId - 品种代码ALL为所有品种代码
	 */
	public void setProductTypeId(String productTypeId) {
		this.productTypeId = productTypeId;
	}
	
	/**
	 * get the favorType - 优惠类型10客户优惠,20员工优惠，30提单优惠
	 * @return the favorType
	 */
	public String getFavorType() {
		return this.favorType;
	}
	
	/**
	 * set the favorType - 优惠类型10客户优惠,20员工优惠，30提单优惠
	 */
	public void setFavorType(String favorType) {
		this.favorType = favorType;
	}
	
	/**
	 * get the shopsign - 牌号ALL为所有牌号
	 * @return the shopsign
	 */
	public String getShopsign() {
		return this.shopsign;
	}
	
	/**
	 * set the shopsign - 牌号ALL为所有牌号
	 */
	public void setShopsign(String shopsign) {
		this.shopsign = shopsign;
	}
	
	/**
	 * get the accsetNo - 帐套序号
	 * @return the accsetNo
	 */
	public Long getAccsetNo() {
		return this.accsetNo;
	}
	
	/**
	 * set the accsetNo - 帐套序号
	 */
	public void setAccsetNo(Long accsetNo) {
		this.accsetNo = accsetNo;
	}
	
	/**
	 * get the userSegNo - 对应业务员业务单元代码
	 * @return the userSegNo
	 */
	public String getUserSegNo() {
		return this.userSegNo;
	}
	
	/**
	 * set the userSegNo - 对应业务员业务单元代码
	 */
	public void setUserSegNo(String userSegNo) {
		this.userSegNo = userSegNo;
	}
	
	/**
	 * get the favorAmount - 优惠金额
	 * @return the favorAmount
	 */
	public BigDecimal getFavorAmount() {
		return this.favorAmount;
	}
	
	/**
	 * set the favorAmount - 优惠金额
	 */
	public void setFavorAmount(BigDecimal favorAmount) {
		this.favorAmount = favorAmount;
	}
	
	/**
	 * get the modiPerson - 更新人
	 * @return the modiPerson
	 */
	public String getModiPerson() {
		return this.modiPerson;
	}
	
	/**
	 * set the modiPerson - 更新人
	 */
	public void setModiPerson(String modiPerson) {
		this.modiPerson = modiPerson;
	}
	
	/**
	 * get the modiDate - 更新日期
	 * @return the modiDate
	 */
	public Date getModiDate() {
		return this.modiDate;
	}
	
	/**
	 * set the modiDate - 更新日期
	 */
	public void setModiDate(Date modiDate) {
		this.modiDate = modiDate;
	}
	
	
	/**
	 * get the favorStatus 
	 * @return the favorStatus
	 */
	public String getFavorStatus() {
		return this.favorStatus;
	}
	
	/**
	 * set the favorStatus 
	 */
	public void setFavorStatus(String favorStatus) {
		this.favorStatus = favorStatus;
	}
	
	/**
	 * get the favorId
	 * @return the favorId
	 */
	public String getFavorId() {
		return this.favorId;
	}
	
	/**
	 * set the favorId
	 */
	public void setFavorId(String favorId) {
		this.favorId = favorId;
	}
	
	/**
	 * get the userName
	 * @return the userName
	 */
	public String getUserName() {
		return this.userName;
	}
	
	/**
	 * set the userName
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}
	
	/**
	 * get the productTypeDesc
	 * @return the productTypeDesc
	 */
	public String getProductTypeDesc() {
		return this.productTypeDesc;
	}
	
	/**
	 * set the productTypeDesc
	 */
	public void setProductTypeDesc(String productTypeDesc) {
		this.productTypeDesc = productTypeDesc;
	}
	
	/**
	 * get the userSegName
	 * @return the userSegName
	 */
	public String getUserSegName() {
		return this.userSegName;
	}
	
	/**
	 * set the userSegName
	 */
	public void setUserSegName(String userSegName) {
		this.userSegName = userSegName;
	}
	
	/**
	 * get the value from Map
	 */
	public void fromMap(Map map) {
	
		setSegNo(StringUtils.defaultIfEmpty(((String)map.get("segNo")), segNo));
		setUserId(StringUtils.defaultIfEmpty(((String)map.get("userId")), userId));
		setSaleType(StringUtils.defaultIfEmpty(((String)map.get("saleType")), saleType));
		setProductTypeId(StringUtils.defaultIfEmpty(((String)map.get("productTypeId")), productTypeId));
		setFavorType(StringUtils.defaultIfEmpty(((String)map.get("favorType")), favorType));
		setShopsign(StringUtils.defaultIfEmpty(((String)map.get("shopsign")), shopsign));
		setAccsetNo(NumberUtils.toLong(((String)map.get("accsetNo")), accsetNo));
		setUserSegNo(StringUtils.defaultIfEmpty(((String)map.get("userSegNo")), userSegNo));
		setFavorAmount(NumberUtils.toBigDecimal(((String)map.get("favorAmount")), favorAmount));
		setModiPerson(StringUtils.defaultIfEmpty(((String)map.get("modiPerson")), modiPerson));
		setModiDate(DateUtils.toDate((String)map.get("modiDate")));
		
		setFavorStatus(StringUtils.defaultIfEmpty(((String)map.get("favorStatus")), favorStatus));
		setFavorId(StringUtils.defaultIfEmpty(((String)map.get("favorId")), favorId));
		setUserName(StringUtils.defaultIfEmpty(((String)map.get("userName")), userName));
		setProductTypeDesc(StringUtils.defaultIfEmpty(((String)map.get("productTypeDesc")), productTypeDesc));
		setUserSegName(StringUtils.defaultIfEmpty(((String)map.get("userSegName")), userSegName));
	}
	
	/**
	 * set the value to Map
	 */
	public Map toMap() {
		
		Map map = new HashMap();
			map.put("segNo",StringUtils.toString(segNo, eiMetadata.getMeta("segNo").getFieldLength(), eiMetadata.getMeta("segNo").getScaleLength()));	
			map.put("userId",StringUtils.toString(userId, eiMetadata.getMeta("userId").getFieldLength(), eiMetadata.getMeta("userId").getScaleLength()));	
			map.put("saleType",StringUtils.toString(saleType, eiMetadata.getMeta("saleType").getFieldLength(), eiMetadata.getMeta("saleType").getScaleLength()));	
			map.put("productTypeId",StringUtils.toString(productTypeId, eiMetadata.getMeta("productTypeId").getFieldLength(), eiMetadata.getMeta("productTypeId").getScaleLength()));	
			map.put("favorType",StringUtils.toString(favorType, eiMetadata.getMeta("favorType").getFieldLength(), eiMetadata.getMeta("favorType").getScaleLength()));	
			map.put("shopsign",StringUtils.toString(shopsign, eiMetadata.getMeta("shopsign").getFieldLength(), eiMetadata.getMeta("shopsign").getScaleLength()));	
			map.put("accsetNo",StringUtils.toString(accsetNo, eiMetadata.getMeta("accsetNo").getFieldLength(), eiMetadata.getMeta("accsetNo").getScaleLength()));	
			map.put("userSegNo",StringUtils.toString(userSegNo, eiMetadata.getMeta("userSegNo").getFieldLength(), eiMetadata.getMeta("userSegNo").getScaleLength()));	
			map.put("favorAmount",StringUtils.toString(favorAmount, eiMetadata.getMeta("favorAmount").getFieldLength(), eiMetadata.getMeta("favorAmount").getScaleLength()));	
			map.put("modiPerson",StringUtils.toString(modiPerson, eiMetadata.getMeta("modiPerson").getFieldLength(), eiMetadata.getMeta("modiPerson").getScaleLength()));	
			map.put("modiDate",StringUtils.toString(modiDate, eiMetadata.getMeta("modiDate").getFieldLength(), eiMetadata.getMeta("modiDate").getScaleLength()));	
			
			map.put("favorId",StringUtils.toString(favorId, eiMetadata.getMeta("favorId").getFieldLength(), eiMetadata.getMeta("favorId").getScaleLength()));	
			map.put("favorStatus",StringUtils.toString(favorStatus, eiMetadata.getMeta("favorStatus").getFieldLength(), eiMetadata.getMeta("favorStatus").getScaleLength()));	
			map.put("userName",StringUtils.toString(userName, eiMetadata.getMeta("userName").getFieldLength(), eiMetadata.getMeta("userName").getScaleLength()));	
			map.put("productTypeDesc",StringUtils.toString(productTypeDesc, eiMetadata.getMeta("productTypeDesc").getFieldLength(), eiMetadata.getMeta("productTypeDesc").getScaleLength()));	
			map.put("userSegName",StringUtils.toString(userSegName, eiMetadata.getMeta("userSegName").getFieldLength(), eiMetadata.getMeta("userSegName").getScaleLength()));	
			
		return map;
	
	}
}