Example #1
0
        /// <summary>
        /// 公告查询
        /// </summary>
        /// <param name="filter">id</param>
        /// <returns></returns>
        public static QueryResult <BulletinVO> SearchBulletinPageLists(BulletinFilter filter)
        {
            var cmd = new DataCommand("InfoManage.SearchBulletinLists");

            SetCondition(cmd, filter);
            return(cmd.Query <BulletinVO>(filter, "t.create_time", null, true));
        }
Example #2
0
        /// <summary>
        /// 查询回复列表
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        public static QueryResult <SubjectReplyEntity> SearchReplyPageList(QF_Subject filter)
        {
            var cmd = new DataCommand("Subject.SearchReplyPageList");

            cmd.SetParameter("@Id", DbType.Int32, filter.SubjectId);
            return(cmd.Query <SubjectReplyEntity>(filter, "id ASC", null, true));
        }
Example #3
0
        /// <summary>
        /// 考试配置分页查询
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        public static QueryResult <ExamView> SearchExamPageLists(ExamFilter filter)
        {
            var cmd = new DataCommand("MockTest.SearchExamPageList");

            SetCondition(cmd, filter);
            return(cmd.Query <ExamView>(filter, "begin_time desc ", null, true));
        }
Example #4
0
        /// <summary>
        /// 单位积分查询
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        public static QueryResult <Department_Plan_RankVO> SearchDepartmentPlanRankPageList(Department_Plan_RankFilter filter)
        {
            var cmd = new DataCommand("Plan.SearchDepartmentPlanRankPageList");

            SetCondition(cmd, filter);
            return(cmd.Query <Department_Plan_RankVO>(filter, "tdpr.create_time desc", null, true));
        }
Example #5
0
        /// <summary>
        /// 问题查询
        /// </summary>
        /// <param name="filter">id</param>
        /// <returns></returns>
        public static QueryResult <QusetionView> SearchQuestionPageLists(QusetionFilter filter)
        {
            var cmd = new DataCommand("MockTest.SearchQuestionPageList");

            SetCondition(cmd, filter);
            return(cmd.Query <QusetionView>(filter, "d.NAME ,q.order_num ", null, true));
        }
Example #6
0
        /// <summary>
        /// 用户绑定烟感器列表
        /// </summary>
        /// <param name="clientSysNo"></param>
        /// <returns></returns>
        public static QueryResult <QR_SmokeDetector> LoadUserSmokeDeletetorList(QF_UserDetector filter)
        {
            DataCommand cmd = new DataCommand("LoadUserSmokeDeletetorList");

            switch (filter.Status)
            {
            case UISmokeDetectorStatus.FireWarning:
                cmd.QuerySetCondition(" AND sd.Status IN (99,100)");
                break;

            case UISmokeDetectorStatus.LowPowerWarning:
                cmd.QuerySetCondition(" AND sd.Status IN (90)");
                break;

            case UISmokeDetectorStatus.OffLine:
                cmd.QuerySetCondition(" AND sd.Status IN (78,79,80)");
                break;

            case UISmokeDetectorStatus.Online:
                cmd.QuerySetCondition(" AND sd.Status IN (0,1,2,3,4,5,6,7,8,90,99,100)");
                break;
            }
            cmd.QuerySetCondition("c.ClientSysNo", ConditionOperation.Equal, DbType.Int32, filter.ClientSysNo);
            return(cmd.Query <QR_SmokeDetector>(filter, "sd.Status DESC, sd.InDate DESC"));
        }
Example #7
0
        /// <summary>
        /// 查询推文评论列表
        /// </summary>
        /// <param name="filter">过滤条件</param>
        /// <returns>返回推文评论列表</returns>
        public static QueryResult <ArticleReplyEntity> SearchPageList(QF_ArticleReply filter)
        {
            var cmd = new DataCommand("ArticleReply.SearchPageList");

            cmd.SetParameter("@ArticleId", System.Data.DbType.Int32, filter.ArticleId);
            return(cmd.Query <ArticleReplyEntity>(filter, "create_time DESC", null, true));
        }
