package com.xdap.self_development.domain.pojo;

import com.definesys.mpaas.query.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 数据变动说明表
 * </p>
 *
 * @author Lys111
 * @since 2025-11-26
 */
@SQLQuery(value = {
        @SQL(view = "selectLastedComment"
                , sql = "SELECT * FROM ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subsystem_name, parameter_name ORDER BY creation_date DESC) AS rn FROM data_change_comment WHERE param_detail_id IN (#paramIds) ) ranked WHERE rn = 1 ORDER BY subsystem_name, parameter_name")
})
@Data
@EqualsAndHashCode(callSuper = false)
@Table("data_change_comment")
public class DataChangeCommentPojo implements Serializable {

    /**
     * ID
     */
    @RowID(sequence = "data_change_comment_s", type = RowIDType.UUID)
    private String id;


    private String paramDetailId;
    private String engineModelId;
    private String subsystemName;
    private String parameterType;
    //零部件
    private String partsName;
    private String parameterName;

    /**
     * 审批中的值
     */
    private String parameterValue;

    /**
     * 变动说明
     */
    private String changeComment;
    /**
     * 变动说明
     */
    private String unit;

    /**
     * 创建人
     */
    private String createdBy;

    /**
     * 创建时间
     */
    private Date creationDate;

    /**
     * 最后更新人
     */
    private String lastUpdatedBy;

    /**
     * 最后更新时间
     */
    private Date lastUpdateDate;


}
