public EasyUIGridModel GetAttachLst(FileUploadQueryForm form, EasyUIGridSetting gridSetting) { string sql = string.Format(@"SELECT CID,PNODE as SLBH,CNAME,to_char(CREATEDATE,'yy-mm-dd hh24:mi:ss') CREATEDATE FROM (Select ROWNUM AS ROWNO, T.* from (select CID,PNODE,CNAME,CREATEDATE from WFM_ATTACHLST where {0}) T WHERE ROWNUM <= {1}) TABLE_ALIAS WHERE TABLE_ALIAS.ROWNO > {2}", form.GetWhere(), gridSetting.PageIndex * gridSetting.PageSize, (gridSetting.PageIndex - 1) * gridSetting.PageSize); string connectStr = ConfigurationManager.ConnectionStrings["bdcggkConnection"].ToString(); DataSet ds = DBHelper.GetDataSet(connectStr, sql); TBToList <AttachModel> list = new TBToList <AttachModel>(); IList <AttachModel> tags = list.ConvertToModel(ds.Tables[0]); string countSql = string.Format("Select count(1) from WFM_ATTACHLST where {0}", form.GetWhere()); int count = DBHelper.GetScalar(connectStr, countSql); EasyUIGridModel ret = new EasyUIGridModel(gridSetting.PageIndex, count, tags); return(ret); }
public EasyUIGridModel GetWriteBackResult(WriteBackResultQueryForm form, EasyUIGridSetting gridSetting) { string sql = string.Format(@"SELECT SLBH,DJLX,SFTS,PUSHDATA,PUSHDATE,PUSHRESULT,WBERRINFO,CGERRINFO,PID,ADDRESSTYPE FROM (Select ROWNUM AS ROWNO, T.* from (select * from FC_SPFHX_TAG where {0} order by pushdate desc) T WHERE ROWNUM <= {1}) TABLE_ALIAS WHERE TABLE_ALIAS.ROWNO > {2} ", form.GetWhere(), gridSetting.PageIndex * gridSetting.PageSize, (gridSetting.PageIndex - 1) * gridSetting.PageSize, gridSetting.SortBy.PropertyName, gridSetting.SortBy.SortType); if (gridSetting.SortBy.PropertyName != "") { sql += " order by " + gridSetting.SortBy.PropertyName + " " + gridSetting.SortBy.SortType; } DataSet ds = DBHelper.GetDataSet(sql); TBToList <SPFHX_TAG> list = new TBToList <SPFHX_TAG>(); IList <SPFHX_TAG> tags = list.ConvertToModel(ds.Tables[0]); string countSql = string.Format("Select count(1) from FC_SPFHX_TAG where {0}", form.GetWhere()); int count = DBHelper.GetScalar(countSql); EasyUIGridModel ret = new EasyUIGridModel(gridSetting.PageIndex, count, tags); return(ret); }