Example #8
0
        /// <summary>
        /// 测验历史记录分页查询
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        public static QueryResult <ExamTestView> SearchExamTestPageLists(ExamTestFilter filter)
        {
            var cmd = new DataCommand("MockTest.SearchExamTestPageLists");

            SetCondition(cmd, filter);
            //排序
            return(cmd.Query <ExamTestView>(filter, filter.sortColumn + " desc ", null, true));
        }
Example #9
0
        /// <summary>
        /// 查询活动列表
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        public static QueryResult <RoleEntity> SearchPageList(QueryFilter filter)
        {
            var cmd = new DataCommand("Role.SearchPageList");

            cmd.QuerySetCondition("common_status", ConditionOperation.Equal, DbType.Int32, CommonStatus.Actived);
            cmd.CommandText = cmd.CommandText.Replace("#STRWHERE#", cmd.QueryConditionString);
            return(cmd.Query <RoleEntity>(filter, "create_time DESC", null, true));
        }
Example #10
0
        public static QueryResult <SmokeDetectorStatusLog> QueryDeviceNoticeList(QF_SmokeDetectorStatusLog filter)
        {
            DataCommand cmd = new DataCommand("QueryDeviceNoticeList");

            cmd.QuerySetCondition("m.SmokeDetectorCode", ConditionOperation.Equal, DbType.String, filter.DeviceCode);
            QueryResult <SmokeDetectorStatusLog> result = cmd.Query <SmokeDetectorStatusLog>(filter, "m.BeginTime DESC ");

            return(result);
        }
Example #11
0
        /// <summary>
        /// 查询活动列表
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        public static QueryResult <UserEntity> SearchPageList(QF_User filter)
        {
            var cmd = new DataCommand("User.SearchPageList");

            cmd.QuerySetCondition("tau.user_full_name", ConditionOperation.Like, DbType.String, filter.UserFullName);
            cmd.QuerySetCondition("tau.login_name", ConditionOperation.Equal, DbType.String, filter.LoginName);
            cmd.QuerySetCondition("tau.common_status", ConditionOperation.NotEqual, DbType.Int32, CommonStatus.Deleted);
            cmd.CommandText = cmd.CommandText.Replace("#STRWHERE#", cmd.QueryConditionString);
            return(cmd.Query <UserEntity>(filter, "tau.create_time DESC", null, true));
        }
Example #12
0
        /// <summary>
        /// 分页查询CompanyInstaller信息
        /// </summary>
        public static QueryResult <CompanyInstaller> QueryCompanyInstallerList(QF_CompanyInstaller filter)
        {
            DataCommand cmd = new DataCommand("QueryCompanyInstallerList");

            cmd.QuerySetCondition("CompanySysNo", ConditionOperation.Equal, DbType.Int32, filter.CompanySysNo);

            QueryResult <CompanyInstaller> result = cmd.Query <CompanyInstaller>(filter, " InstallerSysNo DESC");

            return(result);
        }
Example #13
0
        /// <summary>
        /// 分页查询SysFunction信息
        /// </summary>
        public static QueryResult <SysFunction> QuerySysFunctionList(QF_SysFunction filter)
        {
            DataCommand cmd = new DataCommand("QuerySysFunctionList");

            cmd.QuerySetCondition("FunctionName", ConditionOperation.Equal, DbType.String, filter.FunctionName);
            cmd.QuerySetCondition("CommonStatus", ConditionOperation.Equal, DbType.Int32, filter.CommonStatus);
            QueryResult <SysFunction> result = cmd.Query <SysFunction>(filter, " SysNo DESC");

            return(result);
        }
        /// <summary>
        /// 分页查询MsgTemplate信息
        /// </summary>
        public static QueryResult <MsgTemplate> QueryMsgTemplateList(QF_MsgTemplate filter)
        {
            DataCommand cmd = new DataCommand("QueryMsgTemplateList");

            cmd.QuerySetCondition("m.MsgType", ConditionOperation.Equal, DbType.Int32, filter.MsgType);
            cmd.QuerySetCondition("m.ActionCode", ConditionOperation.Equal, DbType.String, filter.ActionCode);
            cmd.QuerySetCondition("m.CompanySysNo", ConditionOperation.Equal, DbType.Int32, filter.CompanySysNo);
            QueryResult <MsgTemplate> result = cmd.Query <MsgTemplate>(filter, " SysNo DESC");

            return(result);
        }
