package jnpf.model.personnels.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import jnpf.base.entity.SuperBaseEntity;
import jnpf.model.personnels.dto.range.FtbRangeConfigDIYDTO;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

/**
 * 人事区间配置自定义配置 
 * @author admin
 * @create 2025-04-07 
 */

@Getter
@Setter
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName ( value ="ftb_personnles_info_diy_range_config" )
public class FtbPersonnlesInfoDiyRangeConfig extends SuperBaseEntity.SuperCUDBaseEntity<String> implements Serializable {


	/** 配置id */
	@TableField(value = "F_ConfigId")
	private String configId;

	/** 开始区间 */
	@TableField(value = "F_StartInterval")
	private Integer startInterval;

	/** 结束区间 */
	@TableField(value = "F_EndInterval")
	private Integer endInterval;

	/** 起始值 */
	@TableField(value = "F_InitialValue")
	private Integer initialValue;

	/** 间隔值 */
	@TableField(value = "F_IntervalValue")
	private Integer intervalValue;

	/** 区间计数(从1开始) */
	@TableField(value = "F_IntervalCount")
	private Integer intervalCount;

	/** 以上勾选(0否1是) */
	@TableField(value = "F_IsAbove")
	private Integer isAbove;

	/** 预览值(、分割) */
	@TableField(value = "F_PreviewValue")
	private String previewValue;

	/** 有效标志 */
	@TableField(value = "F_EnabledMark")
	private Integer enabledMark;

	public static FtbPersonnlesInfoDiyRangeConfig covert(FtbRangeConfigDIYDTO configDTO) {
		if (configDTO == null) {
			return null;
		}
		FtbPersonnlesInfoDiyRangeConfig ftbPersonnlesInfoDiyRangeConfig = new FtbPersonnlesInfoDiyRangeConfig();
		ftbPersonnlesInfoDiyRangeConfig.setId(configDTO.getId());
		ftbPersonnlesInfoDiyRangeConfig.setStartInterval(configDTO.getStartInterval());
		ftbPersonnlesInfoDiyRangeConfig.setEndInterval(configDTO.getEndInterval());
		ftbPersonnlesInfoDiyRangeConfig.setInitialValue(configDTO.getInitialValue());
		ftbPersonnlesInfoDiyRangeConfig.setIntervalValue(configDTO.getIntervalValue());
		ftbPersonnlesInfoDiyRangeConfig.setIntervalCount(configDTO.getIntervalCount());
		ftbPersonnlesInfoDiyRangeConfig.setPreviewValue(configDTO.getPreviewValue());
		ftbPersonnlesInfoDiyRangeConfig.setIsAbove(configDTO.getIsAbove());
		return ftbPersonnlesInfoDiyRangeConfig;
	}

}
