Esempio n. 1
0
        public static List <ReportChartVO> ActivityStatisticsChart(QF_Report filter)
        {
            var    cmd       = new DataCommand("Report.ActivityStatisticsChart");
            string formatKey = GetFormatKey(filter.DateTimeType.Value);

            cmd.SetParameter("@FormatDate", DbType.String, formatKey);
            cmd.QuerySetCondition("tud.create_time", ConditionOperation.MoreThanEqual, DbType.DateTime, filter.StartTime);
            cmd.QuerySetCondition("tud.create_time", ConditionOperation.LessThan, DbType.DateTime, handleEndTime(filter.EndTime));
            if (filter.DepartmentId.HasValue)
            {
                cmd.ReplaceAndSetSQLTag("TagFilterDepartment");
                cmd.QuerySetCondition("tud2.department_id", ConditionOperation.Equal, DbType.Int32, filter.DepartmentId);
            }
            else
            {
                cmd.ReplaceSQLTag("TagFilterDepartment", string.Empty);
            }

            if (filter.DateTimeType.Value == DateTimeTypeEnum.Week)
            {
                cmd.CommandText = cmd.CommandText.Replace("#filterDistinct#", string.Empty);
            }
            else
            {
                cmd.CommandText = cmd.CommandText.Replace("#filterDistinct#", "distinct ");
            }
            cmd.CommandText = cmd.CommandText.Replace("#STRWHERE#", cmd.QueryConditionString);
            return(cmd.ExecuteEntityList <ReportChartVO>());
        }
Esempio n. 2
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"));
        }
Esempio n. 3
0
 /// <summary>
 /// 设置条件
 /// </summary>
 /// <param name="command"></param>
 /// <param name="filter"></param>
 private static void SetCondition(DataCommand command, ExamTestFilter filter)
 {
     //测验类型
     if (filter.mode.HasValue)
     {
         command.QuerySetCondition("t.mode", ConditionOperation.Equal, DbType.Int32, filter.mode.Value);
     }
     //针对文档
     if (!string.IsNullOrEmpty(filter.document_name))
     {
         command.QuerySetCondition("d.name", ConditionOperation.Like, DbType.String, filter.document_name);
     }
     //针对模拟考试
     if (filter.examid.HasValue)
     {
         command.QuerySetCondition("t.exam_id", ConditionOperation.Equal, DbType.Int32, filter.examid.Value);
     }
     //开始日期
     if (filter.StartTime.HasValue)
     {
         command.QuerySetCondition("t.begin_time", ConditionOperation.MoreThanEqual, DbType.DateTime, filter.StartTime);
     }
     //结束日期
     if (filter.EndTime.HasValue)
     {
         command.QuerySetCondition("t.begin_time", ConditionOperation.LessThan, DbType.DateTime, filter.EndTime.Value.AddDays(1));
     }
     command.ReplaceAndSetSQLTag("TagOrder" + filter.sortColumn, filter.sortColumn);
     command.CommandText = command.CommandText.Replace("#STRWHERE#", command.QueryConditionString);
 }
        public static List <Category> GetCategoryListBySysNos(List <int> sysnos, string tenantID)
        {
            DataCommand cmd = new DataCommand("GetCategoryListBySysNos");

            cmd.QuerySetCondition("SysNo", ConditionOperation.In, DbType.Int32, sysnos);
            cmd.QuerySetCondition("TenantID", ConditionOperation.Equal, DbType.String, tenantID);
            return(cmd.ExecuteEntityList <Category>("#DynamicParameters#"));
        }
Esempio n. 5
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));
        }
Esempio n. 6
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);
        }
Esempio n. 7
0
        public static List <ReportChartVO> SubjectStatisticsChart(QF_Report filter)
        {
            var cmd = new DataCommand("Report.SubjectStatisticsChart");

            cmd.QuerySetCondition("ts.create_time", ConditionOperation.MoreThanEqual, DbType.DateTime, filter.StartTime);
            cmd.QuerySetCondition("ts.create_time", ConditionOperation.LessThan, DbType.DateTime, 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.ExecuteEntityList <ReportChartVO>());
        }
        /// <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);
        }
Esempio n. 9
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);
        }
