mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 优化 IUpdate 批量 case when 同值的 SQL 生成;#1393
This commit is contained in:
@ -87,7 +87,7 @@ ON DUPLICATE KEY UPDATE
|
||||
Assert.Equal(@"INSERT INTO `tbiou022`(`id`, `name`) VALUES(1, '01'), (2, '02'), (3, '03'), (4, '04')
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`name` = VALUES(`name`)", sql);
|
||||
Assert.Equal(4, iou.ExecuteAffrows());
|
||||
Assert.Equal(5, iou.ExecuteAffrows());
|
||||
|
||||
iou = fsql.InsertOrUpdate<tbiou022>().SetSource(new[] { new tbiou022 { id = 1, name = "001" }, new tbiou022 { id = 2, name = "002" }, new tbiou022 { id = 3, name = "003" }, new tbiou022 { id = 4, name = "004" } });
|
||||
sql = iou.ToSql();
|
||||
|
Reference in New Issue
Block a user