fix 代码生成编辑表前端排序bug

This commit is contained in:
不做码农
2021-12-11 11:16:49 +08:00
parent 1fa9d2aad5
commit 21aeb1057b
4 changed files with 66 additions and 58 deletions

View File

@@ -64,31 +64,26 @@ namespace ZR.Repository.System
/// <returns></returns>
public int UpdateGenTableColumn(List<GenTableColumn> tableColumn)
{
foreach (var item in tableColumn)
{
Context.Updateable<GenTableColumn>()
.Where(f => f.TableId == item.TableId)
.SetColumns(it => new GenTableColumn()
{
ColumnComment = item.ColumnComment,
CsharpField = item.CsharpField,
CsharpType = item.CsharpType,
IsQuery = item.IsQuery,
IsEdit = item.IsEdit,
IsInsert = item.IsInsert,
IsList = item.IsList,
QueryType = item.QueryType,
HtmlType = item.HtmlType,
IsRequired = item.IsRequired,
Sort = item.Sort,
Update_time = DateTime.Now,
DictType = item.DictType
})
.Where(f => f.ColumnId == item.ColumnId)
.ExecuteCommand();
}
return 1;
return Context.Updateable(tableColumn)
.WhereColumns(it => new { it.ColumnId, it.TableId})
.UpdateColumns(it => new
{
it.ColumnComment,
it.CsharpField,
it.CsharpType,
it.IsQuery,
it.IsEdit,
it.IsInsert,
it.IsList,
it.QueryType,
it.HtmlType,
it.IsRequired,
it.Sort,
it.Update_time,
it.DictType,
it.Update_by
})
.ExecuteCommand();
}
}
}