Esempio n. 1
0
        /// <summary>
        /// </summary>
        /// <param name="searchinfo"></param>
        /// <returns></returns>
        public static string GetbaselistWhere(SJYEntity.Common.Search sh)
        {
            string wherestr = "";

            wherestr += " 1=1  and ";

            if (sh.Protype != "")
            {
                wherestr += "type='" + sh.Protype + "' and ISNULL(storetype,'')!='SINOPEC'   and ";
            }
            if (sh.Basename != "")
            {
                wherestr += "Basename like '%" + sh.Basename + "%'  and ";
            }
            if (sh.Basecode != "")
            {
                wherestr += "Basecode like '%" + sh.Basecode + "%'  and ";
            }
            if (sh.Sqlstr != "")
            {
                wherestr += " " + sh.Sqlstr + "  and ";
            }

            if (wherestr != "")
            {
                wherestr = wherestr.Substring(0, wherestr.Length - 4);
            }

            return(wherestr);
        }
Esempio n. 2
0
        /// <summary>
        /// 列表(分数据库)有权限判断
        /// </summary>
        /// <param name="username"></param>
        /// <returns></returns>
        public DataSet QXGetprodList(SJYEntity.Common.Search sh)
        {
            string sqldt = ProductBLL.Search.Searcher.QXGetbaselistsql(sh);

            //列表信息
            DataSet dtlist = new DataSet();

            dtlist = productcommon.DataMgr.GetDataSet(sqldt);

            return(dtlist);
        }
Esempio n. 3
0
        /// <summary>
        /// </summary>
        /// <param name="searchinfo"></param>
        /// <returns></returns>

        #endregion



        #region 基础数据
        /// <summary>
        /// 根据搜索实体类,拼接分页语句,包含条件语句
        /// </summary>
        /// <param name="curpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="sinfo"></param>
        /// <returns></returns>
        public static string Getbaselistsql(SJYEntity.Common.Search sh)
        {
            string whereStr = GetbaselistWhere(sh);
            string orderby  = "order by id desc ";

            if (sh.Orderby != "")
            {
                orderby = "order by " + sh.Orderby;
            }

            string sqldt;
            int    tempstar = (sh.PageIndex - 1) * sh.PageSize;
            int    tempend  = sh.PageIndex * sh.PageSize + 1;

            sqldt  = "select count(*) from " + sh.Tablename + " where" + whereStr;
            sqldt += "; select top " + sh.PageSize + "  * from (select  * ,row_number() over(" + orderby + ") as rn from " + sh.Tablename + " where " + whereStr + " )as aa where (rn > " + tempstar + " and rn< " + tempend + ")";

            return(sqldt);
        }