av_income.go 770 B

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