예제 #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> FindAllByOrderByAndSPClientIDsAndDateNoIntercept(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)
            {
                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));
        }
예제 #3
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));
        }
예제 #4
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));
        }
예제 #5
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));
        }
        private static void SetReportTypeFilter(NHibernateDynamicQueryGenerator <SPRecordEntity> queryBuilder, DayReportType reportType)
        {
            switch (reportType)
            {
            case DayReportType.AllUp:
                //queryBuilder.AddWhereClause(PROPERTY_ISREPORT.Eq(false));
                break;

            case DayReportType.AllUpSuccess:
                //queryBuilder.AddWhereClause(PROPERTY_ISREPORT.Eq(false));
                queryBuilder.AddWhereClause(PROPERTY_ISSTATOK.Eq(true));
                break;

            case DayReportType.Intercept:
                //queryBuilder.AddWhereClause(PROPERTY_ISREPORT.Eq(false));
                queryBuilder.AddWhereClause(PROPERTY_ISSTATOK.Eq(true));
                queryBuilder.AddWhereClause(PROPERTY_ISINTERCEPT.Eq(true));
                break;

            case DayReportType.Down:
                //queryBuilder.AddWhereClause(PROPERTY_ISREPORT.Eq(false));
                queryBuilder.AddWhereClause(PROPERTY_ISSTATOK.Eq(true));
                queryBuilder.AddWhereClause(PROPERTY_ISINTERCEPT.Eq(false));
                break;

            case DayReportType.DownNotSycn:
                //queryBuilder.AddWhereClause(PROPERTY_ISREPORT.Eq(false));
                queryBuilder.AddWhereClause(PROPERTY_ISSTATOK.Eq(true));
                queryBuilder.AddWhereClause(PROPERTY_ISINTERCEPT.Eq(false));
                queryBuilder.AddWhereClause(PROPERTY_ISSYCNTOCLIENT.Eq(false));
                break;

            case DayReportType.DownSycnSuccess:
                //queryBuilder.AddWhereClause(PROPERTY_ISREPORT.Eq(false));
                queryBuilder.AddWhereClause(PROPERTY_ISSTATOK.Eq(true));
                queryBuilder.AddWhereClause(PROPERTY_ISINTERCEPT.Eq(false));
                queryBuilder.AddWhereClause(PROPERTY_ISSYCNTOCLIENT.Eq(true));
                queryBuilder.AddWhereClause(PROPERTY_ISSYCNSUCCESSED.Eq(true));
                break;

            case DayReportType.DownSycnFailed:
                //queryBuilder.AddWhereClause(PROPERTY_ISREPORT.Eq(false));
                queryBuilder.AddWhereClause(PROPERTY_ISSTATOK.Eq(true));
                queryBuilder.AddWhereClause(PROPERTY_ISINTERCEPT.Eq(false));
                queryBuilder.AddWhereClause(PROPERTY_ISSYCNTOCLIENT.Eq(true));
                queryBuilder.AddWhereClause(PROPERTY_ISSYCNSUCCESSED.Eq(false));
                break;

            default:
                break;
            }
        }