Пример #1
0
        public static PetaPoco.Page<PetapocoOrm.MonitorLog.FileWatch> GetList(int pageSize, int pageIndex, int serverId, string filename)
        {
            PetaPoco.Sql sb = new Sql();
            sb.Append("select *  from FileWatch where 1=1");

            if (serverId >= 1)
            {
                sb.Append("  and    ServerName in  ( select ServerName  from ServerList  where  id=" + serverId + ")   ", serverId);
            }

            if (!string.IsNullOrEmpty(filename))
            {
                sb.Append(" and filename like  '%" + WXQ.Common.StringPlus.SQLSafe(filename) + "%'");
            }

            sb.Append("  order by  filename asc , adddate desc  ");

            PetaPoco.Page<PetapocoOrm.MonitorLog.FileWatch> result = PetapocoOrm.MonitorLog.Db.GetInstance().Page<PetapocoOrm.MonitorLog.FileWatch>(pageIndex, pageSize, sb.ToString());

            return result;
        }