package com.mortals.xhx.module.room.model;
import java.util.List;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.room.model.vo.RoomVo;
import com.mortals.xhx.module.room.model.RoomDeviceEntity;
import lombok.Data;
/**
 * 房间管理实体对象
 *
 * @author zxfei
 * @date 2023-05-29
 */
@Data
public class RoomEntity extends RoomVo {
    private static final long serialVersionUID = 1L;

    /**
     * 房间名称
     */
    private String roomName;
    /**
     * 房间编码
     */
    private String roomCode;
    /**
     * 房间类型(0.会议室,1.办公室)
     */
    private Integer roomType;
    /**
     * 绑定的电子门牌的设备ID
     */
    private Long deviceId;
    /**
     * 绑定的设备名称
     */
    private String deviceName;
    /**
     * 员工人数
     */
    private Long countPerson;
    /**
     * 备注
     */
    private String remark;
    /**
     * 绑定的设备编码
     */
    private String deviceCode;
    /**
     * 房间设备信息信息
     */
    private List<RoomDeviceEntity> roomDeviceList=new ArrayList<>();;
    public List<RoomDeviceEntity> getRoomDeviceList(){
        return roomDeviceList;
    }

    public void setRoomDeviceList(List<RoomDeviceEntity> roomDeviceList){
        this.roomDeviceList = roomDeviceList;
    }
    @Override
    public int hashCode() {
        return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof RoomEntity) {
            RoomEntity tmp = (RoomEntity) obj;
            if (this.getId() == tmp.getId()) {
                return true;
            }
        }
        return false;
    }

    public void initAttrValue(){

        this.roomName = "";

        this.roomCode = "";

        this.roomType = 0;

        this.deviceId = -1L;

        this.deviceName = "";

        this.countPerson = 0L;

        this.remark = "";

        this.deviceCode = "";
    }
}