package cn.lihongjie.coal.empSalary.entity;

import cn.lihongjie.coal.base.entity.OrgCommonEntity;
import cn.lihongjie.coal.empSalaryBatch.entity.EmpSalaryBatchEntity;
import cn.lihongjie.coal.employee.entity.EmployeeEntity;

import jakarta.persistence.Entity;
import jakarta.persistence.ManyToOne;

import lombok.Data;

import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.Formula;

import java.math.BigDecimal;

@Data
@Entity
public class EmpSalaryEntity extends OrgCommonEntity {
    
    @ManyToOne
    private EmpSalaryBatchEntity batch;

    @ManyToOne
    private EmployeeEntity employee;


    @Comment("员工快照")
    private String employeeSnapshot;

    private BigDecimal item0;
    private BigDecimal item1;
    private BigDecimal item2;
    private BigDecimal item3;
    private BigDecimal item4;
    private BigDecimal item5;
    private BigDecimal item6;
    private BigDecimal item7;
    private BigDecimal item8;
    private BigDecimal item9;
    private BigDecimal item10;
    private BigDecimal item11;
    private BigDecimal item12;
    private BigDecimal item13;
    private BigDecimal item14;
    private BigDecimal item15;
    private BigDecimal item16;
    private BigDecimal item17;
    private BigDecimal item18;
    private BigDecimal item19;
    private BigDecimal item20;
    private BigDecimal item21;
    private BigDecimal item22;
    private BigDecimal item23;
    private BigDecimal item24;
    private BigDecimal item25;
    private BigDecimal item26;
    private BigDecimal item27;
    private BigDecimal item28;
    private BigDecimal item29;
    private BigDecimal item30;
    private BigDecimal item31;
    private BigDecimal item32;
    private BigDecimal item33;
    private BigDecimal item34;
    private BigDecimal item35;
    private BigDecimal item36;
    private BigDecimal item37;
    private BigDecimal item38;
    private BigDecimal item39;
    private BigDecimal item40;
    private BigDecimal item41;
    private BigDecimal item42;
    private BigDecimal item43;
    private BigDecimal item44;
    private BigDecimal item45;
    private BigDecimal item46;
    private BigDecimal item47;
    private BigDecimal item48;
    private BigDecimal item49;
    private BigDecimal item50;



    private BigDecimal yfheji;
    private BigDecimal kfheji;
    private BigDecimal sfheji;


    @Comment("归档状态")
    @ColumnDefault("'0'")
    private String archiveStatus = "0";

    @Formula(
            "(select i.name\n"
                    + "from t_dictionary d,\n"
                    + "     t_dictionary_item i\n"
                    + "where d.id = i.dictionary_id\n"
                    + "  and d.code = 'archiveStatus'\n"
                    + "  and i.code = archive_status)")
    private String archiveStatusName;
}
