|
@@ -118,16 +118,6 @@ func (m *Mysql) ReplaceBatchByTx(tx *sql.Tx, tableName string, fields []string,
|
|
return m.insertOrReplaceBatchByTx(tx, "REPLACE", "", tableName, fields, values)
|
|
return m.insertOrReplaceBatchByTx(tx, "REPLACE", "", tableName, fields, values)
|
|
}
|
|
}
|
|
|
|
|
|
-//批量更新
|
|
|
|
-func (m *Mysql) ReplaceIgnoreBatch(tableName string, fields []string, values []interface{}) (int64, int64) {
|
|
|
|
- return m.ReplaceIgnoreBatchByTx(nil, tableName, fields, values)
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-//带事务的批量更新
|
|
|
|
-func (m *Mysql) ReplaceIgnoreBatchByTx(tx *sql.Tx, tableName string, fields []string, values []interface{}) (int64, int64) {
|
|
|
|
- return m.insertOrReplaceBatchByTx(tx, "REPLACE", "IGNORE", tableName, fields, values)
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
func (m *Mysql) insertOrReplaceBatchByTx(tx *sql.Tx, tp string, afterInsert, tableName string, fields []string, values []interface{}) (int64, int64) {
|
|
func (m *Mysql) insertOrReplaceBatchByTx(tx *sql.Tx, tp string, afterInsert, tableName string, fields []string, values []interface{}) (int64, int64) {
|
|
placeholders := []string{}
|
|
placeholders := []string{}
|
|
for range fields {
|
|
for range fields {
|