chenjiahe
2022-04-02 0344dc66783353faff118a0ea91f7d2aa07bbd4a
提交 | 用户 | 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
28     /**获取条数*/
29     @Override
9338de 30     public <T extends Serializable> int selectCount(Class<?> mapperClass,SqlSentence sqlSentence) {
C 31         return commonDao.selectCount(mapperClass,sqlSentence);
3fde78 32     }
C 33
8bc3c9 34     /**获取条数*/
C 35     @Override
36     public <T extends Serializable> int selectCountSql(Class<?> mapperClass,SqlSentence sqlSentence) {
37         return commonDao.selectCountSql(mapperClass,sqlSentence);
38     }
39
3fde78 40     /**获取列表*/
C 41     @Override
42     public <T extends Serializable> List<T> selectList(Class<?> mapperClass, SqlSentence sqlSentence) {
43         return commonDao.selectList(mapperClass,sqlSentence);
44     }
45
46     /**获取列表*/
47     @Override
48     public <T extends Serializable> List<Map<String, Object>> selectListMap(Class<?> mapperClass, SqlSentence sqlSentence) {
49         return commonDao.selectListMap(mapperClass,sqlSentence);
50     }
51
52     /**获取单条数据*/
53     @Override
54     public <T extends Serializable> T selectOne(Class<?> mapperClass, SqlSentence sqlSentence) {
55         return commonDao.selectOne(mapperClass,sqlSentence);
56     }
57
58     /**获取单条数据*/
59     @Override
60     public <T extends Serializable> Map<String, Object> selectOneMap(Class<?> mapperClass, SqlSentence sqlSentence) {
61         return commonDao.selectOneMap(mapperClass,sqlSentence);
62     }
63
64     /**获取单条数据-不含longText的数据*/
65     @Override
66     public <T extends Serializable> T selectOneByKey(Class<?> mapperClass,Object object) {
67         return commonDao.selectOneByKey(mapperClass,object);
68     }
69
70     /**获取单条数据-含longText的数据*/
71     @Override
72     public <T extends Serializable> T selectOneByKeyBlob(Class<?> mapperClass,Object object) {
73         return commonDao.selectOneByKeyBlob(mapperClass,object);
74     }
75
76     /**更新*/
77     @Override
9338de 78     public <T extends Serializable> int updateWhere(Class<?> mapperClass,SqlSentence sqlSentence) {
C 79         return commonDao.updateWhere(mapperClass,sqlSentence);
3fde78 80     }
C 81
82     /**全部字段更新*/
83     @Override
84     public <T extends Serializable> int updateAll(Class<?> mapperClass,T entity) {
85         return commonDao.updateAll(mapperClass,entity);
86     }
87
88     /**删除*/
89     @Override
9338de 90     public <T extends Serializable> int deleteWhere(Class<?> mapperClass,SqlSentence sqlSentence) {
C 91         return commonDao.deleteWhere(mapperClass,sqlSentence);
3fde78 92     }
C 93
94     /**删除*/
95     @Override
96     public <T extends Serializable> int deleteById(Class<?> mapperClass,Object object) {
97         return commonDao.deleteById(mapperClass,object);
98     }
99
93b505 100
C 101     /**更新sql语句(全语句)*/
102     @Override
103     public <T extends Serializable> int updateSentence(SqlSentence sqlSentence) {
104         return commonDao.updateSentence(sqlSentence);
105     }
106
b1097d 107     /**更新sql语句(全语句)*/
C 108     @Override
109     public <T extends Serializable> int selectCountSql(SqlSentence sqlSentence) {
110         return commonDao.selectCountSql(sqlSentence);
111     }
112
93b505 113
3fde78 114 }