Ejemplo n.º 1
0
        /// <summary>
        /// 获取期刊浏览次数
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public Pager<IssueViewLogEntity> GetIssueViewLogPageList(IssueViewLogQuery query)
        {
            //            string tableSql = @"SELECT a.JournalID,a.ContentID,c.CNumber,b.Title,c.AuthorID,d.RealName,d.LoginName,d.Mobile,a.DownLoadCount FROM (
            //                                  SELECT ContentID,JournalID,COUNT(1) as DownLoadCount
            //                                  FROM dbo.IssueDownLog with(nolock)
            //                                  WHERE JournalID={0} GROUP BY ContentID,JournalID
            //                              ) a INNER JOIN dbo.IssueContent b with(nolock) ON a.JournalID=b.JournalID and a.ContentID=b.ContentID
            //                              INNER JOIN dbo.ContributionInfo c with(nolock) ON a.JournalID=b.JournalID and b.CID=c.CID
            //                              INNER JOIN dbo.AuthorInfo d with(nolock) ON a.JournalID=d.JournalID and c.AuthorID=d.AuthorID";
            string tableSql = "select Title,A.Year,A.ViewCount,A.ContentID,A.[Month],Authors,B.JournalID from   dbo.IssueContent as B right join (select ContentID,COUNT(ContentID) as ViewCount,Year,Month from dbo.IssueViewLog group by ContentID,Year,Month) as A  on A.ContentID=B.ContentID where JournalID={0}";
            tableSql = string.Format(tableSql, query.JournalID);
            query.Title = SecurityUtils.SafeSqlString(query.Title);
            if (!string.IsNullOrWhiteSpace(query.Title))
                // tableSql += string.Format(" and b.Title like '%{0}%'", query.Title);
                tableSql += string.Format(" and  Title like '%{0}%'", query.Title);
            query.RealName = SecurityUtils.SafeSqlString(query.RealName);
            if (!string.IsNullOrWhiteSpace(query.RealName))
                tableSql += string.Format(" and Authors like '%{0}%'", query.RealName);
            if (query.Year!=0)
                tableSql += string.Format(" and Year='{0}'", query.Year);

            if (query.Month != 0)
                tableSql += string.Format(" and Month='{0}'", query.Month);

            //tableSql += string.Format(" and d.RealName like '%{0}%'", query.RealName);
            string strSql = string.Format(SQL_Page_Select_ROWNumber, tableSql, query.StartIndex, query.EndIndex, " ViewCount desc "), sumStr = string.Empty;
            if (!query.IsReport)
                sumStr = string.Format("SELECT RecordCount=COUNT(1) FROM ({0}) t", tableSql);
            return db.GetPageList<IssueViewLogEntity>(strSql
                , sumStr
                , query.CurrentPage, query.PageSize
                , (dr, pager) =>
                {
                    pager.TotalRecords = TypeParse.ToLong(dr["RecordCount"]);
                }
                , (dr) =>
                {
                    List<IssueViewLogEntity> list = new List<IssueViewLogEntity>();
                    IssueViewLogEntity model = null;
                    while (dr.Read())
                    {
                        model = new IssueViewLogEntity();
                        model.JournalID = dr.GetDrValue<Int64>("JournalID");
                        model.ContentID = dr.GetDrValue<Int64>("ContentID");
                        model.Title = dr.GetDrValue<String>("Title");
                        model.RealName = dr.GetDrValue<String>("Authors");
                        model.ViewCount = TypeParse.ToLong(dr["ViewCount"]);
                        list.Add(model);
                    }
                    dr.Close();
                    return list;
                });
        }
