wcs_server_kate_suzhou/WcsMain/DataBase/Dao/AppRouterMethodDao.cs

44 lines
1.6 KiB
C#

using WcsMain.Common;
using WcsMain.DataBase.TableEntity;
using WcsMain.WcsAttribute.AutoFacAttribute;
namespace WcsMain.DataBase.Dao;
[Component]
public class AppRouterMethodDao
{
/// <summary>
/// 查询数据
/// </summary>
/// <param name="routerMethod"></param>
/// <returns></returns>
public List<AppRouterMethod>? Query(AppRouterMethod routerMethod)
{
try
{
var sqlFuc = CommonTool.DbServe.Queryable<AppRouterMethod>()
.WhereIF(routerMethod.Area != default, w => w.Area == routerMethod.Area)
.WhereIF(routerMethod.ClassName != default, w => w.ClassName == routerMethod.ClassName)
.WhereIF(routerMethod.RouterStatus != default, w => w.RouterStatus == routerMethod.RouterStatus)
.WhereIF(routerMethod.ReadFailRouter != default, w => w.ReadFailRouter == routerMethod.ReadFailRouter)
.WhereIF(routerMethod.ErrRouter != default, w => w.ErrRouter == routerMethod.ErrRouter)
.WhereIF(routerMethod.AllowDirection != default, w => w.AllowDirection == routerMethod.AllowDirection)
.WhereIF(routerMethod.Remark != default, w => w.Remark == routerMethod.Remark);
return sqlFuc.ToList();
}
catch(Exception ex)
{
_ = ex;
return default;
}
}
/// <summary>
/// 查询所有
/// </summary>
/// <returns></returns>
public List<AppRouterMethod>? Query() => Query(new AppRouterMethod());
}