Esempio n. 10
0
        /// <summary>
        /// 设置条件
        /// </summary>
        /// <param name="command"></param>
        /// <param name="filter"></param>
        private static void SetCondition(DataCommand command, TestStatisticsFilter filter)
        {
            //测验类型
            if (filter.mode.HasValue)
            {
                command.QuerySetCondition("t.mode", ConditionOperation.Equal, DbType.Int32, filter.mode.Value);
            }
            //统计模式
            if (filter.statisticsMode == 1)//1:个人了联系
            {
                //个人练习
                command.ReplaceAndSetSQLTag("TagFilterdocument_id", "");
                //针对文档  个人练习才有文档
                if (!string.IsNullOrEmpty(filter.document_name))
                {
                    command.QuerySetCondition("d.name", ConditionOperation.Like, DbType.String, filter.document_name);
                }
            }
            else
            {
                //模拟考试
                command.ReplaceAndSetSQLTag("TagFilterexam_id", "");
            }
            if (filter.statisticsObj == 1)
            {
                //单位
                command.ReplaceAndSetSQLTag("TagGroupDpName", "");
                command.ReplaceAndSetSQLTag("TagColumnDpName", "");
            }
            else
            {
                //个人
                command.ReplaceAndSetSQLTag("TagGroupUName", "");
                command.ReplaceAndSetSQLTag("TagColumnUName", "");
            }

            //针对模拟考试
            if (filter.examid.HasValue)
            {
                command.QuerySetCondition("t.exam_id", ConditionOperation.Equal, DbType.Int32, filter.examid.Value);
            }
            //开始日期
            if (filter.StartTime.HasValue)
            {
                command.QuerySetCondition("t.begin_time", ConditionOperation.MoreThanEqual, DbType.DateTime, filter.StartTime);
            }
            //结束日期
            if (filter.EndTime.HasValue)
            {
                command.QuerySetCondition("t.begin_time", ConditionOperation.LessThan, DbType.DateTime, filter.EndTime.Value.AddDays(1));
            }
            command.ReplaceAndSetSQLTag("TagOrder" + filter.sortColumn, filter.sortColumn);
            command.CommandText = command.CommandText.Replace("#STRWHERE#", command.QueryConditionString);
        }
Esempio n. 11
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);
        }
Esempio n. 12
0
        public static List <ReportChartVO> ComplaintStatisticsChart(QF_Report filter)
        {
            var    cmd       = new DataCommand("Report.ComplaintStatisticsChart");
            string formatKey = GetFormatKey(filter.DateTimeType.Value);

            cmd.SetParameter("@FormatDate", DbType.String, formatKey);
            cmd.QuerySetCondition("create_time", ConditionOperation.MoreThanEqual, DbType.DateTime, filter.StartTime);
            cmd.QuerySetCondition("create_time", ConditionOperation.LessThan, DbType.DateTime, handleEndTime(filter.EndTime));
            cmd.QuerySetCondition("department_id", ConditionOperation.Equal, DbType.Int32, filter.DepartmentId);
            cmd.QuerySetCondition("is_delete", ConditionOperation.Equal, DbType.Int32, DeletedEnums.Actived);
            cmd.CommandText = cmd.CommandText.Replace("#STRWHERE#", cmd.QueryConditionString);
            return(cmd.ExecuteEntityList <ReportChartVO>());
        }
Esempio n. 13
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);
        }
Esempio n. 14
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));
        }
Esempio n. 15
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);
        }
        /// <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);
        }
Esempio n. 17
0
        /// <summary>
        /// 设置条件
        /// </summary>
        /// <param name="command"></param>
        /// <param name="filter"></param>
        private static void SetCondition(DataCommand command, BulletinFilter filter)
        {
            command.QuerySetCondition("t.is_delete", ConditionOperation.Equal, DbType.Int32, 0);
            //测验类型
            if (filter.CreateTimeStart.HasValue)
            {
                command.QuerySetCondition("t.create_time", ConditionOperation.MoreThanEqual, DbType.DateTime, filter.CreateTimeStart.Value);
            }
            if (filter.CreateTimeEnd.HasValue)
            {
                command.QuerySetCondition("t.create_time", ConditionOperation.LessThan, DbType.DateTime, filter.CreateTimeEnd.Value.AddDays(1));
            }

            command.CommandText = command.CommandText.Replace("#STRWHERE#", command.QueryConditionString);
        }
Esempio n. 18
0
        /// <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);
        }
Esempio n. 19
0
        /// <summary>
        /// 根据目录ID获取数据列表
        /// </summary>
        /// <returns>目录数据列表</returns>
        public static int ValidUserTagAndName(DocumentEntity documentEntity)
        {
            var cmd = new DataCommand("Document.ValidUserTagAndName");

            cmd.QuerySetCondition("user_tag", ConditionOperation.Equal, DbType.Int32, documentEntity.Usertag.Value);
            cmd.QuerySetCondition("name", ConditionOperation.Equal, DbType.String, documentEntity.Name);

            if (documentEntity.Id.HasValue && documentEntity.Id > 0)
            {
                cmd.QuerySetCondition("id", ConditionOperation.NotEqual, DbType.Int32, documentEntity.Id.Value);
            }
            var result = cmd.ExecuteEntity <DocumentEntity>("#STRWHERE#");

            return(result.Id.Value);
        }
