新增测点 创建维护模块
This commit is contained in:
29
repository/device-point/point_name.go
Normal file
29
repository/device-point/point_name.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package device_point
|
||||
|
||||
import (
|
||||
"energy-management-system/global"
|
||||
device_point_model "energy-management-system/model/device-point"
|
||||
)
|
||||
|
||||
// // PointName 测点名称
|
||||
//
|
||||
// type PointName struct {
|
||||
// Id int `gorm:"column:id;primaryKey" json:"id"`
|
||||
// Name string `gorm:"column:name;comment:测点名称" json:"name"`
|
||||
// Created time.Time `gorm:"column:created;autoCreateTime;comment:创建时间" json:"created"`
|
||||
// Updated time.Time `gorm:"column:updated;autoUpdateTime;comment:修改时间" json:"updated"`
|
||||
// DeletedAt gorm.DeletedAt `gorm:"index;comment:删除时间" json:"-"`
|
||||
// }
|
||||
//
|
||||
// func (r *PointName) TableName() string {
|
||||
// return global.AppConf.Db.TablePrefix + "point_names"
|
||||
// }
|
||||
|
||||
func (r *DevicePoint) GetPointNameList(qr map[string]interface{}) (p []*device_point_model.PointName, err error) {
|
||||
db := global.Db
|
||||
for key, value := range qr {
|
||||
db = db.Where(key, value)
|
||||
}
|
||||
err = db.Order("id DESC").Find(&p).Error
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user