Example #15
0
        /// <summary>
        /// 分页查询SysPermission信息
        /// </summary>
        public static QueryResult <SysPermission> QuerySysPermissionList(QF_SysPermission filter)
        {
            DataCommand cmd = new DataCommand("QuerySysPermissionList");

            cmd.QuerySetCondition("CommonStatus", ConditionOperation.Equal, DbType.Int32, filter.CommonStatus);
            cmd.QuerySetCondition("FunctionSysNo", ConditionOperation.Equal, DbType.Int32, filter.FunctionSysNo);
            cmd.QuerySetCondition("CommonStatus", ConditionOperation.NotEqual, DbType.Int32, CommonStatus.Deleted);//TODO: 排除 权限 delete的?
            QueryResult <SysPermission> result = cmd.Query <SysPermission>(filter, " SysNo DESC");

            return(result);
        }
Example #16
0
        public static QueryResult <SmokeDetectorMessage> QuerySmokeDetectorMessage(QF_SmokeDetectorMessage filter)
        {
            DataCommand cmd = new DataCommand("QuerySmokeDetectorMessage");

            cmd.QuerySetCondition("m.MasterID", ConditionOperation.Equal, DbType.String, filter.MasterID);
            cmd.QuerySetCondition("m.MasterName", ConditionOperation.Equal, DbType.String, filter.MasterName);
            cmd.QuerySetCondition("m.MsgType", ConditionOperation.Equal, DbType.Int32, filter.MsgType);
            cmd.QuerySetCondition("m.Status", ConditionOperation.Equal, DbType.Int32, 1);
            QueryResult <SmokeDetectorMessage> result = cmd.Query <SmokeDetectorMessage>(filter, "m.handleTime DESC");

            return(result);
        }
Example #17
0
        public static QueryResult <ExternalDepartmentStatistics> ExternalDepartmentStatisticsList(QF_Report filter)
        {
            var externalTagValue = int.Parse(AppSettingManager.GetSetting("ExternalDepartmentTag", "ExternalTag"));
            var cmd = new DataCommand("Report.ExternalDepartmentStatisticsList");

            cmd.SetParameter("@TagValue", DbType.Int32, externalTagValue);
            cmd.QuerySetCondition("a.create_time", ConditionOperation.MoreThanEqual, DbType.DateTime, filter.StartTime);
            cmd.QuerySetCondition("a.create_time", ConditionOperation.LessThan, DbType.DateTime, handleEndTime(handleEndTime(filter.EndTime)));
            cmd.QuerySetCondition("c.department_id", ConditionOperation.Equal, DbType.Int32, filter.DepartmentId);
            cmd.QuerySetCondition("c.is_delete", ConditionOperation.Equal, DbType.Int32, DeletedEnums.Actived);
            cmd.CommandText = cmd.CommandText.Replace("#STRWHERE#", cmd.QueryConditionString);
            return(cmd.Query <ExternalDepartmentStatistics>(filter, "a.create_time DESC", null, true));
        }
