bgm_income.go 635 B

12345678910111213141516171819
  1. package income
  2. import (
  3. "context"
  4. "fmt"
  5. )
  6. const (
  7. _inBGMIncomeSQL = "INSERT INTO bgm_income(aid,sid,mid,cid,income,total_income,tax_money,date,base_income,daily_total_income) VALUES %s ON DUPLICATE KEY UPDATE income=VALUES(income),total_income=VALUES(total_income),tax_money=VALUES(tax_money),base_income=VALUES(base_income),daily_total_income=VALUES(daily_total_income)"
  8. )
  9. // InsertBgmIncome batch insert bgm income
  10. func (d *Dao) InsertBgmIncome(c context.Context, values string) (rows int64, err error) {
  11. res, err := d.db.Exec(c, fmt.Sprintf(_inBGMIncomeSQL, values))
  12. if err != nil {
  13. return
  14. }
  15. return res.RowsAffected()
  16. }