智盟项目
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.

db_master_amount_list.go 883 B

1 year ago
123456789101112131415161718192021222324252627282930313233343536
  1. package db
  2. import (
  3. "applet/app/db/model"
  4. "xorm.io/xorm"
  5. )
  6. type MasterAmountFlowDb struct {
  7. Db *xorm.Engine `json:"db"`
  8. }
  9. func (masterAmountFlowDb *MasterAmountFlowDb) Set() { // set方法
  10. masterAmountFlowDb.Db = ZhimengDb
  11. }
  12. func (masterAmountFlowDb *MasterAmountFlowDb) MasterAmountListUpdate(id int, data *model.MasterAmountFlow) bool {
  13. get, err := masterAmountFlowDb.Db.Where("id=?", id).Update(data)
  14. if get == 0 || err != nil {
  15. return false
  16. }
  17. return true
  18. }
  19. func (masterAmountFlowDb *MasterAmountFlowDb) MasterAmountFlowInsert(data *model.MasterAmountFlow) bool {
  20. get, err := masterAmountFlowDb.Db.InsertOne(data)
  21. if get == 0 || err != nil {
  22. return false
  23. }
  24. return true
  25. }
  26. func MasterAmountFlowInsertWithSess(sess *xorm.Session, data *model.MasterAmountFlow) bool {
  27. get, err := sess.InsertOne(data)
  28. if get == 0 || err != nil {
  29. return false
  30. }
  31. return true
  32. }