column_income.go 582 B

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