コード例 #1
0
        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));
        }
コード例 #2
0
        public List <SPPaymentInfoEntity> FindAllDefaultClientPaymentByOrderByDate(List <SPClientEntity> spClientEntities, DateTime startDate, DateTime endDate, string sortFieldName, bool isDesc, int pageIndex, int limit, out int recordCount)
        {
            var queryBuilder = new NHibernateDynamicQueryGenerator <SPPaymentInfoEntity>();

            queryBuilder.AddWhereClause(PROPERTY_CLIENTID.In(spClientEntities));


            if (startDate != DateTime.MinValue)
            {
                queryBuilder.AddWhereClause(PROPERTY_CREATEDATE.Ge(startDate.Date));
            }


            if (endDate != DateTime.MinValue)
            {
                queryBuilder.AddWhereClause(PROPERTY_CREATEDATE.Lt(endDate.AddDays(1).Date));
            }

            AddDefaultOrderByToQueryGenerator(sortFieldName, isDesc, queryBuilder);

            queryBuilder.SetFirstResult((pageIndex - 1) * limit);

            queryBuilder.SetMaxResults(limit);

            return(FindListByPageByQueryBuilder(queryBuilder, out recordCount));
        }
コード例 #3
0
        public List <SPPaymentInfoEntity> FindAllByOrderByAndClientIDAndDateNoIntercept(SPClientEntity clientEntity, DateTime startDate, DateTime endDate, string sortFieldName, bool isdesc, int pageIndex, int limit, out int recordCount)
        {
            var queryBuilder = new NHibernateDynamicQueryGenerator <SPPaymentInfoEntity>();

            queryBuilder.AddWhereClause(PROPERTY_CLIENTID.Eq(clientEntity));


            if (startDate == DateTime.MinValue)
            {
                startDate = DateTime.Now;
            }


            if (endDate == DateTime.MinValue)
            {
                endDate = DateTime.Now;
            }

            queryBuilder.AddWhereClause(PROPERTY_CREATEDATE.Ge(startDate.Date));

            queryBuilder.AddWhereClause(PROPERTY_CREATEDATE.Lt(endDate.AddDays(1).Date));

            queryBuilder.AddWhereClause(PROPERTY_ISINTERCEPT.Eq(false));

            AddDefaultOrderByToQueryGenerator(sortFieldName, isdesc, queryBuilder);

            queryBuilder.SetFirstResult((pageIndex - 1) * limit);

            queryBuilder.SetMaxResults(limit);

            return(FindListByPageByQueryBuilder(queryBuilder, out recordCount));
        }
コード例 #4
0
        public List <SPPaymentInfoEntity> FindAllNotSendData(SPChannelEntity channelId, SPClientEntity clientId, DateTime startdate, DateTime endDate, int maxDataCount)
        {
            var queryBuilder = new NHibernateDynamicQueryGenerator <SPPaymentInfoEntity>();


            if (channelId != null)
            {
                queryBuilder.AddWhereClause(PROPERTY_CHANNELID.Eq(channelId));
            }

            if (clientId != null)
            {
                queryBuilder.AddWhereClause(PROPERTY_CLIENTID.Eq(clientId));
            }

            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.SetMaxResults(maxDataCount);

            return(this.FindListByQueryBuilder(queryBuilder));
        }
コード例 #5
0
        public List <SPPaymentInfoEntity> FindAllDataTableByOrderByAndCleintIDAndChanneLIDAndDate(SPChannelEntity channelId, SPClientEntity clientId, DateTime startDateTime, DateTime enddateTime, string dataType, string sortFieldName, bool isDesc, int pageIndex, int pageSize, out int recordCount)
        {
            var queryBuilder = new NHibernateDynamicQueryGenerator <SPPaymentInfoEntity>();

            if (channelId != null)
            {
                queryBuilder.AddWhereClause(PROPERTY_CHANNELID.Eq(channelId));
            }

            if (clientId != null)
            {
                queryBuilder.AddWhereClause(PROPERTY_CLIENTID.Eq(clientId));
            }


            if (startDateTime == DateTime.MinValue)
            {
                startDateTime = DateTime.Now;
            }


            if (enddateTime == DateTime.MinValue)
            {
                enddateTime = DateTime.Now;
            }

            queryBuilder.AddWhereClause(PROPERTY_CREATEDATE.Ge(startDateTime.Date));

            queryBuilder.AddWhereClause(PROPERTY_CREATEDATE.Lt(enddateTime.AddDays(1).Date));

            switch (dataType)
            {
            case "All":
                break;

            case "Intercept":
                queryBuilder.AddWhereClause(PROPERTY_ISINTERCEPT.Eq(true));
                break;

            case "Down":
                queryBuilder.AddWhereClause(PROPERTY_ISINTERCEPT.Eq(false));
                break;

            case "DownSycn":
                queryBuilder.AddWhereClause(PROPERTY_ISINTERCEPT.Eq(false));
                queryBuilder.AddWhereClause(PROPERTY_SUCESSSTOSEND.Eq(true));
                break;
            }

            AddDefaultOrderByToQueryGenerator(sortFieldName, isDesc, queryBuilder);

            queryBuilder.SetFirstResult((pageIndex - 1) * pageSize);

            queryBuilder.SetMaxResults(pageSize);

            return(FindListByPageByQueryBuilder(queryBuilder, out recordCount));
        }
