package com.xdap.self_development.domain.pojo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.definesys.mpaas.query.annotation.*;
import com.definesys.mpaas.query.model.MpaasBasePojo;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.sql.Timestamp;

@EqualsAndHashCode(callSuper = true)
@Data
@Table("yfsjglpt_model_responsible_person")
@SQLQuery(value = {
        @SQL(view = "getResponsibleAndName",
                sql = "SELECT ymrp.* FROM yfsjglpt_model_responsible_person ymrp where ymrp.person_level = #level order by creation_date desc")
})
public class ResponsiblePersonPojo extends MpaasBasePojo {
    @RowID(sequence = "responsible_person_s", type = RowIDType.UUID)
    private String id;
    private String departmentId;
    private String userId;
    @ExcelProperty("责任部门")
    @ColumnWidth(20)
    private String department;
    @ExcelProperty("子系统")
    @ColumnWidth(20)
    private String subsystem;
    private Integer personLevel;

    private Timestamp creationDate;

    @ExcelProperty("责任人")
    @ColumnWidth(20)
    @Column(type = ColumnType.CALCULATE)
    private String username;

    @Column(type = ColumnType.JAVA)
    @ExcelProperty("工号")
    @ColumnWidth(20)
    private String userAccount;

    public static String[] getFieldDescriptions() {
        return new String[]{
                "必填，并且必须为研发总院的子部门，如‘研发部’",
                "必填",
                "必填，填写名字即可",
                "非必填，如果名字有重复，则加上工号"};
    }
}