63 lines
2.2 KiB
C#
63 lines
2.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using WX.CRM.BLL.Util;
|
|
using WX.CRM.Common;
|
|
using WX.CRM.IBLL.QH;
|
|
using WX.CRM.Model.Entity;
|
|
|
|
|
|
namespace WX.CRM.BLL.QH
|
|
{
|
|
public class QH_DISCREPANCYGOLD_BL : DbContextRepository<QH_DISCREPANCYGOLD>, IQH_DISCREPANCYGOLD
|
|
{
|
|
public List<QH_DISCREPANCYGOLD> GetList(ref Pager pager, string useraccount)
|
|
{
|
|
using (var db = new crmContext())
|
|
{
|
|
var query = db.QH_DISCREPANCYGOLD.AsQueryable();
|
|
if (!string.IsNullOrEmpty(useraccount))
|
|
{
|
|
query = query.Where(m => m.USERACCOUNT == useraccount);
|
|
}
|
|
query = query.OrderByDescending(m => m.RQ);
|
|
PagerUtil.SetPager(ref query, ref pager);
|
|
return query.ToList();
|
|
}
|
|
}
|
|
|
|
public List<QH_DISCREPANCYGOLD> GetList(ref Pager pager, string userAccount, string accountName, string resId, DateTime? starttime, DateTime? endtime)
|
|
{
|
|
using (var db = new crmContext())
|
|
{
|
|
IQueryable<QH_DISCREPANCYGOLD> queryable = db.QH_DISCREPANCYGOLD.AsQueryable();
|
|
if (!string.IsNullOrEmpty(userAccount))
|
|
{
|
|
queryable = queryable.Where(p => p.USERACCOUNT == userAccount);
|
|
}
|
|
if (!string.IsNullOrEmpty(accountName))
|
|
{
|
|
queryable = queryable.Where(p => p.ACCOUNTNAME.Contains(accountName));
|
|
}
|
|
if (!string.IsNullOrEmpty(resId))
|
|
{
|
|
queryable = queryable.Where(p => p.RESID == resId);
|
|
}
|
|
if (starttime.HasValue)
|
|
{
|
|
queryable = queryable.Where(p => p.RQ >= starttime);
|
|
}
|
|
if (endtime.HasValue)
|
|
{
|
|
endtime = endtime.Value.AddDays(1);
|
|
queryable = queryable.Where(p => p.RQ < endtime);
|
|
}
|
|
queryable = queryable.OrderByDescending(p => p.RQ);
|
|
PagerUtil.SetPager(ref queryable, ref pager);
|
|
return queryable.ToList();
|
|
}
|
|
}
|
|
|
|
}
|
|
} |