提交 | 用户 | age
|
3fde78
|
1 |
package com.hx.common.service.impl; |
C |
2 |
|
|
3 |
import com.hx.common.dao.CommonDao; |
|
4 |
import com.hx.common.service.CommonService; |
|
5 |
import com.hx.mybatisTool.SqlSentence; |
|
6 |
import org.springframework.stereotype.Service; |
|
7 |
import org.springframework.transaction.annotation.Transactional; |
|
8 |
|
|
9 |
import javax.annotation.Resource; |
|
10 |
import java.io.Serializable; |
|
11 |
import java.util.List; |
|
12 |
import java.util.Map; |
|
13 |
|
|
14 |
/**当前是有事务处理*/ |
|
15 |
@Transactional |
|
16 |
@Service |
|
17 |
public class CommonServiceImpl implements CommonService { |
|
18 |
|
|
19 |
@Resource |
|
20 |
private CommonDao commonDao; |
|
21 |
|
|
22 |
/**插入*/ |
|
23 |
@Override |
|
24 |
public <T extends Serializable> int insert(Class<?> mapperClass,T entity) { |
|
25 |
return commonDao.insert(mapperClass,entity); |
|
26 |
} |
|
27 |
|
bcc2fa
|
28 |
@Override |
C |
29 |
public <T extends Serializable> int insertById(Class<?> mapperClass, T entity) { |
|
30 |
return commonDao.insertById(mapperClass,entity); |
|
31 |
} |
|
32 |
|
3fde78
|
33 |
/**获取条数*/ |
C |
34 |
@Override |
9338de
|
35 |
public <T extends Serializable> int selectCount(Class<?> mapperClass,SqlSentence sqlSentence) { |
C |
36 |
return commonDao.selectCount(mapperClass,sqlSentence); |
3fde78
|
37 |
} |
C |
38 |
|
8bc3c9
|
39 |
/**获取条数*/ |
C |
40 |
@Override |
|
41 |
public <T extends Serializable> int selectCountSql(Class<?> mapperClass,SqlSentence sqlSentence) { |
|
42 |
return commonDao.selectCountSql(mapperClass,sqlSentence); |
|
43 |
} |
|
44 |
|
3fde78
|
45 |
/**获取列表*/ |
C |
46 |
@Override |
|
47 |
public <T extends Serializable> List<T> selectList(Class<?> mapperClass, SqlSentence sqlSentence) { |
|
48 |
return commonDao.selectList(mapperClass,sqlSentence); |
|
49 |
} |
|
50 |
|
|
51 |
/**获取列表*/ |
|
52 |
@Override |
|
53 |
public <T extends Serializable> List<Map<String, Object>> selectListMap(Class<?> mapperClass, SqlSentence sqlSentence) { |
|
54 |
return commonDao.selectListMap(mapperClass,sqlSentence); |
|
55 |
} |
|
56 |
|
|
57 |
/**获取单条数据*/ |
|
58 |
@Override |
|
59 |
public <T extends Serializable> T selectOne(Class<?> mapperClass, SqlSentence sqlSentence) { |
|
60 |
return commonDao.selectOne(mapperClass,sqlSentence); |
|
61 |
} |
|
62 |
|
|
63 |
/**获取单条数据*/ |
|
64 |
@Override |
|
65 |
public <T extends Serializable> Map<String, Object> selectOneMap(Class<?> mapperClass, SqlSentence sqlSentence) { |
|
66 |
return commonDao.selectOneMap(mapperClass,sqlSentence); |
|
67 |
} |
|
68 |
|
|
69 |
/**获取单条数据-不含longText的数据*/ |
|
70 |
@Override |
|
71 |
public <T extends Serializable> T selectOneByKey(Class<?> mapperClass,Object object) { |
|
72 |
return commonDao.selectOneByKey(mapperClass,object); |
|
73 |
} |
|
74 |
|
|
75 |
/**获取单条数据-含longText的数据*/ |
|
76 |
@Override |
|
77 |
public <T extends Serializable> T selectOneByKeyBlob(Class<?> mapperClass,Object object) { |
|
78 |
return commonDao.selectOneByKeyBlob(mapperClass,object); |
|
79 |
} |
|
80 |
|
|
81 |
/**更新*/ |
|
82 |
@Override |
9338de
|
83 |
public <T extends Serializable> int updateWhere(Class<?> mapperClass,SqlSentence sqlSentence) { |
C |
84 |
return commonDao.updateWhere(mapperClass,sqlSentence); |
3fde78
|
85 |
} |
C |
86 |
|
|
87 |
/**全部字段更新*/ |
|
88 |
@Override |
|
89 |
public <T extends Serializable> int updateAll(Class<?> mapperClass,T entity) { |
|
90 |
return commonDao.updateAll(mapperClass,entity); |
|
91 |
} |
|
92 |
|
|
93 |
/**删除*/ |
|
94 |
@Override |
9338de
|
95 |
public <T extends Serializable> int deleteWhere(Class<?> mapperClass,SqlSentence sqlSentence) { |
C |
96 |
return commonDao.deleteWhere(mapperClass,sqlSentence); |
3fde78
|
97 |
} |
C |
98 |
|
|
99 |
/**删除*/ |
|
100 |
@Override |
|
101 |
public <T extends Serializable> int deleteById(Class<?> mapperClass,Object object) { |
|
102 |
return commonDao.deleteById(mapperClass,object); |
|
103 |
} |
|
104 |
|
93b505
|
105 |
|
C |
106 |
/**更新sql语句(全语句)*/ |
|
107 |
@Override |
|
108 |
public <T extends Serializable> int updateSentence(SqlSentence sqlSentence) { |
|
109 |
return commonDao.updateSentence(sqlSentence); |
|
110 |
} |
|
111 |
|
b1097d
|
112 |
/**更新sql语句(全语句)*/ |
C |
113 |
@Override |
|
114 |
public <T extends Serializable> int selectCountSql(SqlSentence sqlSentence) { |
|
115 |
return commonDao.selectCountSql(sqlSentence); |
|
116 |
} |
|
117 |
|
93b505
|
118 |
|
3fde78
|
119 |
} |