guang
2023-04-23 9e1c8d19bbca288b74464e90b75c9c1fe710ec1e
提交 | 用户 | age
9e1c8d 1 package com.hx.other.service.service.impl;
G 2
3 import javax.annotation.Resource;
4
5 import org.springframework.stereotype.Service;
6 import org.springframework.transaction.annotation.Transactional;
7
8 import com.hx.exception.TipsException;
9 import com.hx.other.service.dao.mapper.SqlQueryTempMapper;
10 import com.hx.other.service.model.SqlQueryTemp;
11 import com.hx.other.service.service.SqlQueryTempService;
12 import com.hx.mybatisTool.SqlSentence;
13 import java.util.List;
14 import java.util.Map;
15
16 @Transactional
17 @Service
18 public class SqlQueryTempServiceImpl implements SqlQueryTempService {
19
20     @Resource
21     private SqlQueryTempMapper sqlQueryTempMapper;
22
23     /**查询列表*/
24     @Override
25     public List<SqlQueryTemp> selectList(SqlSentence sqlSentence) {
26         return sqlQueryTempMapper.selectList(sqlSentence);
27     }
28
29     /**查询列表*/
30     @Override
31     public List<Map<String,Object>> selectListMap(SqlSentence sqlSentence) {
32         return sqlQueryTempMapper.selectListMap(sqlSentence);
33     }
34
35     /**查询单个*/
36     @Override
37     public SqlQueryTemp selectOne(SqlSentence sqlSentence) {
38         return sqlQueryTempMapper.selectOne(sqlSentence);
39     }
40
41     /**查询单个*/
42     @Override
43     public Map<String,Object> selectOneMap(SqlSentence sqlSentence) {
44         return sqlQueryTempMapper.selectOneMap(sqlSentence);
45     }
46
47     /**查询单个,大数据不拿取*/
48     @Override
49     public SqlQueryTemp selectOneByKey(Object object) {
50         return sqlQueryTempMapper.selectOneByKey(object);
51     }
52
53     /**查询单个,大数据拿取*/
54     @Override
55     public SqlQueryTemp selectOneByKeyBlob(Object object) {
56         return sqlQueryTempMapper.selectOneByKeyBlob(object);
57     }
58
59     /**新增*/
60     @Override
61     public void insert(SqlQueryTemp sqlQueryTemp) {
62         int count = sqlQueryTempMapper.insert(sqlQueryTemp);
63         if(count != 1) {
64             throw new TipsException("新增失败!");
65         }
66     }
67
68     /**修改*/
69     @Override
70     public void updateAll(SqlQueryTemp sqlQueryTemp) {
71         int count = sqlQueryTempMapper.updateAll(sqlQueryTemp);
72         if(count!=1) {
73             throw new TipsException("保存失败!");
74         }
75     }
76
77     /**修改*/
78     @Override
79     public void updateWhere(SqlSentence sqlSentence) {
80         int count = sqlQueryTempMapper.updateWhere(sqlSentence);
81         if(count!=1) {
82             throw new TipsException("保存失败!");
83         }
84     }
85     
86     /**删除一个*/
87     @Override
88     public void deleteOne(String delId) {
89         int count = sqlQueryTempMapper.deleteById(delId);
90         if(count!=1) {
91             throw new TipsException("删除失败!");
92         }
93     }
94
95     @Override
96     public String selectByContent(String content) {
97         return sqlQueryTempMapper.selectByContent(content);
98     }
99
100     /**查询条数*/
101     @Override
102     public int selectCount(SqlSentence sqlSentence) {
103         int count = sqlQueryTempMapper.selectCount(sqlSentence);
104         return count;
105     }
106 }