Ejemplo n.º 2
0
 public Pager<IssueViewLogEntity> GetIssueViewLogPageList(IssueViewLogQuery query)
 {
     IIssueService service = ServiceContainer.Instance.Container.Resolve<IIssueService>();
     return service.GetIssueViewLogPageList(query);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 获取期刊浏览次数
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public Pager<IssueViewLogEntity> GetIssueViewLogPageList(IssueViewLogQuery query)
 {
     return IssueDataAccess.Instance.GetIssueViewLogPageList(query);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 获取期刊浏览明细
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public Pager<IssueViewLogEntity> GetIssueViewLogDetailPageList(IssueViewLogQuery query)
        {
            string tableSql = @"SELECT a.JournalID,a.ContentID,a.ViewLogID,a.Year,a.Month,a.Daytime,b.Title,a.AuthorID,(case when d.RealName is null then '游客' else d.RealName end) as RealName,(case when d.LoginName is null then '无' else d.LoginName end) as LoginName,(case when d.Mobile is null then '无' else d.Mobile end) as Mobile,a.IP,a.AddDate
                              FROM dbo.IssueViewLog a with(nolock)
                              INNER JOIN dbo.IssueContent b with(nolock) ON a.JournalID=b.JournalID and a.ContentID=b.ContentID
                              LEFT JOIN dbo.AuthorInfo d with(nolock) ON a.JournalID=d.JournalID and a.AuthorID=d.AuthorID
                              WHERE a.JournalID=" + query.JournalID;
            if (query.ContentID != null)
                tableSql += " and a.ContentID=" + query.ContentID.Value;
            query.Title = SecurityUtils.SafeSqlString(query.Title);
            if (!string.IsNullOrWhiteSpace(query.Title))
                tableSql += string.Format(" and b.Title like '%{0}%'", query.Title);
            query.RealName = SecurityUtils.SafeSqlString(query.RealName);

            if (query.Year != 0)
                tableSql += string.Format(" and a.Year='{0}'", query.Year);
            if (query.Month != 0)
                tableSql += string.Format(" and a.Month='{0}'", query.Month);

            if (!string.IsNullOrWhiteSpace(query.RealName))
                tableSql += string.Format(" and d.RealName like '%{0}%'", query.RealName);
            string strSql = string.Format(SQL_Page_Select_ROWNumber, tableSql, query.StartIndex, query.EndIndex, " AddDate desc"), sumStr = string.Empty;
            if (!query.IsReport)
                sumStr = string.Format("SELECT RecordCount=COUNT(1) FROM ({0}) t", tableSql);
            return db.GetPageList<IssueViewLogEntity>(strSql
                , sumStr
                , query.CurrentPage, query.PageSize
                , (dr, pager) =>
                {
                    pager.TotalRecords = TypeParse.ToLong(dr["RecordCount"]);
                }
                , (dr) =>
                {
                    List<IssueViewLogEntity> list = new List<IssueViewLogEntity>();
                    IssueViewLogEntity model = null;
                    while (dr.Read())
                    {
                        model = new IssueViewLogEntity();
                        model.ViewLogID = dr.GetDrValue<Int64>("ViewLogID");
                        model.Year = dr.GetDrValue<Int32>("Year");
                        model.Month = dr.GetDrValue<Int32>("Month");
                        model.JournalID = dr.GetDrValue<Int64>("JournalID");
                        model.ContentID = dr.GetDrValue<Int64>("ContentID");
                        model.Title = dr.GetDrValue<String>("Title");
                        model.AuthorID = dr.GetDrValue<Int64>("AuthorID");
                        model.RealName = dr.GetDrValue<String>("RealName");
                        model.LoginName = dr.GetDrValue<String>("LoginName");
                        model.Mobile = dr.GetDrValue<String>("Mobile");
                        model.IP = dr.GetDrValue<String>("IP");
                        model.AddDate = dr.GetDrValue<DateTime>("AddDate");
                        list.Add(model);
                    }
                    dr.Close();
                    return list;
                });
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 获取期刊浏览次数
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public Pager<IssueViewLogEntity> GetIssueViewLogPageList(IssueViewLogQuery query)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     Pager<IssueViewLogEntity> pager = clientHelper.Post<Pager<IssueViewLogEntity>, IssueViewLogQuery>(GetAPIUrl(APIConstant.ISSUEVIEW_GETPAGELIST), query);
     return pager;
 }
Ejemplo n.º 6
0
 public ActionResult GetIssueViewLogPageList(IssueViewLogQuery query)
 {
     IIssueFacadeService service = ServiceContainer.Instance.Container.Resolve<IIssueFacadeService>();
     query.JournalID = CurAuthor.JournalID;
     query.IsReport = false;
     query.CurrentPage = Convert.ToInt32(Request.Params["page"]);
     query.PageSize = Convert.ToInt32(Request.Params["pagesize"]);
     Pager<IssueViewLogEntity> pager = service.GetIssueViewLogPageList(query);
     return Json(new { Rows = pager.ItemList, Total = pager.TotalRecords });
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 将查询实体转换为Where语句
 /// <param name="query">查询实体</param>
 /// <returns>获取Where语句,不包含Where</returns>
 /// </summary>
 public string IssueViewLogQueryToSQLWhere(IssueViewLogQuery query)
 {
     return string.Empty;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 获取所有符合查询条件的数据
 /// </summary>
 /// <param name="issueViewLogQuery">IssueViewLogQuery查询实体对象</param>
 /// <returns>List<IssueViewLogEntity></returns>
 public List<IssueViewLogEntity> GetIssueViewLogList(IssueViewLogQuery issueViewLogQuery)
 {
     return IssueViewLogDataAccess.Instance.GetIssueViewLogList(issueViewLogQuery);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// 将查询实体转换为Order语句
 /// <param name="query">查询实体</param>
 /// <returns>获取Order语句,不包含Order</returns>
 /// </summary>
 public string IssueViewLogQueryToSQLOrder(IssueViewLogQuery query)
 {
     return " ViewLogID DESC";
 }
Ejemplo n.º 10
0
 public Pager<IssueViewLogEntity> GetIssueViewLogPageList(IssueViewLogQuery query)
 {
     int recordCount = 0;
     string whereSQL = IssueViewLogQueryToSQLWhere(query);
     string orderBy = IssueViewLogQueryToSQLOrder(query);
     DataSet ds = db.GetPagingData("IssueViewLog", "ViewLogID,JournalID,ContentID,AuthorID,Daytime,Year,Month,IP,AddDate", orderBy, whereSQL, query.CurrentPage, query.PageSize, out recordCount);
     Pager<IssueViewLogEntity> pager = new Pager<IssueViewLogEntity>();
     if (ds != null && ds.Tables.Count > 0)
     {
         pager.ItemList = MakeIssueViewLogList(ds.Tables[0]);
     }
     pager.CurrentPage = query.CurrentPage;
     pager.PageSize = query.PageSize;
     pager.TotalRecords = recordCount;
     return pager;
 }
Ejemplo n.º 11
0
 public List<IssueViewLogEntity> GetIssueViewLogList(IssueViewLogQuery query)
 {
     List<IssueViewLogEntity> list = new List<IssueViewLogEntity>();
     StringBuilder sqlCommandText = new StringBuilder();
     sqlCommandText.Append("SELECT ViewLogID,JournalID,ContentID,AuthorID,Daytime,Year,Month,IP,AddDate FROM dbo.IssueViewLog WITH(NOLOCK)");
     string whereSQL = IssueViewLogQueryToSQLWhere(query);
     string orderBy = IssueViewLogQueryToSQLOrder(query);
     if (!string.IsNullOrEmpty(whereSQL)) sqlCommandText.Append(" WHERE " + whereSQL);
     if (!string.IsNullOrEmpty(orderBy)) sqlCommandText.Append(" ORDER BY " + orderBy);
     DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString());
     using (IDataReader dr = db.ExecuteReader(cmd))
     {
         list = MakeIssueViewLogList(dr);
     }
     return list;
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 获取期刊下载次数
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public Pager<IssueViewLogEntity> GetIssueViewLogPageList(IssueViewLogQuery query)
 {
     return IssueBusProvider.GetIssueViewLogPageList(query);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// 获取所有符合查询条件的数据
 /// </summary>
 /// <param name="issueViewLogQuery">IssueViewLogQuery查询实体对象</param>
 /// <returns>List<IssueViewLogEntity></returns>
 public List<IssueViewLogEntity> GetIssueViewLogList(IssueViewLogQuery issueViewLogQuery)
 {
     return IssueViewLogBusProvider.GetIssueViewLogList(issueViewLogQuery);
 }