public ActionResult LoadDetailStatistics(int? page, int? rows, string sort, string order, string workerId, string starTime, string endTime, string queryWord) { YnBaseDal.YnPage ynPage = new YnBaseDal.YnPage(); ynPage.SetPageSize(rows.HasValue ? rows.Value : YnBaseDal.YnPage.DEFAULT_PAGE_SIZE); //pageRows; ynPage.SetCurrentPage(page.HasValue ? page.Value : 1); //pageNumber; List<AscmGetMaterialTask> list = null; JsonDataGridResult jsonDataGridResult = new JsonDataGridResult(); try { string sql = "from AscmGetMaterialTask"; string where = "", whereQueryWord = ""; whereQueryWord = "status = 'FINISH'"; where = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(where,whereQueryWord); if (!string.IsNullOrEmpty(workerId)) { whereQueryWord = "workerId = '" + workerId + "'"; where = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(where, whereQueryWord); } if (!string.IsNullOrEmpty(starTime) && starTime != "null") { string sTime = starTime + " 23:59"; whereQueryWord = "starTime > '" + sTime + "'"; where = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(where, whereQueryWord); } else { string sTime = DateTime.Now.Date.AddDays(-1).ToString("yyyy-MM-dd") + " 23:59"; whereQueryWord = "starTime > '" + sTime + "'"; where = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(where, whereQueryWord); } if (!string.IsNullOrEmpty(endTime) && endTime != "null") { string eTime = endTime + " 23:59"; whereQueryWord = "endTime <= '" + eTime + "'"; where = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(where, whereQueryWord); } else { string eTime = DateTime.Now.Date.ToString("yyyy-MM-dd") + " 23:59"; whereQueryWord = "endTime < '" + eTime + "'"; where = YnBaseClass2.Helper.StringHelper.SqlWhereAndAdd(where, whereQueryWord); } if (!string.IsNullOrEmpty(where)) sql += " where " + where + " order by createTime"; IList<AscmGetMaterialTask> ilist = YnDaoHelper.GetInstance().nHibernateHelper.Find<AscmGetMaterialTask>(sql,sql,ynPage); if (ilist.Count > 0 && ilist != null) { list = YnBaseClass2.Helper.ConvertHelper.ConvertIListToList<AscmGetMaterialTask>(ilist); setUsedTime(list); AscmGetMaterialTaskService.GetInstance().SetRanker(list); foreach (AscmGetMaterialTask ascmGetMaterialTask in list) { jsonDataGridResult.rows.Add(ascmGetMaterialTask); } } jsonDataGridResult.result = true; jsonDataGridResult.total = ynPage.GetCurrentPage(); } catch (Exception ex) { YnBaseClass2.Helper.LogHelper.GetLog().Error(ex.Message, ex); throw ex; } return Json(jsonDataGridResult, JsonRequestBehavior.AllowGet); }