往来单位列表支持高级查询

dev
嵇文龙 3 months ago
parent e4273640e6
commit c813074860

@ -260,12 +260,6 @@ public class ClientInfoService : ServiceBase, IClientInfoService
{ {
//序列化查询条件 //序列化查询条件
var whereList = request.GetConditionalModels(Db); var whereList = request.GetConditionalModels(Db);
foreach (var item in whereList)
{
var condition = (ConditionalModel)item;
condition.FieldName = "c." + condition.FieldName.ToUpperCamelCase();
}
var query = TenantDb.Queryable<InfoClient>() var query = TenantDb.Queryable<InfoClient>()
.LeftJoin<InfoClientContact>((c, c1) => c.Id == c1.ClientId) .LeftJoin<InfoClientContact>((c, c1) => c.Id == c1.ClientId)
.LeftJoin<InfoClientContract>((c, c1, c2) => c.Id == c2.ClientId) .LeftJoin<InfoClientContract>((c, c1, c2) => c.Id == c2.ClientId)
@ -297,7 +291,14 @@ public class ClientInfoService : ServiceBase, IClientInfoService
} }
} }
var result = await query.Where(whereList).Select<ClientInfoRes>().ToQueryPageAsync(request.PageCondition); var result = await query.Select((c, c1, c2, ct) => new ClientInfoRes
{
CodeName = c.CodeName,
Name = c.Name,
ShortName = c.ShortName,
EnShortName = c.EnShortName,
EnFullName = c.EnFullName
}, true).MergeTable().Where(whereList).ToQueryPageAsync(request.PageCondition);
if (result.Data?.Count > 0) if (result.Data?.Count > 0)
{ {

Loading…
Cancel
Save