Browse Source

事务方法增加批量更新

master
zhenghaorong 2 years ago
parent
commit
00943e75ed
1 changed files with 1 additions and 4 deletions
  1. +1
    -4
      transaction_chain.go

+ 1
- 4
transaction_chain.go View File

@ -405,10 +405,7 @@ func (this *TxQuery) UpdateAllStmt() error {
if len(valSql) > 1 {
setText = " value "
}
sql = helper.StringJoin("insert into ", dbName, " (", strings.Join(this.data, " , "), ")", setText, strings.Join(valSql, ","))
if len(this.value) == 0 {
return errors.New("参数错误,条件值错误")
}
sql = helper.StringJoin("insert into ", dbName, " (", strings.Join(this.data, " , "), ")", setText, strings.Join(valSql, ","), " ON DUPLICATE KEY UPDATE ", strings.Join(updSql, " , "))
if this.debug {
log.Println("insert on duplicate key update sql:", sql, this.value)


Loading…
Cancel
Save