package com.its.op.dto.its.vms;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.its.op.dto.its.code.TbCmmnCdDto;
import com.its.op.entity.its.vms.TbVmsCtlr;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.validation.constraints.Pattern;
import javax.validation.constraints.Positive;
import javax.validation.constraints.PositiveOrZero;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * VMS 제어기 DTO Class
 */
@Data
@Builder
@ApiModel("TbVmsCtlrDto(VMS 제어기)")
public class TbVmsCtlrDto implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("VMS 제어기 번호")  // N NUMBER(10)
    @JsonProperty("vms_ctlr_nmbr")
    private Long vmsCtlrNmbr;

    @ApiModelProperty("VMS 제어기 ID")  // Y VARCHAR2(10)
    @JsonProperty("vms_ctlr_id")
    private String vmsCtlrId;

    @ApiModelProperty("VMS 명칭")  // Y VARCHAR2(40)
    @JsonProperty("vms_nm")
    private String vmsNm;

    @ApiModelProperty("VMS 제어기 아이피")  // Y VARCHAR2(20)
    @JsonProperty("vms_ctlr_ip")
    private String vmsCtlrIp;

    @ApiModelProperty("VMS 제어기 포트")  // Y NUMBER(5)
    @JsonProperty("vms_ctlr_port")
    private Integer vmsCtlrPort;

    @ApiModelProperty("VMS 제어기 지역번호")  // Y NUMBER(5)
    @JsonProperty("vms_ctlr_local_no")
    private Integer vmsCtlrLocalNo;

    @ApiModelProperty("VMS 유형 코드(TB_VMS_TYPE)")  // Y VARCHAR2(7)
    @JsonProperty("vms_type_cd")
    private String vmsTypeCd;

    @ApiModelProperty("설치 위치 명")  // Y VARCHAR2(40)
    @JsonProperty("istl_lctn_nm")
    private String istlLctnNm;

    @ApiModelProperty("X 좌표")  // Y NUMBER(11,8)
    @JsonProperty("x_crdn")
    private Double xCrdn;

    @ApiModelProperty("Y 좌표")  // Y NUMBER(10,8)
    @JsonProperty("y_crdn")
    private Double yCrdn;

    @ApiModelProperty("삭제 여부")  // Y CHAR(1)
    @JsonProperty("del_yn")
    private String delYn;

    @ApiModelProperty("웹 카메라 아이피")  // Y VARCHAR2(20)
    @JsonProperty("web_cmra_ip")
    private String webCmraIp;

    @ApiModelProperty("웹카메라 포트")  // Y NUMBER(5)
    @JsonProperty("web_cmra_port")
    private Integer webCmraPort;

    @ApiModelProperty("웹카메라 ID")  // Y VARCHAR2(20)
    @JsonProperty("web_cmra_id")
    private String webCmraId;

    @ApiModelProperty("웹카메라 비밀번호")  // Y VARCHAR2(20)
    @JsonProperty("web_cmra_pwd")
    private String webCmraPwd;

    @ApiModelProperty("스트리밍 세션 명")  // Y VARCHAR2(200)
    @JsonProperty("strm_sesn_nm")
    private String strmSesnNm;

    @ApiModelProperty("운영 모드")  // Y VARCHAR2(5)
    @JsonProperty("oper_mode")
    private String operMode;

    @ApiModelProperty("VMS 최대 표출면 개수")  // Y NUMBER(2)
    @JsonProperty("vms_max_phse_num")
    private Integer vmsMaxPhseNum;

    @ApiModelProperty("기본메시지주기")  // Y NUMBER(3)
    @JsonProperty("def_phse_chng_cycl")
    private Integer defPhseChngCycl;

    @ApiModelProperty("전광판 ON TIME")  // Y VARCHAR2(4)
    @JsonProperty("panl_on_time")
    private String panlOnTime;

    @ApiModelProperty("전광판 OFF TIME")  // Y VARCHAR2(4)
    @JsonProperty("panl_off_time")
    private String panlOffTime;

    @ApiModelProperty("전광판 전원 모드(0x00:꺼짐,0x01:켜짐,0x02:자동,0x09:알수없음)")  // Y NUMBER(3)
    @JsonProperty("panl_pwer_mode")
    private Integer panlPwerMode;

    @ApiModelProperty("FAN 동작모드(0x00:꺼짐,0x01:켜짐,0x02:자동,0x09:알수없음)")  // Y NUMBER(3)
    @JsonProperty("fan_mode")
    private Integer fanMode;

    @ApiModelProperty("팬 동작 온도")  // Y NUMBER(3)
    @JsonProperty("fan_run_tmpr")
    private Integer fanRunTmpr;

    @ApiModelProperty("히터 동작모드(0x00:꺼짐,0x01:켜짐,0x02:자동,0x09:알수없음)")  // Y NUMBER(3)
    @JsonProperty("hetr_mode")
    private Integer hetrMode;

    @ApiModelProperty("히터 동작 온도")  // Y NUMBER(3)
    @JsonProperty("hetr_run_tmpr")
    private Integer hetrRunTmpr;

    @ApiModelProperty("휘도 모드(0x00:주간,0x01:야간,0x02:자동,0x09:수동)")  // Y NUMBER(3)
    @JsonProperty("brgh_mode")
    private Integer brghMode;

    @ApiModelProperty("휘도 현재 단계(0~100)")  // Y NUMBER(3)
    @JsonProperty("brgh_curr_step")
    private Integer brghCurrStep;

    @ApiModelProperty("휘도 주간 단계(0~100)")  // Y NUMBER(3)
    @JsonProperty("brgh_week_step")
    private Integer brghWeekStep;

    @ApiModelProperty("휘도 야간 단계(0~100)")  // Y NUMBER(3)
    @JsonProperty("brgh_nght_step")
    private Integer brghNghtStep;

    @ApiModelProperty("VMS 모듈 오류 율")  // Y NUMBER(3)
    @JsonProperty("modl_err_rate")
    private Integer modlErrRate;

    @ApiModelProperty("VMS 통신 오류 기본 값")  // Y NUMBER(3)
    @JsonProperty("cmnc_fail_rate")
    private Integer cmncFailRate;

    @ApiModelProperty("웹카메라제조사(삼성카메라'Samsung')")  // Y VARCHAR2(50)
    @JsonProperty("web_cmra_cmpy")
    private String webCmraCmpy;

    @ApiModelProperty("웹카메라모델")  // Y VARCHAR2(126)
    @JsonProperty("web_cmra_mdl")
    private String webCmraMdl;

    @ApiModelProperty("설치 위치 주소")  // Y VARCHAR2(200)
    @JsonProperty("istl_lctn_addr")
    private String istlLctnAddr;

    @ApiModelProperty("스트리밍 HTTP 주소")  // Y VARCHAR2(200)
    @JsonProperty("strm_http_addr")
    private String strmHttpAddr;

    @ApiModelProperty("스트리밍 RTSP 주소")  // Y VARCHAR2(200)
    @JsonProperty("strm_rtsp_addr")
    private String strmRtspAddr;


    @ApiModelProperty("WEB RTC 서버 아이피")  // Y VARCHAR2(20)
    @JsonProperty("web_rtc_svr_ip")
    private String webRtcSvrIp;

    @ApiModelProperty("WEB RTC 서버 포트")  // Y NUMBER(5)
    @JsonProperty("web_rtc_svr_port")
    private Integer webRtcSvrPort;

    @ApiModelProperty("WEB RTC ID")  // Y VARCHAR2(56)
    @JsonProperty("web_rtc_id")
    private String webRtcId;

    @ApiModelProperty("대체 영상 이미지 번호")  // Y NUMBER(5)
    @JsonProperty("altt_imag_nmbr")
    private Integer alttImagNmbr;

    @ApiModelProperty("CCTV 대체 표출 여부")  // Y CHAR(1)
    @JsonProperty("altt_imag_dspl_yn")
    private String alttImagDsplYn;

    // Code Description Field
    @ApiModelProperty("VMS 유형 코드(TB_VMS_TYPE) 설명")
    @JsonProperty("vms_type_desc")    // VMS_TYPE_CD
    private String vmsTypeDesc;

    @ApiModelProperty("삭제 여부 설명")
    @JsonProperty("del_desc")    // DEL_YN
    private String delDesc;

    @ApiModel("TbVmsCtlrUpdReq(VMS 제어기 정보변경)")
    @Getter
    @Setter
    @ToString
    @NoArgsConstructor//(access = AccessLevel.PROTECTED)
    public static class TbVmsCtlrUpdReq {

        @ApiModelProperty("VMS 제어기 번호, Nullable = N, NUMBER(10)")  // N NUMBER(10)
        @JsonProperty("vms_ctlr_nmbr")
        @Positive
        private Long vmsCtlrNmbr;

        @ApiModelProperty("VMS 제어기 ID, Nullable = Y, VARCHAR2(10)")  // Y VARCHAR2(10)
        @JsonProperty("vms_ctlr_id")
        @Size(min=1, max=10)
        private String vmsCtlrId;

        @ApiModelProperty("VMS 명칭, Nullable = Y, VARCHAR2(40)")  // Y VARCHAR2(40)
        @JsonProperty("vms_nm")
        @Size(min=1, max=40)
        private String vmsNm;

        @ApiModelProperty("VMS 제어기 아이피, Nullable = Y, VARCHAR2(20)")  // Y VARCHAR2(20)
        @JsonProperty("vms_ctlr_ip")
        @Size(min=1, max=20)
        private String vmsCtlrIp;

        @ApiModelProperty("VMS 제어기 포트, Nullable = Y, NUMBER(5)")  // Y NUMBER(5)
        @JsonProperty("vms_ctlr_port")
        @PositiveOrZero
        private Integer vmsCtlrPort;

        @ApiModelProperty("VMS 제어기 지역번호, Nullable = Y, NUMBER(5)")  // Y NUMBER(5)
        @JsonProperty("vms_ctlr_local_no")
        @PositiveOrZero
        private Integer vmsCtlrLocalNo;

        @ApiModelProperty("VMS 유형 코드(TB_VMS_TYPE), Nullable = Y, VARCHAR2(7)")  // Y VARCHAR2(7)
        @JsonProperty("vms_type_cd")
        @Size(min=1, max=7)
        private String vmsTypeCd;

        @ApiModelProperty("설치 위치 명, Nullable = Y, VARCHAR2(40)")  // Y VARCHAR2(40)
        @JsonProperty("istl_lctn_nm")
        @Size(max=40)
        private String istlLctnNm;

        @ApiModelProperty("X 좌표, , NUMBER(11,8)")  // Y NUMBER(11,8)
        @JsonProperty("x_crdn")
        @PositiveOrZero
        private Double xCrdn;

        @ApiModelProperty("Y 좌표, , NUMBER(10,8)")  // Y NUMBER(10,8)
        @JsonProperty("y_crdn")
        @PositiveOrZero
        private Double yCrdn;

        @ApiModelProperty("삭제 여부, Nullable = Y, CHAR(1)")  // Y CHAR(1)
        @JsonProperty("del_yn")
        @Size(min=1, max=1)
        @Pattern(regexp = "[YN]")
        private String delYn;

        @ApiModelProperty("웹 카메라 아이피, Nullable = Y, VARCHAR2(20)")  // Y VARCHAR2(20)
        @JsonProperty("web_cmra_ip")
        @Size(max=20)
        private String webCmraIp;

        @ApiModelProperty("웹카메라 포트, Nullable = Y, NUMBER(5)")  // Y NUMBER(5)
        @JsonProperty("web_cmra_port")
        @PositiveOrZero
        private Integer webCmraPort;

        @ApiModelProperty("웹카메라 ID, Nullable = Y, VARCHAR2(20)")  // Y VARCHAR2(20)
        @JsonProperty("web_cmra_id")
        @Size(max=20)
        private String webCmraId;

        @ApiModelProperty("웹카메라 비밀번호, Nullable = Y, VARCHAR2(20)")  // Y VARCHAR2(20)
        @JsonProperty("web_cmra_pwd")
        @Size(max=20)
        private String webCmraPwd;

        @ApiModelProperty("스트리밍 세션 명, Nullable = Y, VARCHAR2(200)")  // Y VARCHAR2(200)
        @JsonProperty("strm_sesn_nm")
        @Size(max=200)
        private String strmSesnNm;

        @ApiModelProperty("운영 모드, Nullable = Y, VARCHAR2(5)")  // Y VARCHAR2(5)
        @JsonProperty("oper_mode")
        @Size(min=1, max=5)
        private String operMode;

        @ApiModelProperty("VMS 최대 표출면 개수, Nullable = Y, NUMBER(2)")  // Y NUMBER(2)
        @JsonProperty("vms_max_phse_num")
        @Positive
        private Integer vmsMaxPhseNum;

        @ApiModelProperty("기본메시지주기, Nullable = Y, NUMBER(3)")  // Y NUMBER(3)
        @JsonProperty("def_phse_chng_cycl")
        @Positive
        private Integer defPhseChngCycl;

        @ApiModelProperty("전광판 ON TIME, Nullable = Y, VARCHAR2(4)")  // Y VARCHAR2(4)
        @JsonProperty("panl_on_time")
        @Size(min=1, max=4)
        private String panlOnTime;

        @ApiModelProperty("전광판 OFF TIME, Nullable = Y, VARCHAR2(4)")  // Y VARCHAR2(4)
        @JsonProperty("panl_off_time")
        @Size(min=1, max=4)
        private String panlOffTime;

        @ApiModelProperty("전광판 전원 모드(0x00:꺼짐,0x01:켜짐,0x02:자동,0x09:알수없음), Nullable = Y, NUMBER(3)")  // Y NUMBER(3)
        @JsonProperty("panl_pwer_mode")
        @PositiveOrZero
        private Integer panlPwerMode;

        @ApiModelProperty("FAN 동작모드(0x00:꺼짐,0x01:켜짐,0x02:자동,0x09:알수없음), Nullable = Y, NUMBER(3)")  // Y NUMBER(3)
        @JsonProperty("fan_mode")
        @PositiveOrZero
        private Integer fanMode;

        @ApiModelProperty("팬 동작 온도, Nullable = Y, NUMBER(3)")  // Y NUMBER(3)
        @JsonProperty("fan_run_tmpr")
        @PositiveOrZero
        private Integer fanRunTmpr;

        @ApiModelProperty("히터 동작모드(0x00:꺼짐,0x01:켜짐,0x02:자동,0x09:알수없음), Nullable = Y, NUMBER(3)")  // Y NUMBER(3)
        @JsonProperty("hetr_mode")
        @PositiveOrZero
        private Integer hetrMode;

        @ApiModelProperty("히터 동작 온도, Nullable = Y, NUMBER(3)")  // Y NUMBER(3)
        @JsonProperty("hetr_run_tmpr")
        @PositiveOrZero
        private Integer hetrRunTmpr;

        @ApiModelProperty("휘도 모드(0x00:주간,0x01:야간,0x02:자동,0x09:수동), Nullable = Y, NUMBER(3)")  // Y NUMBER(3)
        @JsonProperty("brgh_mode")
        @PositiveOrZero
        private Integer brghMode;

        @ApiModelProperty("휘도 현재 단계(0~100), Nullable = Y, NUMBER(3)")  // Y NUMBER(3)
        @JsonProperty("brgh_curr_step")
        @PositiveOrZero
        private Integer brghCurrStep;

        @ApiModelProperty("휘도 주간 단계(0~100), Nullable = Y, NUMBER(3)")  // Y NUMBER(3)
        @JsonProperty("brgh_week_step")
        @PositiveOrZero
        private Integer brghWeekStep;

        @ApiModelProperty("휘도 야간 단계(0~100), Nullable = Y, NUMBER(3)")  // Y NUMBER(3)
        @JsonProperty("brgh_nght_step")
        @PositiveOrZero
        private Integer brghNghtStep;

        @ApiModelProperty("VMS 모듈 오류 율, Nullable = Y, NUMBER(3)")  // Y NUMBER(3)
        @JsonProperty("modl_err_rate")
        @PositiveOrZero
        private Integer modlErrRate;

        @ApiModelProperty("VMS 통신 오류 기본 값, Nullable = Y, NUMBER(3)")  // Y NUMBER(3)
        @JsonProperty("cmnc_fail_rate")
        @PositiveOrZero
        private Integer cmncFailRate;

        @ApiModelProperty("웹카메라제조사(삼성카메라'Samsung'), Nullable = Y, VARCHAR2(50)")  // Y VARCHAR2(50)
        @JsonProperty("web_cmra_cmpy")
        @Size(max=50)
        private String webCmraCmpy;

        @ApiModelProperty("웹카메라모델, Nullable = Y, VARCHAR2(126)")  // Y VARCHAR2(126)
        @JsonProperty("web_cmra_mdl")
        @Size(max=126)
        private String webCmraMdl;

        @ApiModelProperty("설치 위치 주소, Nullable = Y, VARCHAR2(200)")  // Y VARCHAR2(200)
        @JsonProperty("istl_lctn_addr")
        @Size(max=200)
        private String istlLctnAddr;

        @ApiModelProperty("스트리밍 HTTP 주소, Nullable = Y, VARCHAR2(200)")  // Y VARCHAR2(200)
        @JsonProperty("strm_http_addr")
        @Size(max=200)
        private String strmHttpAddr;

        @ApiModelProperty("스트리밍 RTSP 주소, Nullable = Y, VARCHAR2(200)")  // Y VARCHAR2(200)
        @JsonProperty("strm_rtsp_addr")
        @Size(max=200)
        private String strmRtspAddr;

        @ApiModelProperty("WEB RTC 서버 아이피, Nullable = Y, VARCHAR2(20)")  // Y VARCHAR2(20)
        @JsonProperty("web_rtc_svr_ip")
        @Size(max=20)
        private String webRtcSvrIp;

        @ApiModelProperty("WEB RTC 서버 포트, Nullable = Y, NUMBER(5)")  // Y NUMBER(5)
        @JsonProperty("web_rtc_svr_port")
        @PositiveOrZero
        private Integer webRtcSvrPort;

        @ApiModelProperty("WEB RTC ID, Nullable = Y, VARCHAR2(56)")  // Y VARCHAR2(56)
        @JsonProperty("web_rtc_id")
        @Size(max=56)
        private String webRtcId;

        @ApiModelProperty("CCTV 대체 영상 이미지 번호, Nullable = Y, NUMBER(5)")  // Y NUMBER(5)
        @JsonProperty("altt_imag_nmbr")
        @PositiveOrZero
        private Integer alttImagNmbr;

        @ApiModelProperty("대체 표출 여부, Nullable = Y, CHAR(1)")  // Y CHAR(1)
        @JsonProperty("altt_imag_dspl_yn")
        @Size(min=1, max=1)
        @Pattern(regexp = "[YN]")
        private String alttImagDsplYn;

        @Builder
        public TbVmsCtlrUpdReq(Long vms_ctlr_nmbr, String vms_ctlr_id, String vms_nm, String vms_ctlr_ip, Integer vms_ctlr_port, Integer vms_ctlr_local_no, String vms_type_cd, String istl_lctn_nm, Double x_crdn, Double y_crdn, String del_yn,
                               String web_cmra_ip, Integer web_cmra_port, String web_cmra_id, String web_cmra_pwd, String strm_sesn_nm, String oper_mode, Integer vms_max_phse_num, Integer def_phse_chng_cycl, String panl_on_time, String panl_off_time, Integer panl_pwer_mode, Integer fan_mode, Integer fan_run_tmpr, Integer hetr_mode, Integer hetr_run_tmpr, Integer brgh_mode, Integer brgh_curr_step, Integer brgh_week_step, Integer brgh_nght_step, Integer modl_err_rate, Integer cmnc_fail_rate, String web_cmra_cmpy, String web_cmra_mdl, String istl_lctn_addr, String strm_http_addr, String strm_rtsp_addr,
                               String web_rtc_svr_ip, Integer web_rtc_svr_port, String web_rtc_id, Integer altt_imag_nmbr, String altt_imag_dspl_yn) {
            this.vmsCtlrNmbr = vms_ctlr_nmbr;
            this.vmsCtlrId = vms_ctlr_id;
            this.vmsNm = vms_nm;
            this.vmsCtlrIp = vms_ctlr_ip;
            this.vmsCtlrPort = vms_ctlr_port;
            this.vmsCtlrLocalNo = vms_ctlr_local_no;
            this.vmsTypeCd = vms_type_cd;
            this.istlLctnNm = istl_lctn_nm;
            this.xCrdn = x_crdn;
            this.yCrdn = y_crdn;
            this.delYn = del_yn;
            this.webCmraIp = web_cmra_ip;
            this.webCmraPort = web_cmra_port;
            this.webCmraId = web_cmra_id;
            this.webCmraPwd = web_cmra_pwd;
            this.strmSesnNm = strm_sesn_nm;
            this.operMode = oper_mode;
            this.vmsMaxPhseNum = vms_max_phse_num;
            this.defPhseChngCycl = def_phse_chng_cycl;
            this.panlOnTime = panl_on_time;
            this.panlOffTime = panl_off_time;
            this.panlPwerMode = panl_pwer_mode;
            this.fanMode = fan_mode;
            this.fanRunTmpr = fan_run_tmpr;
            this.hetrMode = hetr_mode;
            this.hetrRunTmpr = hetr_run_tmpr;
            this.brghMode = brgh_mode;
            this.brghCurrStep = brgh_curr_step;
            this.brghWeekStep = brgh_week_step;
            this.brghNghtStep = brgh_nght_step;
            this.modlErrRate = modl_err_rate;
            this.cmncFailRate = cmnc_fail_rate;
            this.webCmraCmpy = web_cmra_cmpy;
            this.webCmraMdl = web_cmra_mdl;
            this.istlLctnAddr = istl_lctn_addr;
            this.strmHttpAddr = strm_http_addr;
            this.strmRtspAddr = strm_rtsp_addr;
            this.webRtcSvrIp = web_rtc_svr_ip;
            this.webRtcSvrPort = web_rtc_svr_port;
            this.webRtcId = web_rtc_id;
            this.alttImagNmbr = altt_imag_nmbr;
            this.alttImagDsplYn = altt_imag_dspl_yn;
        }

        public TbVmsCtlr toEntity() {
            return TbVmsCtlr.builder()
                    .vmsCtlrNmbr(this.vmsCtlrNmbr)
                    .vmsCtlrId(this.vmsCtlrId)
                    .vmsNm(this.vmsNm)
                    .vmsCtlrIp(this.vmsCtlrIp)
                    .vmsCtlrPort(this.vmsCtlrPort)
                    .vmsCtlrLocalNo(this.vmsCtlrLocalNo)
                    .vmsTypeCd(this.vmsTypeCd)
                    .istlLctnNm(this.istlLctnNm)
                    .xCrdn(this.xCrdn)
                    .yCrdn(this.yCrdn)
                    .delYn(this.delYn)
                    .webCmraIp(this.webCmraIp)
                    .webCmraPort(this.webCmraPort)
                    .webCmraId(this.webCmraId)
                    .webCmraPwd(this.webCmraPwd)
                    .strmSesnNm(this.strmSesnNm)
                    .operMode(this.operMode)
                    .vmsMaxPhseNum(this.vmsMaxPhseNum)
                    .defPhseChngCycl(this.defPhseChngCycl)
                    .panlOnTime(this.panlOnTime)
                    .panlOffTime(this.panlOffTime)
                    .panlPwerMode(this.panlPwerMode)
                    .fanMode(this.fanMode)
                    .fanRunTmpr(this.fanRunTmpr)
                    .hetrMode(this.hetrMode)
                    .hetrRunTmpr(this.hetrRunTmpr)
                    .brghMode(this.brghMode)
                    .brghCurrStep(this.brghCurrStep)
                    .brghWeekStep(this.brghWeekStep)
                    .brghNghtStep(this.brghNghtStep)
                    .modlErrRate(this.modlErrRate)
                    .cmncFailRate(this.cmncFailRate)
                    .webCmraCmpy(this.webCmraCmpy)
                    .webCmraMdl(this.webCmraMdl)
                    .istlLctnAddr(this.istlLctnAddr)
                    .strmHttpAddr(this.strmHttpAddr)
                    .strmRtspAddr(this.strmRtspAddr)
                    .webRtcSvrIp(this.webRtcSvrIp)
                    .webRtcSvrPort(this.webRtcSvrPort)
                    .webRtcId(this.webRtcId)
                    .alttImagNmbr(this.alttImagNmbr)
                    .alttImagDsplYn(this.alttImagDsplYn)
                    .build();
        }

    }

    @ApiModel("TbVmsUsageType(VMS 제어기 용도 유형)")
    @Getter
    @Setter
    @ToString
    @NoArgsConstructor//(access = AccessLevel.PROTECTED)
    public static class TbVmsUsageType {

        @ApiModelProperty("VMS 용도 유형 코드, Nullable = N, VARCHAR(7)")  // Y VARCHAR(7)
        @JsonProperty("vms_usag_type_cd")
        private String vmsUsagTypeCd;

        @ApiModelProperty("VMS 용도 유형 코드 명")
        @JsonProperty("vms_usag_type_nm")
        private String vmsUsagTypeNm;

        @ApiModelProperty("VMS 용도 유형 설명")
        @JsonProperty("vms_usag_type_desc")
        private String vmsUsagTypeDesc;

        @Builder
        public TbVmsUsageType(TbCmmnCdDto cmmnCdDto) {
            this.vmsUsagTypeCd = cmmnCdDto.getCmmnCd();
            this.vmsUsagTypeNm = cmmnCdDto.getCmmnCdKorNm();
            this.vmsUsagTypeDesc = "[" + this.vmsUsagTypeCd + "] " + this.vmsUsagTypeNm;
        }

    }

    @ApiModel("TbVmsType(VMS 제어기 유형)")
    @Getter
    @Setter
    @ToString
    @NoArgsConstructor//(access = AccessLevel.PROTECTED)
    public static class TbVmsType {

        @ApiModelProperty("VMS 유형 코드")  // N VARCHAR(5)
        @JsonProperty("vms_type_cd")
        private String vmsTypeCd;

        @ApiModelProperty("VMS 유형 명")  // Y VARCHAR(40)
        @JsonProperty("vms_type_nm")
        private String vmsTypeNm;

        @ApiModelProperty("VMS 너비")  // Y NUMBER(4)
        @JsonProperty("vms_wdth")
        private Integer vmsWdth;

        @ApiModelProperty("VMS 높이")  // Y NUMBER(4)
        @JsonProperty("vms_hght")
        private Integer vmsHght;

        @ApiModelProperty("행 개수")  // Y NUMBER(3)
        @JsonProperty("row_num")
        private Integer rowNum;

        @ApiModelProperty("열 개수")  // Y NUMBER(3)
        @JsonProperty("col_num")
        private Integer colNum;

        // Code Description Field
        @ApiModelProperty("VMS 유형 코드 설명")
        @JsonProperty("vms_type_desc")    // VMS_TYPE_CD
        private String vmsTypeDesc;

        public TbVmsType(TbCmmnCdDto cmmnCdDto) {
            this.vmsTypeCd = cmmnCdDto.getCmmnCd();
            this.vmsTypeNm = cmmnCdDto.getCmmnCdKorNm();
            this.vmsWdth = Integer.parseInt(cmmnCdDto.getAtrb1());
            this.vmsHght = Integer.parseInt(cmmnCdDto.getAtrb2());
            this.rowNum = 0;
            this.colNum = 0;
            this.vmsTypeDesc = "[" + this.vmsTypeCd + "] " + this.vmsTypeNm;
        }
    }

}
