select nc.Class_Name,hn.home_news_id,hn.hemo_id,hn.hemo_Date,
hn.hemo_title,hemo_order from Hemo_News as hn
inner join NewsClass as nc on hn.home_news_id = nc.home_news_id
where hn.home_news_id='' order by
case when hemo_order = 0 then 0 el
se 1 end desc,hemo_order asc
// <summary>
/// 获得数据列表
/// </summary>
public DataSet GetList(string strWhere)
{
string strSql = "select nc.Class_Name,hn.home_news_id,hn.hemo_id,hn.hemo_Date,hn.hemo_title,hemo_order from Hemo_News as";
strSql = strSql + " hn inner join NewsClass as nc on hn.home_news_id = nc.home_news_id";
if(strWhere.Trim()!="")
{
strSql = strSql + " where " + strWhere +"order by case when hemo_order = 0 then 0 else 1 end desc,hemo_order asc";
}
return DbHelperSQL.Query(strSql.ToString());
} 收藏于 --