Esempio n. 20
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);
        }
Esempio n. 21
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));
        }
Esempio n. 22
0
 /// <summary>
 /// 设置条件
 /// </summary>
 /// <param name="command"></param>
 /// <param name="filter"></param>
 private static void SetCondition(DataCommand command, User_Plan_RankFilter filter)
 {
     if (filter.plan_id.HasValue)
     {
         command.QuerySetCondition("tupr.plan_id", ConditionOperation.Equal, DbType.Int32, filter.plan_id.Value);
     }
     command.CommandText = command.CommandText.Replace("#STRWHERE#", command.QueryConditionString);
 }
Esempio n. 23
0
        /// <summary>
        /// 根据角色ID删除关联关系
        /// </summary>
        /// <param name="role">数据实体</param>
        public static void DeleteByRoleId(RoleUserEntity role)
        {
            var cmd = new DataCommand("RoleUser.Delete");

            cmd.QuerySetCondition("role_id", ConditionOperation.Equal, DbType.Int32, role.RoleId);
            cmd.CommandText = cmd.CommandText.Replace("#STRWHERE#", cmd.QueryConditionString);
            cmd.ExecuteNonQuery();
        }
Esempio n. 24
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));
        }
Esempio n. 25
0
 private static void SetCondition(DataCommand command, QF_Subject filter, string type)
 {
     if (!string.IsNullOrEmpty(filter.Keyword))
     {
         command.ReplaceAndSetSQLTag("TagFilterKeyword", filter.Keyword);
         command.ReplaceSQLTag("TagFilterKeyword", string.Empty);
     }
     else
     {
         command.ReplaceSQLTag("TagFilterKeyword", string.Empty);
     }
     command.QuerySetCondition("ts.create_time", ConditionOperation.MoreThanEqual, DbType.DateTime, filter.StartTime);
     if (filter.EndTime.HasValue)
     {
         command.QuerySetCondition("ts.create_time", ConditionOperation.LessThan, DbType.DateTime, filter.EndTime.Value.AddDays(1));
     }
     command.QuerySetCondition("tc.id", ConditionOperation.Equal, DbType.Int32, filter.CatId);
     command.QuerySetCondition("ts.department_id", ConditionOperation.Equal, DbType.Int32, filter.DepartmentId);
     command.QuerySetCondition("ts.is_delete", ConditionOperation.Equal, DbType.Int32, DeletedEnums.Actived);
     if (type == "Search")
     {
         command.QuerySetCondition("d.name", ConditionOperation.Like, DbType.String, filter.VendorName);
     }
     else
     {
         command.QuerySetCondition("vn.name", ConditionOperation.Like, DbType.String, filter.VendorName);
     }
     command.CommandText = command.CommandText.Replace("#STRWHERE#", command.QueryConditionString);
 }
Esempio n. 26
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);
        }
Esempio n. 27
0
        /// <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);
        }
Esempio n. 28
0
 /// <summary>
 /// 设置条件
 /// </summary>
 /// <param name="command"></param>
 /// <param name="filter"></param>
 private static void SetCondition(DataCommand command, VoteFilter filter)
 {
     //测验类型
     if (filter.voteid.HasValue)
     {
         command.QuerySetCondition("tvi.vote_id", ConditionOperation.Equal, DbType.Int32, filter.voteid.Value);
     }
     command.CommandText = command.CommandText.Replace("#STRWHERE#", command.QueryConditionString);
 }
Esempio n. 29
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);
        }
Esempio n. 30
0
 /// <summary>
 /// 设置条件
 /// </summary>
 /// <param name="command"></param>
 /// <param name="filter"></param>
 private static void SetCondition(DataCommand command, QusetionFilter filter)
 {
     if (filter.mode.HasValue)
     {
         command.QuerySetCondition("q.mode", ConditionOperation.Equal, DbType.Int32, filter.mode.Value);
     }
     if (!string.IsNullOrEmpty(filter.document_name))
     {
         command.QuerySetCondition("d.name", ConditionOperation.Like, DbType.String, filter.document_name);
     }
     if (!string.IsNullOrEmpty(filter.content))
     {
         command.QuerySetCondition("q.content", ConditionOperation.Like, DbType.String, filter.content);
     }
     if (filter.usertag.HasValue)
     {
         command.QuerySetCondition("q.user_tag", ConditionOperation.Equal, DbType.Int32, filter.usertag);
     }
     command.CommandText = command.CommandText.Replace("#STRWHERE#", command.QueryConditionString);
 }