コード例 #6
0
        public List <SPPaymentInfoEntity> FindAllByOrderByAndSPClientGroupIDAndDateAndProviceNoIntercept(List <SPClientEntity> spClientEntities, int spClientGroupID, DateTime startDate, DateTime endDate, string province, string city, string phone, string sortFieldName, bool isdesc, int pageIndex, int limit, out int recordCount)
        {
            var queryBuilder = new NHibernateDynamicQueryGenerator <SPPaymentInfoEntity>();

            queryBuilder.AddWhereClause(PROPERTY_CLIENTID.In(spClientEntities));


            if (startDate == DateTime.MinValue)
            {
                startDate = DateTime.Now;
            }


            if (endDate == DateTime.MinValue)
            {
                endDate = DateTime.Now;
            }

            if (!string.IsNullOrEmpty(province))
            {
                if (province.Equals("NULL"))
                {
                    queryBuilder.AddWhereClause(PROPERTY_PROVINCE.Eq(""));
                }
                else
                {
                    queryBuilder.AddWhereClause(PROPERTY_PROVINCE.Eq(province));
                }
            }

            if (!string.IsNullOrEmpty(city))
            {
                queryBuilder.AddWhereClause(PROPERTY_CITY.Eq(city));
            }


            if (!string.IsNullOrEmpty(phone))
            {
                queryBuilder.AddWhereClause(PROPERTY_MOBILENUMBER.Like(phone, MatchMode.Start));
            }

            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_CLIENTGROUPID.Eq(spClientGroupID));

            AddDefaultOrderByToQueryGenerator(sortFieldName, isdesc, queryBuilder);

            queryBuilder.SetFirstResult((pageIndex - 1) * limit);

            queryBuilder.SetMaxResults(limit);

            return(FindListByPageByQueryBuilder(queryBuilder, out recordCount));
        }
コード例 #7
0
        private NHibernateDynamicQueryGenerator <SPRecordEntity> BuilderQueryGenerator(SPChannelEntity channel, SPCodeEntity code,
                                                                                       SPSClientEntity client, string dataType,
                                                                                       DateTime?startDate, DateTime?endDate, List <QueryFilter> filters,
                                                                                       string orderByColumnName, bool isDesc)
        {
            var queryBuilder = new NHibernateDynamicQueryGenerator <SPRecordEntity>();

            if (channel != null)
            {
                queryBuilder.AddWhereClause(PROPERTY_CHANNELID.Eq(channel));
            }

            if (code != null)
            {
                queryBuilder.AddWhereClause(PROPERTY_CODEID.Eq(code));
            }

            if (client != null)
            {
                queryBuilder.AddWhereClause(PROPERTY_CLIENTID.Eq(client));
            }

            DayReportType reportType = (DayReportType)Enum.Parse(typeof(DayReportType), dataType);

            SetReportTypeFilter(queryBuilder, reportType);

            if (startDate != null)
            {
                queryBuilder.AddWhereClause(PROPERTY_CREATEDATE.Ge(startDate.Value.Date));
            }

            if (endDate != null)
            {
                queryBuilder.AddWhereClause(PROPERTY_CREATEDATE.Lt(endDate.Value.Date.AddDays(1)));
            }


            AddQueryFiltersToQueryGenerator(filters, queryBuilder);

            AddDefaultOrderByToQueryGenerator(orderByColumnName, isDesc, queryBuilder);
            return(queryBuilder);
        }