Example #18
0
        /// <summary>
        /// 分页查询SysMenu信息
        /// </summary>
        public static QueryResult <SysMenu> QuerySysMenuList(QF_SysMenu filter)
        {
            DataCommand cmd = new DataCommand("QuerySysMenuList");

            cmd.QuerySetCondition("MenuName", ConditionOperation.Like, DbType.String, filter.MenuName);
            cmd.QuerySetCondition("Type", ConditionOperation.Equal, DbType.Int32, filter.Type);
            cmd.QuerySetCondition("CommonStatus", ConditionOperation.Equal, DbType.Int32, filter.CommonStatus);
            cmd.QuerySetCondition("ParentSysNo", ConditionOperation.Equal, DbType.Int32, filter.ParentSysNo);
            cmd.QuerySetCondition("CommonStatus", ConditionOperation.NotEqual, DbType.Int32, CommonStatus.Deleted);//TODO: 排除Deleted的菜单?
            QueryResult <SysMenu> result = cmd.Query <SysMenu>(filter, " SysNo DESC");

            return(result);
        }
Example #19
0
        /// <summary>
        /// 分页查询Role信息
        /// </summary>
        public static QueryResult <Role> QueryRoleList(QF_Role filter)
        {
            DataCommand cmd = new DataCommand("QueryRoleList");

            cmd.QuerySetCondition("r.SysNo", ConditionOperation.Equal, DbType.Int32, filter.SysNo);
            cmd.QuerySetCondition("r.RoleName", ConditionOperation.Like, DbType.String, cmd.SetSafeParameter(filter.RoleName));
            cmd.QuerySetCondition("r.CommonStatus", ConditionOperation.Equal, DbType.Int32, filter.CommonStatus);
            cmd.QuerySetCondition("r.CommonStatus", ConditionOperation.NotEqual, DbType.Int32, CommonStatus.Deleted);//TOOD: 查询需不需要排除角色删除(已禁用)的?
            cmd.QuerySetCondition("r.ApplicationID", ConditionOperation.Equal, DbType.String, cmd.SetSafeParameter(filter.ApplicationID));
            QueryResult <Role> result = cmd.Query <Role>(filter, " r.SysNo DESC");

            return(result);
        }
        /// <summary>
        /// 分页查询AddressSmoke信息
        /// </summary>
        public static QueryResult <AddressMap> QueryAddressMapList(AddressMapFilter filter)
        {
            DataCommand cmd = new DataCommand("QueryAddressMapList");

            cmd.QuerySetCondition("AddressSysNo", ConditionOperation.Equal, DbType.Int32, filter.AddressSysNo);
            if (filter.AddressSysNos != null)
            {
                cmd.QuerySetCondition("AddressSysNo", ConditionOperation.In, DbType.String, string.Join(",", filter.AddressSysNos));
            }

            QueryResult <AddressMap> result = cmd.Query <AddressMap>(filter, "SysNo ASC");

            return(result);
        }
