|
@@ -202,13 +202,17 @@ func DeleteEdbinfoByTraceCodeList(tradeCodeList []string) (err error) {
|
|
|
}
|
|
|
o := orm.NewOrmUsingDB("edb")
|
|
|
err = o.DoTx(func(ctx context.Context, txOrm orm.TxOrmer) error {
|
|
|
- sql := ` DELETE FROM edbdata WHERE TRADE_CODE in (` + strings.Join(tradeCodeList, ",") + `) `
|
|
|
- _, err := txOrm.Raw(sql).Exec()
|
|
|
+ var holder []string
|
|
|
+ for range tradeCodeList {
|
|
|
+ holder = append(holder, "?")
|
|
|
+ }
|
|
|
+ sql := ` DELETE FROM edbdata WHERE TRADE_CODE in (` + strings.Join(holder, ",") + `) `
|
|
|
+ _, err := txOrm.Raw(sql, tradeCodeList).Exec()
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- sql = ` DELETE FROM edbinfo WHERE TRADE_CODE in (` + strings.Join(tradeCodeList, ",") + `)`
|
|
|
- _, err = txOrm.Raw(sql).Exec()
|
|
|
+ sql = ` DELETE FROM edbinfo WHERE TRADE_CODE in (` + strings.Join(holder, ",") + `)`
|
|
|
+ _, err = txOrm.Raw(sql, tradeCodeList).Exec()
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|