chenjiahe
2024-09-23 826b66207dafbce24f441cb83fed1b241a6fba27
提交 | 用户 | age
826b66 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     @Override
29     public <T extends Serializable> int insertById(Class<?> mapperClass, T entity) {
30         return commonDao.insertById(mapperClass,entity);
31     }
32
33     /**获取条数*/
34     @Override
35     public <T extends Serializable> int selectCount(Class<?> mapperClass,SqlSentence sqlSentence) {
36         return commonDao.selectCount(mapperClass,sqlSentence);
37     }
38
39     /**获取条数*/
40     @Override
41     public <T extends Serializable> int selectCountSql(Class<?> mapperClass,SqlSentence sqlSentence) {
42         return commonDao.selectCountSql(mapperClass,sqlSentence);
43     }
44
45     /**获取列表*/
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
83     public <T extends Serializable> int updateWhere(Class<?> mapperClass,SqlSentence sqlSentence) {
84         return commonDao.updateWhere(mapperClass,sqlSentence);
85     }
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
95     public <T extends Serializable> int deleteWhere(Class<?> mapperClass,SqlSentence sqlSentence) {
96         return commonDao.deleteWhere(mapperClass,sqlSentence);
97     }
98
99     /**删除*/
100     @Override
101     public <T extends Serializable> int deleteById(Class<?> mapperClass,Object object) {
102         return commonDao.deleteById(mapperClass,object);
103     }
104
105
106     /**更新sql语句(全语句)*/
107     @Override
108     public <T extends Serializable> int updateSentence(SqlSentence sqlSentence) {
109         return commonDao.updateSentence(sqlSentence);
110     }
111
112     /**更新sql语句(全语句)*/
113     @Override
114     public <T extends Serializable> int selectCountSql(SqlSentence sqlSentence) {
115         return commonDao.selectCountSql(sqlSentence);
116     }
117
118
119 }