Example #21
0
        /// <summary>
        /// 查询客户烟感器设备列表
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        public static QueryResult <QR_SmokeDetector> QuerySmokeDetectorList(QF_SmokeDetector filter)
        {
            DataCommand cmd = new DataCommand("QuerySmokeDetectorList");

            if (filter.Status.HasValue)
            {
                switch (filter.Status)
                {
                case UISmokeDetectorStatus.FireWarning:
                    cmd.QuerySetCondition(" AND sd.Status IN (99,100)");
                    break;

                case UISmokeDetectorStatus.LowPowerWarning:
                    cmd.QuerySetCondition(" AND sd.Status IN (90)");
                    break;

                case UISmokeDetectorStatus.OffLine:
                    cmd.QuerySetCondition(" AND sd.Status IN (78,79,80)");
                    break;

                case UISmokeDetectorStatus.Online:
                    cmd.QuerySetCondition(" AND sd.Status IN (0,1,2,3,4,5,6,7,8,90,99,100)");
                    break;
                }
            }
            string clientWhere = "";
            string clientJoin  = "LEFT JOIN";

            if (!string.IsNullOrWhiteSpace(filter.ClientName))
            {
                clientWhere = "WHERE c.Name like '%" + cmd.SetSafeParameter(filter.ClientName) + "%'";
                clientJoin  = "INNER JOIN";
            }

            cmd.CommandText = cmd.CommandText.Replace("#CLINETSTRWHERE#", clientWhere).Replace("#CLINETJOIN# ", clientJoin);
            cmd.QuerySetCondition("sd.Status", ConditionOperation.NotEqual, DbType.Int32, -999);
            if (filter.CompanySysNo.HasValue && filter.CompanySysNo.Value > 0)
            {
                cmd.QuerySetCondition("sd.CompanySysNo", ConditionOperation.Equal, DbType.Int32, filter.CompanySysNo.Value);
            }
            cmd.QuerySetCondition("sd.InstallerSysNo", ConditionOperation.In, DbType.Int32, filter.InstallSysNos);
            cmd.QuerySetCondition("sd.Code", ConditionOperation.Like, DbType.String, filter.Code);
            cmd.QuerySetCondition("sd.DeviceID", ConditionOperation.Like, DbType.String, filter.DeviceID);
            cmd.QuerySetCondition("sd.AddressCode", ConditionOperation.LikeLeft, DbType.String, filter.AddressCode);
            cmd.QuerySetCondition("sd.InstallerSysNo", ConditionOperation.Equal, DbType.Int32, filter.InstallerSysNo);
            QueryResult <QR_SmokeDetector> result = cmd.Query <QR_SmokeDetector>(filter, "sd.SysNo DESC ");

            return(result);
        }
        /// <summary>
        /// 分页查询Company信息
        /// </summary>
        public static QueryResult <Company> QueryCompanyList(QF_Company filter)
        {
            DataCommand cmd = new DataCommand("QueryCompanyList");

            cmd.QuerySetCondition("c.SysNo", ConditionOperation.Equal, DbType.Int32, filter.SysNo);

            cmd.QuerySetCondition("c.Name", ConditionOperation.Like, DbType.String, filter.Name);

            cmd.QuerySetCondition("c.CompanyStatus", ConditionOperation.Equal, DbType.Int32, filter.CompanyStatus);


            QueryResult <Company> result = cmd.Query <Company>(filter, " SysNo DESC");

            return(result);
        }
Example #23
0
        /// <summary>
        /// 分页查询Client信息
        /// </summary>
        public static QueryResult <Client> QueryClientList(ClientFilter filter)
        {
            DataCommand cmd = new DataCommand("QueryClientList");

            cmd.QuerySetCondition("d.CompanySysNo", ConditionOperation.Equal, DbType.Int32, filter.CompanySysNo);
            cmd.QuerySetCondition("cd.SmokeDetectorCode", ConditionOperation.Equal, DbType.AnsiString, cmd.SetSafeParameter(filter.SmokeDetectorCode));

            if (!string.IsNullOrWhiteSpace(filter.Keyword))
            {
                cmd.QuerySetCondition(string.Format(" AND (c.Name like '%{0}%' or c.Cellphone like '%{0}%' or c.Cellphone2 like '%{0}%'  or c.Cellphone3 like '%{0}%')", cmd.SetSafeParameter(filter.Keyword)));
            }
            cmd.SetParameter("@Cellphone", DbType.Int32, filter.ExactCellphone);
            QueryResult <Client> result = cmd.Query <Client>(filter, " c.Name ASC");

            return(result);
        }
