// Copyright (c) Shenyang Leading Edge Intelligent Technology Co., Ltd. All rights reserved.

package pm

import (
	"LAPP_LF_MOM_BACKEND/grmi"
	"xorm.io/core"
)

/******************************************************************************
 *
 * @Struct Name              : AssetKpi
 *-----------------------------------------------------------------------------
 *
 * @Description              : AssetKpi的实体映射
 *
 * @Author                   : 代码生成器创建
 *
 * @Date                     : 2021-04-13 11:00:13
 *
 ******************************************************************************/
type AssetKpi struct {
	PlantNr         int           `xorm:"pk int 'PlantNr'" json:"PM_AssetKpi-PlantNr"`
	AssetNr         int           `xorm:"pk int 'AssetNr'" json:"PM_AssetKpi-AssetNr"`
	Kpi             string        `xorm:"pk varchar(20) 'Kpi'" json:"PM_AssetKpi-Kpi"`
	KpiName         string        `xorm:"varchar(40) 'KpiName' not null" json:"PM_AssetKpi-KpiName"`
	KpiType         int           `xorm:"int 'KpiType' not null" json:"PM_AssetKpi-KpiType"`
	TriggerStatus   int           `xorm:"int 'TriggerStatus' not null" json:"PM_AssetKpi-TriggerStatus"`
	ThresholdVal    float64       `xorm:"decimal 'ThresholdVal' not null" json:"PM_AssetKpi-ThresholdVal"`
	ActualVal       float64       `xorm:"decimal 'ActualVal' not null" json:"PM_AssetKpi-ActualVal"`
	ResetAttrNr     int           `xorm:"int 'ResetAttrNr' not null" json:"PM_AssetKpi-ResetAttrNr"`
	CounterVal      int           `xorm:"int 'CounterVal' not null" json:"PM_AssetKpi-CounterVal"`
	CounterCycle    int           `xorm:"int 'CounterCycle' not null" json:"PM_AssetKpi-CounterCycle"`
	CounterCycleVal int           `xorm:"int 'CounterCycleVal' not null" json:"PM_AssetKpi-CounterCycleVal"`
	MainServiceNr   int           `xorm:"int 'MainServiceNr' not null" json:"PM_AssetKpi-MainServiceNr"`
	LastModify      grmi.DateTime `xorm:"datetime 'LastModify' not null updated" json:"PM_AssetKpi-LastModify"`
	LastUser        string        `xorm:"nvarchar(20) 'LastUser' not null" json:"PM_AssetKpi-LastUser"`
	CreateTime      grmi.DateTime `xorm:"datetime 'CreateTime' not null created" json:"PM_AssetKpi-CreateTime"`
}

/******************************************************************************
 *
 * @Function Name            : GetKey
 *-----------------------------------------------------------------------------
 *
 * @Description              : 获取实体的主键
 *
 * @Return Value             : 实体的主键
 *
 * @Author                   : 代码生成器创建
 *
 * @Date                     : 2021-04-13 11:00:13
 *
 ******************************************************************************/
func (self *AssetKpi) GetKey() core.PK {
	return core.PK{self.PlantNr, self.AssetNr, self.Kpi}
}
