package cokr.xit.fims.stat;

import java.util.List;

import cokr.xit.fims.cmmn.CmmnQuery;

/**통계 요청
*
* <p>상세 설명:
*
* <pre>
* ============ 변경 이력 ============
* 2023-10-24	leebj 최초 작성
* ================================
* </pre>
*/
public class StatQuery extends CmmnQuery {

	private static final long serialVersionUID = 1L;

	/**
	 * 구조 형식(aggregate 집계, list 목록)
	 */
	private String structureType;

	/**
	 * 통계 영역
	 */
	private String statDomain;

	/**
	 * 참조 리스트 추가 여부
	 */
	private String refListYn;

	/**
	 * 항목 정보
	 */
	private List<GroupInfo> groupInfoList;

	/**
	 * 수치값 정보
	 */
	private List<NumberValueInfo> numberValueInfoList;

	/**
	 * 코드 서브셋 정보
	 */
	List<CodeSubsetInfo> codeSubsetInfoList;

	/**
	 * 고정적으로 표시할 항목 ID (항목이 단일키일 경우)
	 */
	private String[] fixedItemId;

	/**
	 * 명명된 복합 수치값 구분자
	 */
	private String namedNumberValueSeperator;

	/**
	 * 전역 집계 형식
	 */
	private String globalAggregate;

	/**
	 * 전역 합계 기준 컬럼
	 */
	private String globalSumRefCol;

	/**
	 * 표기할 소수점 자릿수
	 */
	private int decimalPoint;

	/**
	 * 날짜 컬럼
	 */
	private String dayColumn;

	/**
	 * 시작일자
	 */
	private String firstDay;

	/**
	 * 종료일자
	 */
	private String lastDay;

	/**
	 * 날짜 범위
	 */
	private int dayRange;

	/**
	 * 차량구분
	 */
	private String carGb;

	/**
	 * 서손자료 제외
	 */
	private String schExclEnd;

	/**
	 * 렌트카 차량만 조회
	 */
	private String schOnlyRent;


	public String getStructureType() {
		return ifEmpty(structureType, () -> null);
	}

	public <T extends StatQuery> T setStructureType(String structureType) {
		this.structureType = structureType;
		return self();
	}

	public String getStatDomain() {
		return ifEmpty(statDomain, () -> null);
	}

	public <T extends StatQuery> T setStatDomain(String statDomain) {
		this.statDomain = statDomain;
		return self();
	}

	public String getRefListYn() {
		return ifEmpty(refListYn, () -> null);
	}

	public <T extends StatQuery> T setRefListYn(String refListYn) {
		this.refListYn = refListYn;
		return self();
	}

	public List<GroupInfo> getGroupInfoList() {
		return this.groupInfoList;
	}

	public <T extends StatQuery> T setGroupInfoList(List<GroupInfo> groupInfoList) {
		this.groupInfoList = groupInfoList;
		return self();
	}

	public List<NumberValueInfo> getNumberValueInfoList() {
		return this.numberValueInfoList;
	}

	public <T extends StatQuery> T setNumberValueInfoList(List<NumberValueInfo> numberValueInfoList) {
		this.numberValueInfoList = numberValueInfoList;
		return self();
	}


	public String getNamedNumberValueSeperator() {
		return ifEmpty(namedNumberValueSeperator, () -> null);
	}

	public <T extends StatQuery> T setNamedNumberValueSeperator(String namedNumberValueSeperator) {
		this.namedNumberValueSeperator = namedNumberValueSeperator;
		return self();
	}

	public String getGlobalAggregate() {
		return ifEmpty(globalAggregate, () -> null);
	}

	public <T extends StatQuery> T setGlobalAggregate(String globalAggregate) {
		this.globalAggregate = globalAggregate;
		return self();
	}

	public String getGlobalSumRefCol() {
		return ifEmpty(globalSumRefCol, () -> null);
	}

	public <T extends StatQuery> T setGlobalSumRefCol(String globalSumRefCol) {
		this.globalSumRefCol = globalSumRefCol;
		return self();
	}

	public int getDecimalPoint() {
		return ifEmpty(decimalPoint, () -> null);
	}

	public <T extends StatQuery> T setDecimalPoint(int decimalPoint) {
		this.decimalPoint = decimalPoint;
		return self();
	}

	public String[] getFixedItemId() {
		return ifEmpty(fixedItemId, () -> null);
	}

	public <T extends StatQuery> T setFixedItemId(String... fixedItemId) {
		this.fixedItemId = fixedItemId;
		return self();
	}

	public int getDayRange() {
		return ifEmpty(dayRange, () -> null);
	}

	public <T extends StatQuery> T setDayRange(int dayRange) {
		this.dayRange = dayRange;
		return self();
	}

	public String getDayColumn() {
		return ifEmpty(dayColumn, () -> null);
	}

	public <T extends StatQuery> T setDayColumn(String dayColumn) {
		this.dayColumn = dayColumn;
		return self();
	}

	public String getFirstDay() {
		return ifEmpty(firstDay, () -> null);
	}

	public <T extends StatQuery> T setFirstDay(String firstDay) {
		this.firstDay = firstDay;
		return self();
	}

	public String getLastDay() {
		return ifEmpty(lastDay, () -> null);
	}

	public <T extends StatQuery> T setLastDay(String lastDay) {
		this.lastDay = lastDay;
		return self();
	}

	public List<CodeSubsetInfo> getCodeSubsetInfoList() {
		return this.codeSubsetInfoList;
	}

	public <T extends StatQuery> T setCodeSubsetInfoList(List<CodeSubsetInfo> codeSubsetInfoList) {
		this.codeSubsetInfoList = codeSubsetInfoList;
		return self();
	}

	public String getCarGb() {
		return ifEmpty(carGb, () -> null);
	}

	public <T extends StatQuery> T setCarGb(String carGb) {
		this.carGb = carGb;
		return self();
	}

	public String getSchExclEnd() {
		return ifEmpty(schExclEnd, () -> null);
	}

	public <T extends StatQuery> T setSchExclEnd(String schExclEnd) {
		this.schExclEnd = schExclEnd;
		return self();
	}

	public String getSchOnlyRent() {
		return ifEmpty(schOnlyRent, () -> null);
	}

	public <T extends StatQuery> T setSchOnlyRent(String schOnlyRent) {
		this.schOnlyRent = schOnlyRent;
		return self();
	}

}
