package com.ssj.bean.sys.fx.domain;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.ssj.bean.common.framework.core.domain.BaseEntity;
import com.ssj.bean.weixin.libmy.domain.TbLibJoin;

@Entity
@Table(name = "fx_merchant")
public class Merchant extends BaseEntity {
	
    private static final long serialVersionUID = 1L;
    
    private String posCode;
    
    private String orgCode;

    private String  manageUserId;

    private String parentPosCode;

    private Integer type;

    private Integer level;

    private String unitName;

    private String legalPerson;

    private String phone;

    private String deputyName;

    private String deputyPhone;

    private Integer status;

    private String location;

    private String remarks;
    
    private Date createTime;
    
    private Double price;
    
    private Double hardwarePrice;
    
    private String saleLoginName;

	private Double outPrice;
	
	private String libId;
	
	private TbLibJoin libJoin;
	
	private Integer portNum;
	
	private Integer libService;
	
	private Integer platformService;
	
	private Integer signService;
	
	private Integer hardwareService;
	
	private Date signTime;
	
	private Date endSignTime;
	
	private Date curSummaryTime;

	private Date nextSummaryTime;
	
	private Integer curIsSummary;

	/**
	 * 地址
	 */
	private String address;
	
	//private Integer cnAreaType;
	
	@Transient
	private List<Merchant> subMerchants=new ArrayList<Merchant>();
	
	public String getSaleLoginName() {
		return saleLoginName;
	}

	public void setSaleLoginName(String saleLoginName) {
		this.saleLoginName = saleLoginName;
	}

	public Date getSignTime() {
		return signTime;
	}

	public void setSignTime(Date signTime) {
		this.signTime = signTime;
	}

	public String getOrgCode() {
		return orgCode;
	}

	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}

	public String getPosCode() {
		return posCode;
	}

	public void setPosCode(String posCode) {
		this.posCode = posCode;
	}

	public String getManageUserId() {
		return manageUserId;
	}

	public void setManageUserId(String manageUserId) {
		this.manageUserId = manageUserId;
	}

	public String getParentPosCode() {
		return parentPosCode;
	}

	public void setParentPosCode(String parentPosCode) {
		this.parentPosCode = parentPosCode;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public String getUnitName() {
		return unitName;
	}

	public void setUnitName(String unitName) {
		this.unitName = unitName;
	}

	public String getLegalPerson() {
		return legalPerson;
	}

	public void setLegalPerson(String legalPerson) {
		this.legalPerson = legalPerson;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getDeputyName() {
		return deputyName;
	}

	public void setDeputyName(String deputyName) {
		this.deputyName = deputyName;
	}

	public String getDeputyPhone() {
		return deputyPhone;
	}

	public void setDeputyPhone(String deputyPhone) {
		this.deputyPhone = deputyPhone;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}


	public Double getOutPrice() {
		return outPrice;
	}

	public void setOutPrice(Double outPrice) {
		this.outPrice = outPrice;
	}

	public String getLibId() {
		return libId;
	}

	public void setLibId(String libId) {
		this.libId = libId;
	}

	public Integer getLibService() {
		return libService;
	}

	public void setLibService(Integer libService) {
		this.libService = libService;
	}

	public Integer getPlatformService() {
		return platformService;
	}

	public void setPlatformService(Integer platformService) {
		this.platformService = platformService;
	}

	public Date getEndSignTime() {
		return endSignTime;
	}

	public void setEndSignTime(Date endSignTime) {
		this.endSignTime = endSignTime;
	}

//	public Integer getCnAreaType() {
//		return cnAreaType;
//	}
//
//	public void setCnAreaType(Integer cnAreaType) {
//		this.cnAreaType = cnAreaType;
//	}

	public Integer getPortNum() {
		return portNum;
	}

	public void setPortNum(Integer portNum) {
		this.portNum = portNum;
	}

	public Date getNextSummaryTime() {
		return nextSummaryTime;
	}

	public void setNextSummaryTime(Date nextSummaryTime) {
		this.nextSummaryTime = nextSummaryTime;
	}

	public Date getCurSummaryTime() {
		return curSummaryTime;
	}

	public void setCurSummaryTime(Date curSummaryTime) {
		this.curSummaryTime = curSummaryTime;
	}

	@OneToOne(cascade = { CascadeType.PERSIST}, fetch=FetchType.EAGER)
	@JoinColumn(name="libId",updatable =false,insertable =false)
	@NotFound(action=NotFoundAction.IGNORE)
	@Fetch(FetchMode.SELECT)
	public TbLibJoin getLibJoin() {
		return libJoin;
	}

	public void setLibJoin(TbLibJoin libJoin) {
		this.libJoin = libJoin;
	}

	public Integer getCurIsSummary() {
		return curIsSummary;
	}

	public void setCurIsSummary(Integer curIsSummary) {
		this.curIsSummary = curIsSummary;
	}

	public Integer getSignService() {
		return signService;
	}

	public void setSignService(Integer signService) {
		this.signService = signService;
	}
	
	@Transient
	public List<Merchant> getSubMerchants() {
		return subMerchants;
	}

	public void setSubMerchants(List<Merchant> subMerchants) {
		this.subMerchants = subMerchants;
	}

	public Integer getHardwareService() {
		return hardwareService;
	}

	public void setHardwareService(Integer hardwareService) {
		this.hardwareService = hardwareService;
	}

	public Double getHardwarePrice() {
		return hardwarePrice;
	}

	public void setHardwarePrice(Double hardwarePrice) {
		this.hardwarePrice = hardwarePrice;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
}
