提交 | 用户 | age
|
3fde78
|
1 |
package com.hx.common.service; |
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 CommonService { |
|
15 |
|
|
16 |
/**新增,返回主键 |
|
17 |
* @param mapperClass mapper类 |
|
18 |
* @param entity 实体类 |
|
19 |
* @return 条数 |
|
20 |
*/ |
|
21 |
<T extends Serializable> int insert(Class<?> mapperClass, T entity); |
|
22 |
|
bcc2fa
|
23 |
/**新增,返回主键 |
C |
24 |
* @param mapperClass mapper类 |
|
25 |
* @param entity 实体类 |
|
26 |
* @return 条数 |
|
27 |
*/ |
|
28 |
<T extends Serializable> int insertById(Class<?> mapperClass, T entity); |
|
29 |
|
3fde78
|
30 |
/**查询条数 |
C |
31 |
* @param mapperClass mapper类 |
9338de
|
32 |
* @param sqlSentence 查询参数类 |
3fde78
|
33 |
* @return 返回条数 |
C |
34 |
*/ |
9338de
|
35 |
<T extends Serializable> int selectCount(Class<?> mapperClass, SqlSentence sqlSentence); |
3fde78
|
36 |
|
8bc3c9
|
37 |
/**查询条数 |
C |
38 |
* @param mapperClass mapper类 |
|
39 |
* @param sqlSentence 查询参数类 |
|
40 |
* @return 返回条数 |
|
41 |
*/ |
|
42 |
<T extends Serializable> int selectCountSql(Class<?> mapperClass, SqlSentence sqlSentence); |
|
43 |
|
|
44 |
|
3fde78
|
45 |
/**查询列表,返回实体类的List |
C |
46 |
* @param mapperClass mapper类 |
|
47 |
* @param sqlSentence 查询参数类 |
|
48 |
* @return 返回list |
|
49 |
*/ |
|
50 |
<T extends Serializable> List<T> selectList(Class<?> mapperClass, SqlSentence sqlSentence); |
|
51 |
|
|
52 |
/**查询列表,返回Map的List |
|
53 |
* @param mapperClass mapper类 |
|
54 |
* @param sqlSentence 查询参数类 |
|
55 |
* @return Map的List |
|
56 |
*/ |
|
57 |
<T extends Serializable> List<Map<String,Object>> selectListMap(Class<?> mapperClass, SqlSentence sqlSentence); |
|
58 |
|
|
59 |
/**查询,返回单个实体 |
|
60 |
* @param mapperClass mapper类 |
|
61 |
* @param sqlSentence 查询参数类 |
|
62 |
* @return 返回实体类 |
|
63 |
*/ |
|
64 |
<T extends Serializable> T selectOne(Class<?> mapperClass, SqlSentence sqlSentence); |
|
65 |
|
|
66 |
/**查询,返回单个map |
|
67 |
* @param mapperClass mapper类 |
|
68 |
* @param sqlSentence 查询参数类 |
|
69 |
* @return 返回实体类 |
|
70 |
*/ |
|
71 |
<T extends Serializable> Map<String,Object> selectOneMap(Class<?> mapperClass, SqlSentence sqlSentence); |
|
72 |
|
|
73 |
/**查询,返回实体类没有大数据的 |
|
74 |
* @param mapperClass mapper类 |
|
75 |
* @param object 数据标识key |
|
76 |
* @return 返回实体类 |
|
77 |
*/ |
|
78 |
<T extends Serializable> T selectOneByKey(Class<?> mapperClass, Object object); |
|
79 |
|
|
80 |
/**查询,返回实体类有大数据的 |
|
81 |
* @param mapperClass mapper类 |
|
82 |
* @param object 数据标识key |
|
83 |
* @return 返回实体类 |
|
84 |
*/ |
|
85 |
<T extends Serializable> T selectOneByKeyBlob(Class<?> mapperClass, Object object); |
|
86 |
|
|
87 |
/**更新,返回更新数量 |
|
88 |
* @param mapperClass mapper类 |
9338de
|
89 |
* @param sqlSentence 查询参数类 |
3fde78
|
90 |
* @return 返回条数 |
C |
91 |
*/ |
9338de
|
92 |
<T extends Serializable> int updateWhere(Class<?> mapperClass, SqlSentence sqlSentence); |
3fde78
|
93 |
|
C |
94 |
/**更新,返回更新数量 |
|
95 |
* @param mapperClass mapper类 |
|
96 |
* @param entity 实体类 |
|
97 |
* @return 返回条数 |
|
98 |
*/ |
|
99 |
<T extends Serializable> int updateAll(Class<?> mapperClass, T entity); |
|
100 |
|
|
101 |
/**删除,返回删除数量 |
|
102 |
* @param mapperClass mapper类 |
9338de
|
103 |
* @param sqlSentence 查询参数类 |
3fde78
|
104 |
* @return 返回条数 |
C |
105 |
*/ |
9338de
|
106 |
<T extends Serializable> int deleteWhere(Class<?> mapperClass, SqlSentence sqlSentence); |
3fde78
|
107 |
|
C |
108 |
/**删除,返回删除数量 |
|
109 |
* @param mapperClass mapper类 |
|
110 |
* @param object 数据标识key |
|
111 |
* @return 返回条数 |
|
112 |
*/ |
|
113 |
<T extends Serializable> int deleteById(Class<?> mapperClass, Object object); |
93b505
|
114 |
|
C |
115 |
/**更新sql语句(全语句) |
|
116 |
* @param sqlSentence 查询参数类 |
|
117 |
* @return 返回条数 |
|
118 |
*/ |
|
119 |
<T extends Serializable> int updateSentence(SqlSentence sqlSentence); |
|
120 |
|
b1097d
|
121 |
/**查询条数语句(全语句) |
C |
122 |
* @param sqlSentence 查询参数类 |
|
123 |
* @return 返回条数 |
|
124 |
*/ |
|
125 |
<T extends Serializable> int selectCountSql(SqlSentence sqlSentence); |
93b505
|
126 |
|
3fde78
|
127 |
} |