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.resignation.FtbResignationConfigurationDTO;
import lombok.Data;

/**
 * 离职原因配置表
 */
@Data
@TableName(value = "ftb_personnels_resignation_configuration")
public class FtbPersonnelsResignationConfiguration extends SuperBaseEntity.SuperCUDBaseEntity<String> {

    /**
     * 离职原因
     */
    @TableField(value = "F_ResignationName")
    private String resignationName;

    /**
     * 是否选中，0选中,1未选中
     */
    @TableField(value = "F_Checked")
    private Integer checked;

    /**
     * 是否有效(1无效,0有效))
     */
    @TableField(value = "F_EnableMark")
    private Integer enableMark;
    /**
     * 是否对员工可见,0否，1是
     */
    @TableField(value = "F_IsVisible")
    private Integer isVisible;
    /**
     * 离职原因类型Id
     */
    @TableField(value = "F_ResignationTypeId")
    private String resignationTypeId;
    /**
     * 类型(1 系统默认 2 自定义)
     */
    @TableField(value = "F_SystemType")
    private Integer systemType;

    public static FtbPersonnelsResignationConfiguration convert(FtbResignationConfigurationDTO resignationConfigurationDTO) {
        if (resignationConfigurationDTO == null) {
            return null;
        }
        FtbPersonnelsResignationConfiguration ftbPersonnelsResignationConfiguration = new FtbPersonnelsResignationConfiguration();
        ftbPersonnelsResignationConfiguration.setId(resignationConfigurationDTO.getConfigId());
        ftbPersonnelsResignationConfiguration.setChecked(resignationConfigurationDTO.getChecked());
        ftbPersonnelsResignationConfiguration.setIsVisible(resignationConfigurationDTO.getIsVisible());
        ftbPersonnelsResignationConfiguration.setResignationName(resignationConfigurationDTO.getResignationName());
        ftbPersonnelsResignationConfiguration.setResignationTypeId(resignationConfigurationDTO.getResignationTypeId());
        ftbPersonnelsResignationConfiguration.setSystemType(resignationConfigurationDTO.getSystemType());
        return ftbPersonnelsResignationConfiguration;
    }
}