日期:2014-05-19 浏览次数:20878 次
hql = "select DISTINCT P.* from Account P inner join [Order] o on P.Id = o.AccountId right join (select od.orderID,o1.AccountId from [Order] o1 inner join OrderDetail od on o1.id = od.orderid group by o1.AccountId,od.orderid having count(*) >=2) T on P.Id = T.AccountId where P.AreaId In(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32) and P.Deleted='False' order by P.CreatedOn ";
list = session .CreateSQLQuery(hql) .SetFirstResult(skipCount) .SetMaxResults(pageSize + skipCount) .List<T>() .Take(pageSize);