You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
911 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package BaseParentDao
import (
"dsBaseRpc/Utils/CommonUtil"
"dsBaseRpc/Utils/DbUtil"
"dsBaseRpc/models"
)
var db = DbUtil.Engine
//增加
func AddBaseParent(model models.TBaseParent) (int64, error) {
return db.Insert(model)
}
//记录操作日志
func ActionLog(ms []models.TBaseParent, actionCode string, actionPersonId string, actionIp string) {
msLog := make([]models.TBaseParentLog, len(ms))
for i := range ms {
CommonUtil.CopyFields(ms[i], &msLog[i])
msLog[i].LogId = CommonUtil.GetUUID()
msLog[i].ActionCode = actionCode
msLog[i].ActionIpAddress = actionIp
msLog[i].ActionPersonId = actionPersonId
}
//批量保存
db.Insert(msLog)
}
//通过主键集合查找对应的实体bean集合
func GetByIds(ids []string) ([]models.TBaseParent, error) {
ms := make([]models.TBaseParent, 0)
err := db.In("person_id", ids).Find(&ms)
if err != nil {
return nil, err
}
return ms, nil
}