EF core
程序员文章站
2024-01-04 14:46:04
...
Scaffold-DbContext "server=192.168.0.001;database=xxx;user id=sa;password=xxx;"
Microsoft.EntityFrameworkCore.SqlServer -Tables TabManager -OutputDir DbModels11
//查询体温
var accounttw = await _concardContext.TabRecord
.GroupJoin(_concardContext.WxTemperature, t1 => t1.AccountNo, t2 => t2.Accountno,
(t1, t2) => new
{
t1.Name,
t1.Depart,
Temperature = t2
})
.SelectMany(a => a.Temperature.DefaultIfEmpty(), (a, b) => new
{
a.Name,
a.Depart,
Bodytemperaturet = b.Pushtime.Date == model.datetime.Date ? b.Bodytemperature : "",
Pushtime = b.Pushtime.Date == model.datetime.Date ? b.Pushtime.ToString("HH:mm:ss MM月dd日") : "",
})
.Where(w => w.Depart == model.DepList)
.ToListAsync();