12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- package data_manage
- import (
- "eta_gn/eta_task/global"
- "time"
- )
- type BusinessSysInteractionLog struct {
- ID uint32 `gorm:"primaryKey;column:id;type:int(10) unsigned;not null" json:"-"`
- InteractionKey string `gorm:"unique;column:interaction_key;type:varchar(128);not null;default:''" json:"interactionKey"` // 记录Key
- InteractionVal string `gorm:"column:interaction_val;type:text;default:null" json:"interactionVal"` // 记录值
- Remark string `gorm:"column:remark;type:varchar(128);not null;default:''" json:"remark"` // 备注
- ModifyTime time.Time `gorm:"column:modify_time;type:datetime;default:null" json:"modifyTime"` // 修改日期
- CreateTime time.Time `gorm:"column:create_time;type:datetime;default:null" json:"createTime"` // 创建时间
- }
- func (m *BusinessSysInteractionLog) TableName() string {
- return "business_sys_interaction_log"
- }
- var BusinessSysInteractionLogColumns = struct {
- ID string
- InteractionKey string
- InteractionVal string
- Remark string
- ModifyTime string
- CreateTime string
- }{
- ID: "id",
- InteractionKey: "interaction_key",
- InteractionVal: "interaction_val",
- Remark: "remark",
- ModifyTime: "modify_time",
- CreateTime: "create_time",
- }
- func (m *BusinessSysInteractionLog) Create() (err error) {
- err = global.DEFAULT_DmSQL.Create(m).Error
- if err != nil {
- return
- }
- return
- }
- func (m *BusinessSysInteractionLog) Update(cols []string) (err error) {
- err = global.DEFAULT_DmSQL.Select(cols).Updates(m).Error
- return
- }
- var BinlogFileNameKey = "binlog_filename" // binlog文件名
- var BinlogPositionKey = "binlog_binlog_position" // binlog位置
- var CrmIndexLastUpdateTime = "crm_index_update_time" // crm数据
- func GetBusinessSysInteractionLogByKey(key string) (item *BusinessSysInteractionLog, err error) {
- sql := `SELECT * FROM business_sys_interaction_log WHERE 1=1 AND interaction_key = ? LIMIT 1`
- err = global.DEFAULT_DmSQL.Raw(sql, key).First(&item).Error
- return
- }
|