Example #24
0
        /// <summary>
        /// 查询推文列表
        /// </summary>
        /// <param name="filter">过滤条件</param>
        /// <returns>返回推文列表</returns>
        public static QueryResult <ArticleEntity> SearchPageList(QF_Article filter)
        {
            var cmd = new DataCommand("Article.SearchPageList");

            cmd.QuerySetCondition("title", ConditionOperation.Like, DbType.String, filter.Title);
            cmd.QuerySetCondition("is_delete", ConditionOperation.Equal, DbType.Int32, (int)DeletedEnums.Actived);
            if (filter.StartTime.HasValue)
            {
                cmd.QuerySetCondition("create_time", ConditionOperation.MoreThanEqual, DbType.DateTime, filter.StartTime);
            }
            if (filter.EndTime.HasValue)
            {
                cmd.QuerySetCondition("create_time", ConditionOperation.LessThan, DbType.DateTime, filter.EndTime.Value.AddDays(1));
            }
            cmd.CommandText = cmd.CommandText.Replace("#STRWHERE#", cmd.QueryConditionString);
            return(cmd.Query <ArticleEntity>(filter, "create_time DESC", null, true));
        }
        /// <summary>
        /// 分页查询Company信息
        /// </summary>
        public static QueryResult <Company> QueryCompanyList2(QF_Company filter)
        {
            DataCommand cmd = new DataCommand("QueryCompanyList");

            cmd.QuerySetCondition("c.SysNo", ConditionOperation.Equal, DbType.Int32, filter.SysNo);

            if (!string.IsNullOrEmpty(filter.Name))
            {
                filter.Name = cmd.SetSafeParameter(filter.Name);
                cmd.QuerySetCondition($"And (c.Name like '%{ filter.Name}%' Or c.ContactName like '%{ filter.Name}%' Or c.ContactCellPhone like '%{ filter.Name}%')");
            }
            cmd.QuerySetCondition("c.CompanyStatus", ConditionOperation.Equal, DbType.Int32, filter.CompanyStatus);


            QueryResult <Company> result = cmd.Query <Company>(filter, " SysNo DESC");

            return(result);
        }
Example #26
0
        /// <summary>
        /// 分页查询Client信息
        /// </summary>
        public static QueryResult <Client> QueryAllClientList(ClientFilter filter)
        {
            DataCommand cmd        = new DataCommand("QueryAllClientList");
            string      joinString = "";

            if (!string.IsNullOrWhiteSpace(filter.SmokeDetectorCode))
            {
                joinString = string.Format("INNER JOIN (select distinct ClientSysNo from smoke.clientsmokedetector where  (SmokeDetectorCode like '%{0}%')) cd on cd.ClientSysNo =  c.SysNo", cmd.SetSafeParameter(filter.SmokeDetectorCode));
            }
            if (!string.IsNullOrWhiteSpace(filter.Keyword))
            {
                cmd.QuerySetCondition(string.Format(" AND (c.Name like '%{0}%' or c.Cellphone like '%{0}%' or c.Cellphone2 like '%{0}%'  or c.Cellphone3 like '%{0}%')", cmd.SetSafeParameter(filter.Keyword)));
            }
            cmd.CommandText = cmd.CommandText.Replace("#JOINSQL#", joinString);
            QueryResult <Client> result = cmd.Query <Client>(filter, " c.Name ASC");

            return(result);
        }
Example #27
0
        /// <summary>
        /// 查询主题列表
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        public static QueryResult <SubjectVO> SearchPageList(QF_Subject filter)
        {
            var cmd = new DataCommand("Subject.SearchPageList");

            cmd.SetParameter("@keyWords", DbType.String, filter.Keyword + "");
            cmd.SetParameter("@beginDate", DbType.DateTime, filter.StartTime.HasValue ? filter.StartTime.Value.ToString("yyyy-MM-dd") : null);
            cmd.SetParameter("@endDate", DbType.DateTime, filter.EndTime.HasValue ? filter.EndTime.Value.ToString("yyyy-MM-dd") : null);
            //cmd.SetParameter("@beginDate", DbType.DateTime, filter.StartTime);
            //cmd.SetParameter("@endDate", DbType.DateTime, filter.EndTime);
            cmd.SetParameter("@catId", DbType.Int32, filter.CatId);
            cmd.SetParameter("@departmentId", DbType.Int32, filter.DepartmentId);
            cmd.SetParameter("@vendorName", DbType.String, filter.VendorName);
            //cmd.SetParameter("@StartNum", DbType.Int32, filter.sta);
            //cmd.SetParameter("@PageSize", DbType.Int32, id);
            //SetCondition(cmd, filter, "Search");
            var result = cmd.Query <SubjectVO>(filter, "MaxCommentTime DESC, CreateTime DESC", null, true);

            return(result);
        }
