ChenJiaHe
2020-11-25 db7fc9f145beb76bbef19b1812d63d2ffc2d0df9
提交 | 用户 | 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
34     /**获取列表*/
35     @Override
36     public <T extends Serializable> List<T> selectList(Class<?> mapperClass, SqlSentence sqlSentence) {
37         return commonDao.selectList(mapperClass,sqlSentence);
38     }
39
40     /**获取列表*/
41     @Override
42     public <T extends Serializable> List<Map<String, Object>> selectListMap(Class<?> mapperClass, SqlSentence sqlSentence) {
43         return commonDao.selectListMap(mapperClass,sqlSentence);
44     }
45
46     /**获取单条数据*/
47     @Override
48     public <T extends Serializable> T selectOne(Class<?> mapperClass, SqlSentence sqlSentence) {
49         return commonDao.selectOne(mapperClass,sqlSentence);
50     }
51
52     /**获取单条数据*/
53     @Override
54     public <T extends Serializable> Map<String, Object> selectOneMap(Class<?> mapperClass, SqlSentence sqlSentence) {
55         return commonDao.selectOneMap(mapperClass,sqlSentence);
56     }
57
58     /**获取单条数据-不含longText的数据*/
59     @Override
60     public <T extends Serializable> T selectOneByKey(Class<?> mapperClass,Object object) {
61         return commonDao.selectOneByKey(mapperClass,object);
62     }
63
64     /**获取单条数据-含longText的数据*/
65     @Override
66     public <T extends Serializable> T selectOneByKeyBlob(Class<?> mapperClass,Object object) {
67         return commonDao.selectOneByKeyBlob(mapperClass,object);
68     }
69
70     /**更新*/
71     @Override
9338de 72     public <T extends Serializable> int updateWhere(Class<?> mapperClass,SqlSentence sqlSentence) {
C 73         return commonDao.updateWhere(mapperClass,sqlSentence);
3fde78 74     }
C 75
76     /**全部字段更新*/
77     @Override
78     public <T extends Serializable> int updateAll(Class<?> mapperClass,T entity) {
79         return commonDao.updateAll(mapperClass,entity);
80     }
81
82     /**删除*/
83     @Override
9338de 84     public <T extends Serializable> int deleteWhere(Class<?> mapperClass,SqlSentence sqlSentence) {
C 85         return commonDao.deleteWhere(mapperClass,sqlSentence);
3fde78 86     }
C 87
88     /**删除*/
89     @Override
90     public <T extends Serializable> int deleteById(Class<?> mapperClass,Object object) {
91         return commonDao.deleteById(mapperClass,object);
92     }
93
94 }