按照部门查询事项列表
/// <summary>
/// 部门列表事项
/// </summary>
/// <param name="currentPage"></param>
/// <param name="DeptID"></param>
/// <param name="_Attrdict"></param>
/// <returns></returns>
public DataSet GetXZSPDeptPage(int currentPage, int topNumber, string DeptID, string sxType)
{
//sxType xz行政职权(除了便民服务,其他都是) bmfw 便民服务
string sqlStr = "";
if (sxType != "" && sxType == "bmfw")
{
sqlStr += " and sab.adid = (select adid from SA_Affair_Attrdict where adcode = 'xslxdm') and sbv.abavvalue = 'fw' ";
}
if (sxType != "" && sxType == "xz")
{
sqlStr += " and sab.adid = (select adid from SA_Affair_Attrdict where adcode = 'xslxdm') and sbv.abavvalue <> 'fw' ";
}
string sqlCommandString = string.Format(@"select * from (select top 100 percent row_number() over(order by ad.aBookdate desc) as number, ad.aid as aid,ad.aname as aname,cd.ID as deptID,cd.DeptName as DeptName,ad.aBookdate,'' as sxType, '' as flabavvalue , '' as ljabavvalue , '' as bslj from sa_affair_baseinfo ab inner join sa_affair_defind ad on ad.aid=ab.aid inner join Core_DeptInfo cd on ad.aBookUnit=cd.ID where ab.abApplayKind='201204' AND ad.aFL IS NOT NULL AND ad.fwDel = 7 and cd.deptid='{0}' and ab.abStatus=0 and ab.abid in(select sab.abid from Sa_Affair_BindAttr sab ,Sa_Affair_BindAttrValue sbv where sab.abaid = sbv.abaid " + sqlStr + ") order by ad.aBookdate desc ) as t where number between {1} and {2} ", DeptID, (currentPage - 1) * topNumber + 1, currentPage * topNumber);
ISQLCommandExecutive _sqlCommandExecutive = DataBaseFactory.Instance.GetSQLExecutiveInstance(sqlCommandString.ToString(), SQLCommandType.SELECT);
// _sqlCommandExecutive.AddParameter("@DeptID", DeptID);
return (DataSet)_sqlCommandExecutive.ExecuteXZSP();
}