package com.xdap.self_development.domain.view;

import com.definesys.mpaas.query.annotation.SQL;
import com.definesys.mpaas.query.annotation.SQLQuery;
import lombok.Data;

@SQLQuery(value = {
        @SQL(view = "getParameterAndChange",
                sql = "SELECT * FROM ( SELECT p.*, r.pre_template_id, r.modify_details, r.create_time AS r_create_time , ROW_NUMBER() OVER (PARTITION BY r.template_id, r.parameter_id ORDER BY r.create_time DESC) AS rn FROM yfsjglpt_model_revision_record r LEFT JOIN yfsjglpt_model_parameter p ON r.parameter_id = p.id WHERE r.template_id = #templateId AND r.return_num <= #returnNum ) subquery WHERE rn = 1 ORDER BY subquery.r_create_time")
})
@Data
public class TemplateChangeView {
    private Integer parameterNumber;
    private String subsystemName;
    private String parameterType;
    private String partsName;
    private String parameterName;
    private String unit;
    private String parameterSource;
    private String numberOrFormula;
    private String department;
    private String remarks;

    private String modifyDetails;

    private String preTemplateId;
}
