package kpi_c_title

import "time"

const (
	MAX_KPI_C_ID = 99
)

type KpiCTitle struct {
	ID          int        `gorm:"column:id;primary_key;auto_increment" json:"id"`
	NeType      *string    `gorm:"column:ne_type;default:NULL," json:"neType,omitempty"`
	KpiID       *string    `gorm:"column:kpi_id;default:NULL," json:"kpiId,omitempty"`
	Title       *string    `gorm:"column:title;default:NULL," json:"title,omitempty"`
	Expression  *string    `gorm:"column:expression;default:NULL," json:"expression,omitempty"`
	ExprAlias   string     `gorm:"-" json:"exprAlias"`
	Status      string     `gorm:"column:status;default:'Active'" json:"status"`
	Unit        *string    `gorm:"column:unit" json:"unit,omitempty"`
	Description *string    `gorm:"column:description;default:NULL," json:"description,omitempty"`
	CreatedBy   *string    `gorm:"column:created_by;default:NULL," json:"createdBy,omitempty"`
	UpdatedAt   *time.Time `gorm:"column:updated_at;default:current_timestamp()," json:"updatedAt,omitempty"`
}

type KpiCTitleQuery struct {
	ID        int    `json:"id" form:"id"`
	NeType    string `json:"neType" form:"neType"`
	Status    string `json:"status" form:"status"`
	SortField string `json:"sortField" form:"sortField" binding:"omitempty,oneof=created_at"` // 排序字段，填写结果字段
	SortOrder string `json:"sortOrder" form:"sortOrder" binding:"omitempty,oneof=asc desc"`   // 排序升降序，asc desc
	PageNum   int    `json:"pageNum" form:"pageNum"`
	PageSize  int    `json:"pageSize" form:"pageSize"`
}

func (k *KpiCTitle) TableName() string {
	return "kpi_c_title"
}
