/// <summary> /// 获得数据列表 /// </summary> public DataSet GetList(string strWhere) { StringBuilder strSql = new StringBuilder(); strSql.Append("select COMPANY,CREATOR,USR_GROUP,CREATE_DATE,MODIFIER,MODI_DATE,FLAG,MC001,MC002,MC003,MC004,MC005,MC006,MC007,MC008,MC009,MC010,MC011,MC012,MC013,MC014,MC015,MC016,MC017,MC018,MC019,MC020,MC021,MC022,MC023,MC024,UDF01,UDF02,UDF03,UDF04,UDF05,UDF06,UDF51,UDF52,UDF53,UDF54,UDF55,UDF56,UDF07,UDF08,UDF09,UDF10,UDF11,UDF12,UDF57,UDF58,UDF59,UDF60,UDF61,UDF62 "); strSql.Append(" FROM CMSMC "); if (strWhere.Trim() != "") { strSql.Append(" where " + strWhere); } return(VOCEN2018DbHelperSQL.Query(strSql.ToString())); }
/// <summary> /// 获得前几行数据 /// </summary> public DataSet GetList(int Top, string strWhere, string filedOrder) { StringBuilder strSql = new StringBuilder(); strSql.Append("select "); if (Top > 0) { strSql.Append(" top " + Top.ToString()); } strSql.Append(" COMPANY,CREATOR,USR_GROUP,CREATE_DATE,MODIFIER,MODI_DATE,FLAG,ME001,ME002,ME003,ME004,ME005,ME006,ME007,ME008,ME009,ME010,ME011,ME012,ME013,ME014,ME015,UDF01,UDF02,UDF03,UDF04,UDF05,UDF06,UDF51,UDF52,UDF53,UDF54,UDF55,UDF56,UDF07,UDF08,UDF09,UDF10,UDF11,UDF12,UDF57,UDF58,UDF59,UDF60,UDF61,UDF62 "); strSql.Append(" FROM CMSME "); if (strWhere.Trim() != "") { strSql.Append(" where " + strWhere); } strSql.Append(" order by " + filedOrder); return(VOCEN2018DbHelperSQL.Query(strSql.ToString())); }
/// <summary> /// 分页获取数据列表 /// </summary> public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex) { StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT * FROM ( "); strSql.Append(" SELECT ROW_NUMBER() OVER ("); if (!string.IsNullOrEmpty(orderby.Trim())) { strSql.Append("order by T." + orderby); } else { strSql.Append("order by T.MC001 desc"); } strSql.Append(")AS Row, T.* from CMSMC T "); if (!string.IsNullOrEmpty(strWhere.Trim())) { strSql.Append(" WHERE " + strWhere); } strSql.Append(" ) TT"); strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex); return(VOCEN2018DbHelperSQL.Query(strSql.ToString())); }