public List <SPPaymentInfoEntity> FindAllByChannelIDAndClientChannelIDAndPhoneListByOrderBy(SPChannelEntity channelId, int clientChannelId, List <string> phones, string sortFieldName, bool isDesc, int pageIndex, int limit, out int recordCount) { var queryBuilder = new NHibernateDynamicQueryGenerator <SPPaymentInfoEntity>(); if (channelId != null) { queryBuilder.AddWhereClause(PROPERTY_CHANNELID.Eq(channelId)); } if (clientChannelId > 0) { queryBuilder.AddWhereClause(PROPERTY_CHANNLECLIENTID.Eq(clientChannelId)); } if (phones != null && phones.Count > 0) { queryBuilder.AddWhereClause(PROPERTY_MOBILENUMBER.In(phones)); } AddDefaultOrderByToQueryGenerator(sortFieldName, isDesc, queryBuilder); queryBuilder.SetFirstResult((pageIndex - 1) * limit); queryBuilder.SetMaxResults(limit); return(FindListByPageByQueryBuilder(queryBuilder, out recordCount)); }
public List <SPPaymentInfoEntity> FindAllNotSendData(int clientChannelId, DateTime startDate, DateTime endDate, int maxRetryCount) { var queryBuilder = new NHibernateDynamicQueryGenerator <SPPaymentInfoEntity>(); if (startDate == DateTime.MinValue) { startDate = DateTime.Now.Date; } if (endDate == DateTime.MinValue) { endDate = DateTime.Now.Date; } queryBuilder.AddWhereClause(PROPERTY_CHANNLECLIENTID.Eq(clientChannelId)); queryBuilder.AddWhereClause(PROPERTY_CREATEDATE.Ge(startDate.Date)); queryBuilder.AddWhereClause(PROPERTY_CREATEDATE.Lt(endDate.AddDays(1).Date)); queryBuilder.AddWhereClause(PROPERTY_ISINTERCEPT.Eq(false)); queryBuilder.AddWhereClause(PROPERTY_SUCESSSTOSEND.Eq(false)); queryBuilder.AddWhereClause(PROPERTY_ISSYCNDATA.Eq(true)); queryBuilder.AddWhereClause(Or(PROPERTY_SYCNRETRYTIMES.IsNull(), PROPERTY_SYCNRETRYTIMES.Lt(maxRetryCount))); queryBuilder.AddOrderBy(PROPERTY_ID.Asc()); return(this.FindListByQueryBuilder(queryBuilder)); }
public List <SPPaymentInfoEntity> FindAllByChannelIDAndClientChannelIDAndPhoneList(SPChannelEntity channelId, int clientChannelId, List <string> phones) { var queryBuilder = new NHibernateDynamicQueryGenerator <SPPaymentInfoEntity>(); if (channelId != null) { queryBuilder.AddWhereClause(PROPERTY_CHANNELID.Eq(channelId)); } if (clientChannelId > 0) { queryBuilder.AddWhereClause(PROPERTY_CHANNLECLIENTID.Eq(clientChannelId)); } if (phones != null && phones.Count > 0) { queryBuilder.AddWhereClause(PROPERTY_MOBILENUMBER.In(phones)); } queryBuilder.AddOrderBy(PROPERTY_ID.Asc()); return(FindListByQueryBuilder(queryBuilder)); }