39 lines
1006 B
C#
39 lines
1006 B
C#
|
|
using InSituLaboratory.Entities;
|
|||
|
|
using InSituLaboratory.IService;
|
|||
|
|
using Microsoft.EntityFrameworkCore;
|
|||
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Threading.Tasks;
|
|||
|
|
|
|||
|
|
namespace InSituLaboratory.Service
|
|||
|
|
{
|
|||
|
|
public class SysDeviceService : BaseService, ISysDevcieService
|
|||
|
|
{
|
|||
|
|
public SysDeviceService(DbContext context) : base(context)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 根据搜索关键词进行数据检索
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="key"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public IEnumerable<SysDevice> GetDevices(string key)
|
|||
|
|
{
|
|||
|
|
// 需要将搜索关键词加入判断。。。。。。
|
|||
|
|
return this.Set<SysDevice>()
|
|||
|
|
.Where(m =>
|
|||
|
|
|
|||
|
|
string.IsNullOrEmpty(key) ||
|
|||
|
|
|
|||
|
|
m.DeviceType.Contains(key) ||
|
|||
|
|
|
|||
|
|
m.DeviceName.Contains(key)
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|