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

import com.ssj.bean.common.framework.core.domain.PersistentEntity;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "fx_device")
public class Device extends PersistentEntity {
	private String id;
	@Id
	@Column(length = 32, nullable = false)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
    private static final long serialVersionUID = 1L;

    private String imei;
    
    private String merchantId;
 
    private String posCode;
    
    private String orgCode;
    
    private Integer status;
    
    private Date receiveTime;
    
    private Integer isSpan;
    
    private String batchCode;
    
    private String remarks;
    
    private Date activeTime; //激活时的时间
    
    private String activeLng; //激活时的经度

	private String activeLat; //激活时的纬度
	
	private String deviceName;
	
    private String deviceColor;
    
	private String deviceNumber;

	/**
	 * 真实小塾号
	 */
	private String deviceRealNumber;

	private String deviceModel;
	 
	private String deviceCode;
	 
	private String deviceSn;
	
	private Double price;
	
	private String emsNumber;
	
	private String emsAddress;
	
	private String emsUsername;
	
	private String emsTelephone;
	
	private String emsImg;
	
	private Integer type;
	
    private Date createTime;

	private Date updateTime;
	
	private Merchant merchant;

	private DeviceAct deviceAct;
	
	private Integer isUsed;
	
	private String lastMerchantId;
	
	
	
	@OneToOne(cascade = { CascadeType.PERSIST}, fetch=FetchType.EAGER)
	@JoinColumn(name="merchantId",updatable =false,insertable =false)
	@Fetch(FetchMode.SELECT)
	public Merchant getMerchant() {
		return merchant;
	}

	public void setMerchant(Merchant merchant) {
		this.merchant = merchant;
	}

	public String getOrgCode() {
		return orgCode;
	}

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


	public String getImei() {
		return imei;
	}

	public void setImei(String imei) {
		this.imei = imei;
	}

	public String getDeviceColor() {
		return deviceColor;
	}

	public void setDeviceColor(String deviceColor) {
		this.deviceColor = deviceColor;
	}

	public String getMerchantId() {
		return merchantId;
	}

	public void setMerchantId(String merchantId) {
		this.merchantId = merchantId;
	}

	public String getPosCode() {
		return posCode;
	}

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

	public Integer getStatus() {
		return status;
	}

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

	public Date getReceiveTime() {
		return receiveTime;
	}

	public void setReceiveTime(Date receiveTime) {
		this.receiveTime = receiveTime;
	}

	public Integer getIsSpan() {
		return isSpan;
	}

	public void setIsSpan(Integer isSpan) {
		this.isSpan = isSpan;
	}

	public String getBatchCode() {
		return batchCode;
	}

	public void setBatchCode(String batchCode) {
		this.batchCode = batchCode;
	}

	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 String getActiveLng() {
		return activeLng;
	}

	public void setActiveLng(String activeLng) {
		this.activeLng = activeLng;
	}

	public String getActiveLat() {
		return activeLat;
	}

	public void setActiveLat(String activeLat) {
		this.activeLat = activeLat;
	}

	public String getDeviceName() {
		return deviceName;
	}

	public void setDeviceName(String deviceName) {
		this.deviceName = deviceName;
	}

	public String getDeviceNumber() {
		return deviceNumber;
	}

	public void setDeviceNumber(String deviceNumber) {
		this.deviceNumber = deviceNumber;
	}

	public String getDeviceModel() {
		return deviceModel;
	}

	public void setDeviceModel(String deviceModel) {
		this.deviceModel = deviceModel;
	}

	public String getDeviceCode() {
		return deviceCode;
	}

	public void setDeviceCode(String deviceCode) {
		this.deviceCode = deviceCode;
	}

	public String getDeviceSn() {
		return deviceSn;
	}

	public void setDeviceSn(String deviceSn) {
		this.deviceSn = deviceSn;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Double getPrice() {
		return price;
	}

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

	public String getEmsNumber() {
		return emsNumber;
	}

	public void setEmsNumber(String emsNumber) {
		this.emsNumber = emsNumber;
	}

	public String getEmsAddress() {
		return emsAddress;
	}

	public void setEmsAddress(String emsAddress) {
		this.emsAddress = emsAddress;
	}

	public String getEmsUsername() {
		return emsUsername;
	}

	public void setEmsUsername(String emsUsername) {
		this.emsUsername = emsUsername;
	}

	public String getEmsTelephone() {
		return emsTelephone;
	}

	public void setEmsTelephone(String emsTelephone) {
		this.emsTelephone = emsTelephone;
	}

	public Integer getType() {
		return type;
	}

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

	public Date getActiveTime() {
		return activeTime;
	}

	public void setActiveTime(Date activeTime) {
		this.activeTime = activeTime;
	}

	public String getEmsImg() {
		return emsImg;
	}

	public void setEmsImg(String emsImg) {
		this.emsImg = emsImg;
	}
	@Transient
	public DeviceAct getDeviceAct() {
		return deviceAct;
	}

	public void setDeviceAct(DeviceAct deviceAct) {
		this.deviceAct = deviceAct;
	}

	public Integer getIsUsed() {
		return isUsed;
	}

	public void setIsUsed(Integer isUsed) {
		this.isUsed = isUsed;
	}

	public String getLastMerchantId() {
		return lastMerchantId;
	}

	public void setLastMerchantId(String lastMerchantId) {
		this.lastMerchantId = lastMerchantId;
	}

	public String getDeviceRealNumber() {
		return deviceRealNumber;
	}

	public void setDeviceRealNumber(String deviceRealNumber) {
		this.deviceRealNumber = deviceRealNumber;
	}
}
	

