123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using Cksoft.Data;
- using DllEapEntity;
- using DllEapEntity.Dtos;
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace DllEapDal
- {
- public class LHAParametersDal
- {
- private readonly IDatabase db = null;
- public LHAParametersDal(IDatabase db)
- {
- this.db = db;
- }
- public LayuiModel<LHAParametersnew> Get(string fcode, DateTime? value1, DateTime? value2, string recipe, int pageIndex, int pageSize)
- {
- string str = $@" ";
- if (!string.IsNullOrEmpty(fcode))
- {
- str += $" and b.FCode like '%{fcode}'";
- }
- if (!string.IsNullOrEmpty(recipe))
- {
- str += $" and a.Type like '%{recipe}%'";
- }
- str += $" and a.RecTime > '{value1.Value.ToString("yyyy-MM-dd HH:mm:ss")}'";
- str += $" and a.RecTime < '{value2.Value.ToString("yyyy-MM-dd HH:mm:ss")}'";
- str += $" limit {(pageIndex - 1) * pageSize} ,{pageSize}";
- string ERR = String.Empty;
- var datas = db.FindListForCondition<LHAParametersnew>(str, ref ERR);
- foreach (var item in datas)
- {
- item.Type = item.Type.Split('-')[0];
- }
- var str1 = "SELECT Count(1) from ";
- LHAParametersnew aaParametersInfo = new LHAParametersnew();
- str1 += aaParametersInfo.GetQueryTabSql();
- str1 += " where 1=1 " + str;
- var total = Convert.ToInt32(db.FindObject(str1));
- return new LayuiModel<LHAParametersnew>
- {
- code = 1,
- count = total,
- data = datas
- };
- }
- }
- }
|