package incheon.ags.dtad.vo;


import java.sql.Date;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;


/**
 * @Class Name : DtadGeoVO.java
 * @Description : dtad VO class
 * @Modification Information
 * @
 * @  수정일         수정자                   수정내용
 * @ -------    --------    ---------------------------
 * @ 2026.01.21    이진주          최초 생성
 *
 *  @author (주)올포랜드 이진주
 *  @since 2026.01.21
 *  @version 1.0
 *  @see
 *  
 */
@Schema(description = "수치지형도 관리자 페이지 - 공간정보자료 제공관리 대장 VO")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class DtadGeoVO {
	@Schema(description = "일련번호")
	private Integer sn;
	
	@Schema(description = "제목")
	private String aplyTtl;
	
	@Schema(description = "자료유형")
	private String dataType;
	
	@Schema(description = "자료구분")
	private String dataSe;
	
	@Schema(description = "수량")
	private Double aplyMapshtCo; 
	
	@Schema(description = "단가")
	private Integer untprc;
	
	@Schema(description = "열람자소속")
	private String rcpntOgdp;
	
	@Schema(description = "열람자")
	private String rcpntNm;
	
	@Schema(description = "수정자명")
	private String upterNm; 
	
	@Schema(description = "예고문")
	private String notiOfdoc; 
	
	@Schema(description = "사유")
	private String rsn; 
	
	@Schema(description = "비고")
	private String rmrk; 
	
	@Schema(description = "공개여부")
	private String rlsYn;
	
	@Schema(description = "등록자아이디")
	private String frstRegId;
	
	@Schema(description = "등록일자")
	private Date frstRegDt;
	
	@Schema(description = "수정자아이디")
	private String lastMdfcnId;
	
	@Schema(description = "수정일자")
	private Date lastMdfcnDt;
	
	@Schema(description = "총금액")
	private Double sumPrice;
	
	private String dataTypCode;
	
	@Schema(description = "자료구분 코드 한글명")
	private String dataDivCode;
	
	@Schema(description = "공개여부 코드 한글명")
	private String pubynCode;
	
	@Schema(description = "신청일자 조회시작일")
	private Date regStartDate;
	
	@Schema(description = "신청일자 조회종료일")
	private Date regEndDate;
	
	
	
	// 페이지네이션
	@Schema(description = "현재페이지")
	private Integer pageIndex = 1;

	@Schema(description = "페이지갯수")
	private Integer pageUnit = 10;

	@Schema(description = "시작 인덱스")
	private Integer firstIndex = 0;

	@Schema(description = "마지막 인덱스")
	private Integer lastIndex = 1;

	@Schema(description = "페이지 시작번호")
	private Integer startPage;

	@Schema(description = "recordCountPerPage")
	private Integer recordCountPerPage = 10;

	@Schema(description = "총 페이지 수")
	private Integer totalPage;
	
	@Schema(description = "총 개수")
	private Integer totalCount;

	@Schema(description = "총 개수")
	public void setPageInfo(int totalCount) {
		// DB OFFSET 계산
		this.firstIndex = (pageIndex - 1) * recordCountPerPage;
		// 전체 페이지 수
		this.totalPage = (int) Math.ceil((double) totalCount / recordCountPerPage);
		// 현재 묶음 시작 페이지
		this.startPage = ((pageIndex - 1) / 10) * 10 + 1;
		// 현재 묶음 마지막 페이지
		this.lastIndex = Math.min(startPage + pageUnit - 1, totalPage);
		
		this.totalCount = totalCount;
	}
	
	@Schema(description = "엑셀 다운로드 여부")
	private Boolean isExcel = false;
	
	
	//사용자정보
	@Schema(description = "사용자명")
	private String userNm;
	
	@Schema(description = "사용자명")
	private String userId;
	
}
