RecordDataHistoryDal.cs 860 B

1234567891011121314151617181920212223242526
  1. using Cksoft.Data;
  2. using DllEapEntity;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. namespace DllEapDal.OFILM
  8. {
  9. public class RecordDataHistoryDal
  10. {
  11. private IDatabase CurrDb;
  12. public RecordDataHistoryDal(IDatabase db)
  13. {
  14. CurrDb = db;
  15. }
  16. public IEnumerable<RecordDataHistory> Get(int start, int length, string order, string sort, string filter, string errorinfo, out int total)
  17. {
  18. var sql = $"select count(1) from RecordDataHistory a where 1=1 {filter}";
  19. total = Convert.ToInt32(CurrDb.FindList<string>(sql).FirstOrDefault() ?? "0");
  20. var pros = CurrDb.FindListForCondition<RecordDataHistory>($" {filter} order by {sort} {order} limit {start - 1},{length}", ref errorinfo);
  21. return pros;
  22. }
  23. }
  24. }