|
@@ -11,7 +11,7 @@ namespace CZKJ.GBRS2.Logic
|
11
|
11
|
{
|
12
|
12
|
public class PriceAnnouncementLogic : LogicBase<PriceAnnouncementEntity>, IPriceAnnouncement
|
13
|
13
|
{
|
14
|
|
- public IList<PriceAnnouncementEntity> GetList(int typeId, DateTime? startTime, DateTime? endTime)
|
|
14
|
+ public IList<PriceAnnouncementEntity> GetList(int typeId, DateTime? startTime, DateTime? endTime,int pageIndex, int pageSize, out int rowsCount)
|
15
|
15
|
{
|
16
|
16
|
IQueryable<PriceAnnouncementEntity> query = DbContext.Set<PriceAnnouncementEntity>();
|
17
|
17
|
if (typeId != 0)
|
|
@@ -22,7 +22,8 @@ namespace CZKJ.GBRS2.Logic
|
22
|
22
|
{
|
23
|
23
|
query = query.Where(x => x.DateTime >= startTime && x.DateTime <= endTime);
|
24
|
24
|
}
|
25
|
|
- var result = query.Join(DbContext.Set<TypeEntity>(), x => x.Typeofinsuance, y => y.Id, (x, y) => new { x, y.Name }).OrderByDescending(x => x.x.DateTime).ToList();
|
|
25
|
+ rowsCount = query.Count();
|
|
26
|
+ var result = query.Join(DbContext.Set<TypeEntity>(), x => x.Typeofinsuance, y => y.Id, (x, y) => new { x, y.Name }).OrderByDescending(x => x.x.DateTime).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();
|
26
|
27
|
return result.Select(x => new PriceAnnouncementEntity
|
27
|
28
|
{
|
28
|
29
|
TypeName = x.Name,
|