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.FtbRangeConfigDTO;
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_range_config" )
public class FtbPersonnlesInfoRangeConfig extends SuperBaseEntity.SuperCUDBaseEntity<String> implements Serializable {

	private static final long serialVersionUID =  424919683198124316L;

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

	/** 首档位 */
   	@TableField(value = "F_FirstGear")
	private Integer firstGear;

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

	/** 区间段数量（个） */
   	@TableField(value = "F_NumberOfGears")
	private Integer numberOfGears;

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

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

	public static FtbPersonnlesInfoRangeConfig covert(FtbRangeConfigDTO configDTO) {
		if (configDTO == null) {
			return null;
		}
		FtbPersonnlesInfoRangeConfig config = new FtbPersonnlesInfoRangeConfig();
		config.setId(configDTO.getId());
		config.setFirstGear(configDTO.getFirstGear());
		config.setIntervalValue(configDTO.getIntervalValue());
		config.setNumberOfGears(configDTO.getNumberOfGears());
		config.setPreviewValue(configDTO.getPreviewValue());
		return config;
	}

}
