package com.palmnest.model.lingling;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.*;

import com.palmnest.model.User;
import com.palmnest.model.estateserve.AppUser;
import org.codehaus.jackson.annotate.JsonIgnore;

/**
 * @Author wangxz
 * @Description 令令开门设备权限组表
 * @Date 2018/12/7 17:06
 **/
@Entity
@Table(name = "tb_device_perm_group")
public class DevicePermGroup implements Serializable {

	private static final long serialVersionUID = -6945382698226711401L;

	private Long                id;
	private Integer             groupType;//'权限组类型 1 员工；2 访客'
	private String              groupName;//'权限组名'
	private String              remark;//'备注'
	private Date                createTime;//'添加时间'
	private Long                creator;//'添加人'
	private Date                modifyTime;//'修改时间'
	private Long                modify;//'修改人'
//	private Set<LingLingDevice> devices = new HashSet<LingLingDevice>();
//	private Set<AppUser>        users   = new HashSet<AppUser>(); // 该权限组下的用户列表
	private Integer             orgId;// 项目id
	private Integer isUseLimit;//是否开启可用时段限制
	private Integer isWeek;//是否勾选周末
	private Integer isWorkday;//是否勾选工作日
	private Integer isHoliday;//是否勾选节假日
	private String beginTime;
	private String endTime;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "group_type")
	public Integer getGroupType() {
		return groupType;
	}

	public void setGroupType(Integer groupType) {
		this.groupType = groupType;
	}

	@Column(name = "group_name")
	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "create_time")
	public Date getCreateTime() {
		return createTime;
	}

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

	@Column(name = "creator")
	public Long getCreator() {
		return creator;
	}

	public void setCreator(Long creator) {
		this.creator = creator;
	}

	@Column(name = "modify_time")
	public Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	@Column(name = "modify")
	public Long getModify() {
		return modify;
	}

	public void setModify(Long modify) {
		this.modify = modify;
	}

	//@Transient
	//@JsonIgnore
//	@ManyToMany(fetch = FetchType.EAGER)
//	@JoinTable(name = "tr_perm_group_device", joinColumns = {@JoinColumn(name = "device_perm_group_id")}, inverseJoinColumns = @JoinColumn(name = "device_id"))
//	public Set<LingLingDevice> getDevices() {
//		return devices;
//	}
//
//	public void setDevices(Set<LingLingDevice> devices) {
//		this.devices = devices;
//	}

	@Column(name = "orgId")
	public Integer getOrgId() {
		return orgId;
	}

	public void setOrgId(Integer orgId) {
		this.orgId = orgId;
	}

	//@Transient
	//@JsonIgnore
//	@OneToMany(fetch = FetchType.EAGER)
//	@JoinTable(name = "tr_perm_group_user", joinColumns = {@JoinColumn(name = "device_perm_group_id")}, inverseJoinColumns = @JoinColumn(name = "user_id"))
//	public Set<AppUser> getUsers() {
//		return users;
//	}
//
//	public void setUsers(Set<AppUser> users) {
//		this.users = users;
//	}

	@Column(name = "is_use_limit")
	public Integer getIsUseLimit() {
		return isUseLimit;
	}

	public void setIsUseLimit(Integer isUseLimit) {
		this.isUseLimit = isUseLimit;
	}

	@Column(name = "is_week")
	public Integer getIsWeek() {
		return isWeek;
	}

	public void setIsWeek(Integer isWeek) {
		this.isWeek = isWeek;
	}

	@Column(name = "is_workday")
	public Integer getIsWorkday() {
		return isWorkday;
	}

	public void setIsWorkday(Integer isWorkday) {
		this.isWorkday = isWorkday;
	}

	@Column(name = "is_holiday")
	public Integer getIsHoliday() {
		return isHoliday;
	}

	public void setIsHoliday(Integer isHoliday) {
		this.isHoliday = isHoliday;
	}

	@Column(name = "begin_time")
	public String getBeginTime() {
		return beginTime;
	}

	public void setBeginTime(String beginTime) {
		this.beginTime = beginTime;
	}

	@Column(name = "end_time")
	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}


}
