提交 | 用户 | age
|
3fde78
|
1 |
package com.hx.common.dao; |
C |
2 |
import com.hx.mybatisTool.SqlSentence; |
|
3 |
|
|
4 |
import java.io.Serializable; |
|
5 |
import java.util.List; |
|
6 |
import java.util.Map; |
|
7 |
|
|
8 |
|
|
9 |
/** |
|
10 |
* dao通用接口 |
|
11 |
* @author ChenJiaHe |
|
12 |
* @Date 2020-10-14 |
|
13 |
*/ |
|
14 |
public interface CommonDao { |
|
15 |
|
|
16 |
/**新增,返回主键 |
|
17 |
* @param mapperClass mapper类 |
|
18 |
* @param entity 实体类 |
|
19 |
* @return 条数 |
|
20 |
*/ |
|
21 |
<T extends Serializable> int insert(Class<?> mapperClass, T entity); |
|
22 |
|
|
23 |
/**查询条数 |
|
24 |
* @param mapperClass mapper类 |
9338de
|
25 |
* @param sqlSentence 查询参数类 |
3fde78
|
26 |
* @return 返回条数 |
C |
27 |
*/ |
9338de
|
28 |
<T extends Serializable> int selectCount(Class<?> mapperClass, SqlSentence sqlSentence); |
3fde78
|
29 |
|
C |
30 |
/**查询列表,返回实体类的List |
|
31 |
* @param mapperClass mapper类 |
|
32 |
* @param sqlSentence 查询参数类 |
|
33 |
* @return 返回list |
|
34 |
*/ |
|
35 |
<T extends Serializable> List<T> selectList(Class<?> mapperClass, SqlSentence sqlSentence); |
|
36 |
|
|
37 |
/**查询列表,返回Map的List |
|
38 |
* @param mapperClass mapper类 |
|
39 |
* @param sqlSentence 查询参数类 |
|
40 |
* @return Map的List |
|
41 |
*/ |
|
42 |
<T extends Serializable> List<Map<String,Object>> selectListMap(Class<?> mapperClass, SqlSentence sqlSentence); |
|
43 |
|
|
44 |
/**查询,返回单个实体 |
|
45 |
* @param mapperClass mapper类 |
|
46 |
* @param sqlSentence 查询参数类 |
|
47 |
* @return 返回实体类 |
|
48 |
*/ |
|
49 |
<T extends Serializable> T selectOne(Class<?> mapperClass, SqlSentence sqlSentence); |
|
50 |
|
|
51 |
/**查询,返回单个map |
|
52 |
* @param mapperClass mapper类 |
|
53 |
* @param sqlSentence 查询参数类 |
|
54 |
* @return 返回实体类 |
|
55 |
*/ |
|
56 |
<T extends Serializable> Map<String,Object> selectOneMap(Class<?> mapperClass, SqlSentence sqlSentence); |
|
57 |
|
|
58 |
/**查询,返回实体类没有大数据的 |
|
59 |
* @param mapperClass mapper类 |
|
60 |
* @param object 数据标识key |
|
61 |
* @return 返回实体类 |
|
62 |
*/ |
|
63 |
<T extends Serializable> T selectOneByKey(Class<?> mapperClass, Object object); |
|
64 |
|
|
65 |
/**查询,返回实体类有大数据的 |
|
66 |
* @param mapperClass mapper类 |
|
67 |
* @param object 数据标识key |
|
68 |
* @return 返回实体类 |
|
69 |
*/ |
|
70 |
<T extends Serializable> T selectOneByKeyBlob(Class<?> mapperClass, Object object); |
|
71 |
|
|
72 |
/**更新,返回更新数量 |
|
73 |
* @param mapperClass mapper类 |
9338de
|
74 |
* @param sqlSentence 查询参数类 |
3fde78
|
75 |
* @return 返回条数 |
C |
76 |
*/ |
9338de
|
77 |
<T extends Serializable> int updateWhere(Class<?> mapperClass, SqlSentence sqlSentence); |
3fde78
|
78 |
|
C |
79 |
/**更新,返回更新数量 |
|
80 |
* @param mapperClass mapper类 |
|
81 |
* @param entity 实体类 |
|
82 |
* @return 返回条数 |
|
83 |
*/ |
|
84 |
<T extends Serializable> int updateAll(Class<?> mapperClass, T entity); |
|
85 |
|
|
86 |
/**删除,返回删除数量 |
|
87 |
* @param mapperClass mapper类 |
9338de
|
88 |
* @param sqlSentence 查询参数类 |
3fde78
|
89 |
* @return 返回条数 |
C |
90 |
*/ |
9338de
|
91 |
<T extends Serializable> int deleteWhere(Class<?> mapperClass, SqlSentence sqlSentence); |
3fde78
|
92 |
|
C |
93 |
/**删除,返回删除数量 |
|
94 |
* @param mapperClass mapper类 |
|
95 |
* @param object 数据标识key |
|
96 |
* @return 返回条数 |
|
97 |
*/ |
|
98 |
<T extends Serializable> int deleteById(Class<?> mapperClass, Object object); |
|
99 |
|
|
100 |
} |