public JsonResult List(FollowPlanQuery queryModel, string auditStatuses, int page, int rows) { queryModel.PageSize = rows; queryModel.PageNumber = page; queryModel.shopId = base.CurrentSellerManager.ShopId; QueryPageModel <FollowPlan> follows = FollowManagerApplication.GetFollowPan(queryModel); DataGridModel <FollowPlan> data = new DataGridModel <FollowPlan> { total = follows.Total, rows = follows.Models.ToList() }; return(base.Json(data)); }
/// <summary> /// 获取随访计划 /// </summary> /// <param name="search"></param> /// <returns></returns> public QueryPageModel <FollowPlan> GetFollowPan(FollowPlanQuery search) { StringBuilder sqlQuery = new StringBuilder(); sqlQuery.Append("SELECT HFP_ID,HFP_Date,HFP_LastUser,HFP_Result, a.HTP_ID,HFP_Name,HFP_CreateTime,HFP_UserId,HFP_Remind,HFP_Content,HFP_DoctorId,HFP_PatientId,HFP_State,c.Name,d.RealName doctorName,e.RealName patientName," + "(CASE HFP_State WHEN 0 THEN '待随访' when 1 then '已随访' ELSE '已取消' END) State,( CASE HFP_Remind WHEN 0 THEN '患者' when 1 then '医生' ELSE '全部' END) RemindType FROM HPYL_FollowPlan a" + " left join HPYL_FollowTemPlate b on a.HTP_ID = b.HTP_ID " + " left JOIN himall_shopcategories c ON b.HFT_ID = c.Id " + " LEFT JOIN himall_members d ON d.Id = a.HFP_DoctorId" + " LEFT JOIN himall_members e ON e.Id = a.HFP_PatientId" + " WHERE ShopId =" + search.shopId + ""); if (!string.IsNullOrEmpty(search.startDate)) { sqlQuery.Append(" and HFP_Date>='" + search.startDate + "'"); } if (!string.IsNullOrEmpty(search.endDate)) { sqlQuery.Append(" and HFP_Date<='" + DateTime.Parse(search.endDate).AddDays(1) + "'"); } if (search.typtState == "0" || search.typtState == "1") { sqlQuery.Append(" and HFP_Remind=" + search.typtState + ""); } if (!string.IsNullOrEmpty(search.auditStatus.ToString())) { sqlQuery.Append(" and HFP_State=" + search.auditStatus + ""); } var total = new Repository <FollowPlan>().FindList(sqlQuery.ToString()); Pagination pagination = new Pagination(); pagination.page = search.PageNumber; pagination.rows = search.PageSize; pagination.sidx = "HFP_CreateTime"; pagination.sord = "desc"; var result = new Repository <FollowPlan>().FindList(sqlQuery.ToString(), pagination).ToList(); QueryPageModel <FollowPlan> pageModel = new QueryPageModel <FollowPlan>() { Total = (total == null ? 0 : total.Count()), Models = result }; return(pageModel); }
public static QueryPageModel <FollowPlan> GetFollowPan(FollowPlanQuery queryModel) { return(_followwService.GetFollowPan(queryModel)); }