wzp
2021-07-19 e65183d31755a0e5fae4bf428435d2e0fd6afdc5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using FineAdmin.Model;
using System;
using System.Collections.Generic;
 
namespace FineAdmin.IService
{
    public interface IBaseService<T> where T : class, new()
    {
        #region CRUD
        /// <summary>
        /// 根据主键返回实体
        /// </summary>
        T GetById(int Id);
        /// <summary>
        /// 新增
        /// </summary>
        bool Insert(T model);
        /// <summary>
        /// 根据主键修改数据
        /// </summary>
        bool UpdateById(T model);
        /// <summary>
        /// 根据主键修改数据 修改指定字段
        /// </summary>
        bool UpdateById(T model, string updateFields);
        /// <summary>
        /// 根据主键删除数据
        /// </summary>
        bool DeleteById(int Id);
        /// <summary>
        /// 根据主键批量删除数据
        /// </summary>
        bool DeleteByIds(object Ids);
        /// <summary>
        /// 根据条件删除
        /// </summary>
        bool DeleteByWhere(string where);
        #endregion
 
        dynamic GetListByFilter(T filter, PageInfo pageInfo);
        /// <summary>
        /// 返回整张表数据
        /// returnFields需要返回的列,用逗号隔开。默认null,返回所有列
        /// </summary>
        IEnumerable<T> GetAll(string returnFields = null, string orderby = null);
        /// <summary>
        /// 根据查询条件获取数据
        /// </summary>
        IEnumerable<T> GetByWhere(string where = null, object param = null, string returnFields = null, string orderby = null);
 
    }
}