Example #28
0
        public static QueryResult <ProductVendorStatisticsVO> ProductVendorStatisticsList(QF_Report filter)
        {
            var cmd = new DataCommand("Report.ProductVendorStatisticsList");

            if (filter.StatisticsObject == StatisticsObject.Product)
            {
                cmd.ReplaceAndSetSQLTag("TagProductFragment");
                cmd.ReplaceSQLTag("TagVendorFragment", string.Empty);
            }
            else
            {
                cmd.ReplaceAndSetSQLTag("TagVendorFragment");
                cmd.ReplaceSQLTag("TagProductFragment", string.Empty);
            }
            cmd.QuerySetCondition("ts.create_time", ConditionOperation.MoreThanEqual, DbType.DateTime, filter.StartTime);
            cmd.QuerySetCondition("ts.create_time", ConditionOperation.LessThan, DbType.DateTime, handleEndTime(handleEndTime(filter.EndTime)));
            cmd.QuerySetCondition("ts.department_id", ConditionOperation.Equal, DbType.Int32, filter.DepartmentId);
            cmd.QuerySetCondition("ts.is_delete", ConditionOperation.Equal, DbType.Int32, DeletedEnums.Actived);
            cmd.CommandText = cmd.CommandText.Replace("#STRWHERE#", cmd.QueryConditionString);
            return(cmd.Query <ProductVendorStatisticsVO>(filter, "count(1) DESC", null, true));
        }
Example #29
0
        public static QueryResult <QR_Topic> QueryTopicList(QF_Topic filter)
        {
            var cmd = new DataCommand("QueryTopicList");

            cmd.QuerySetCondition("t.Title", ConditionOperation.Like, DbType.String, filter.Title);
            //if (filter.CategoryID!="0") {
            //    cmd.QuerySetCondition("tc.CategoryID", ConditionOperation.Equal, DbType.String, filter.CategoryID);
            //}
            if (filter.CategorySysNo > 0)
            {
                cmd.QuerySetCondition("t.TopicCategorySysNo", ConditionOperation.Equal, DbType.Int32, filter.CategorySysNo);
            }
            //if (!string.IsNullOrEmpty(filter.MasterName) && !string.IsNullOrWhiteSpace(filter.MasterName))
            //{
            //    cmd.QuerySetCondition("tc.MasterName", ConditionOperation.Equal, DbType.String, filter.MasterName);
            //}
            cmd.QuerySetCondition("t.TopicStatus", ConditionOperation.Equal, DbType.Int32, filter.TopicStatus);
            cmd.QuerySetCondition("t.TopicStatus", ConditionOperation.NotEqual, DbType.Int32, TopicStatus.Delete);
            QueryResult <QR_Topic> result = cmd.Query <QR_Topic>(filter, "t.IsTop desc,t.EditDate DESC");

            return(result);
        }
        /// <summary>
        /// 分页查询Address信息
        /// </summary>
        public static QueryResult <Address> QueryAddressList(AddressFilter filter)
        {
            DataCommand cmd = new DataCommand("QueryAddressList");

            cmd.QuerySetCondition("CompanySysNo", ConditionOperation.Equal, DbType.Int32, filter.CompanySysNo);
            if (filter.ParentSysNo.HasValue && filter.ParentSysNo.Value > 0)
            {
                cmd.QuerySetCondition("ParentSysNo", ConditionOperation.Equal, DbType.Int32, filter.ParentSysNo);
            }
            else
            {
                cmd.QuerySetCondition("Grade", ConditionOperation.LessThanEqual, DbType.Int32, (int)filter.AddressGrade.Value);
            }

            if (filter.SelectRoot.HasValue && filter.SelectRoot.Value)
            {
                cmd.QuerySetCondition("AND ParentSysNo IS NULL");
            }

            QueryResult <Address> result = cmd.Query <Address>(filter, "Code ASC");

            return(result);
        }