You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

58 lines
1.9 KiB

  1. using Dapper;
  2. using Learun.DataBase.Repository;
  3. using Learun.Util;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Data;
  7. using System.Text;
  8. namespace Learun.Application.TwoDevelopment.EducationalAdministration
  9. {
  10. /// <summary>
  11. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  12. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  13. /// 创 建:超级管理员
  14. /// 日 期:2019-11-25 14:27
  15. /// 描 述:请假统计
  16. /// </summary>
  17. public class LeaveSchoolService : RepositoryFactory
  18. {
  19. #region 获取数据
  20. /// <summary>
  21. /// 获取报表数据
  22. /// <summary>
  23. /// <param name="queryJson">查询参数</param>
  24. /// <returns></returns>
  25. public DataTable GetList(string queryJson)
  26. {
  27. try
  28. {
  29. var strSql = new StringBuilder();
  30. strSql.Append("SELECT ");
  31. strSql.Append(@" t.f_itemname, t.pcum ");
  32. strSql.Append(@" FROM (select F_ItemName,count(id) as pcum from LeaveSchool aa left join (select a.F_ItemName,a.F_ItemValue from LR_Base_DataItemDetail a left join LR_Base_DataItem b on a.F_ItemId=b.F_ItemId where b.F_ItemCode='LeaveType' ) bb on F_leixing=F_ItemValue group by F_ItemName)t ");
  33. strSql.Append(" WHERE 1=1 ");
  34. var queryParam = queryJson.ToJObject();
  35. // 虚拟参数
  36. var dp = new DynamicParameters(new { });
  37. return this.BaseRepository().FindTable(strSql.ToString(),dp);
  38. }
  39. catch (Exception ex)
  40. {
  41. if (ex is ExceptionEx)
  42. {
  43. throw;
  44. }
  45. else
  46. {
  47. throw ExceptionEx.ThrowServiceException(ex);
  48. }
  49. }
  50. }
  51. }
  52. }
  53. #endregion