package com.its.op.entity.its.cctv;

import com.its.op.dto.its.cctv.TbCctvCtlrSttsDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * CCTV 상태 Entity Class
 */
@Getter
@NoArgsConstructor//(access = AccessLevel.PROTECTED)
@Builder
@AllArgsConstructor
@ApiModel("CCTV 상태")
@Entity
@Table(name = "TB_CCTV_CTLR_STTS")
public class TbCctvCtlrStts implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("CCTV 관리 번호")  // N NUMBER(10)
    @Id
    @Column(name = "CCTV_CTLR_NMBR", nullable = false, columnDefinition = "NUMBER", length = 10)
    private Long cctvCtlrNmbr;

    @ApiModelProperty("갱신 일시")  // Y VARCHAR2(14)
    @Column(name = "UPDT_DT", length = 14)
    private String updtDt;

    @ApiModelProperty("통신 상태 코드")  // Y VARCHAR2(7)
    @Column(name = "CMNC_STTS_CD", length = 7)
    private String cmncSttsCd;

    @ApiModelProperty("함체 문 상태 코드('CDS')-앞문/뒷문상태가 모두닫힌경우 닫힘")  // Y VARCHAR2(7)
    @Column(name = "CBOX_DOOR_STTS_CD", length = 7)
    private String cboxDoorSttsCd;

    @ApiModelProperty("앞문 상태 코드('CDS')")  // Y VARCHAR2(7)
    @Column(name = "FRONT_DOOR_STTS_CD", length = 7)
    private String frontDoorSttsCd;

    @ApiModelProperty("뒷문 상태 코드('CDS')")  // Y VARCHAR2(7)
    @Column(name = "BACK_DOOR_STTS_CD", length = 7)
    private String backDoorSttsCd;

    @ApiModelProperty("팬 상태 코드('PAS')")  // Y VARCHAR2(7)
    @Column(name = "FAN_STTS_CD", length = 7)
    private String fanSttsCd;

    @ApiModelProperty("히터 상태 코드('HTS')")  // Y VARCHAR2(7)
    @Column(name = "HETR_STTS_CD", length = 7)
    private String hetrSttsCd;

    @ApiModelProperty("Video Input 여부('VDI')")  // Y VARCHAR2(7)
    @Column(name = "VIDEO_INPUT", length = 7)
    private String videoInput;

    @ApiModelProperty("함체 온도")  // Y NUMBER(3)
    @Column(name = "CBOX_TMPR", columnDefinition = "NUMBER", length = 3)
    private Integer cboxTmpr;

    @ApiModelProperty("함체 습도")  // Y NUMBER(3)
    @Column(name = "CBOX_HMDT", columnDefinition = "NUMBER", length = 3)
    private Integer cboxHmdt;

    @ApiModelProperty("PAN")  // Y NUMBER(6)
    @Column(name = "PAN", columnDefinition = "NUMBER", length = 6)
    private Integer pan;

    @ApiModelProperty("TILT")  // Y NUMBER(6)
    @Column(name = "TILT", columnDefinition = "NUMBER", length = 6)
    private Integer tilt;

    @ApiModelProperty("확대/축소범위")  // Y NUMBER(6)
    @Column(name = "ZOOM", columnDefinition = "NUMBER", length = 6)
    private Integer zoom;

    @ApiModelProperty("FOCUS")  // Y NUMBER(6)
    @Column(name = "FOCUS", columnDefinition = "NUMBER", length = 6)
    private Integer focus;

    public TbCctvCtlrSttsDto toDto() {
        return TbCctvCtlrSttsDto.builder()
                .cctvCtlrNmbr(this.cctvCtlrNmbr)
                .updtDt(this.updtDt)
                .cmncSttsCd(this.cmncSttsCd)
                .cboxDoorSttsCd(this.cboxDoorSttsCd)
                .frontDoorSttsCd(this.frontDoorSttsCd)
                .backDoorSttsCd(this.backDoorSttsCd)
                .fanSttsCd(this.fanSttsCd)
                .hetrSttsCd(this.hetrSttsCd)
                .videoInput(this.videoInput)
                .cboxTmpr(this.cboxTmpr)
                .cboxHmdt(this.cboxHmdt)
                .pan(this.pan)
                .tilt(this.tilt)
                .zoom(this.zoom)
                .focus(this.focus)
                .build();
    }

}
