ShyActivityImpl.java
3.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
package com.cnlive.shenhe.serviceImpl;
//
// _ooOoo_
// o8888888o
// 88" . "88
// (| -_- |)
// O\ = /O
// ____/`---'\____
// . ' \\| |// `.
// / \\||| : |||// \
// / _||||| -:- |||||- \
// | | \\\ - /// | |
// | \_| ''\---/'' | |
// \ .-\__ `-` ___/-. /
// ___`. .' /--.--\ `. . __
// ."" '< `.___\_<|>_/___.' >'"".
// | | : `- \`.;`\ _ /`;.`/ - ` : | |
// \ \ `-. \_ __\ /__ _/ .-` / /
// ======`-.____`-.___\_____/___.-`____.-'======
// `=---='
//
// .............................................
// 佛祖镇楼 BUG辟易
// 佛曰:
// 写字楼里写字间,写字间里程序员;
// 程序人员写程序,又拿程序换酒钱。
// 酒醒只在网上坐,酒醉还来网下眠;
// 酒醉酒醒日复日,网上网下年复年。
// 但愿老死电脑间,不愿鞠躬老板前;
// 奔驰宝马贵者趣,公交自行程序员。
// 别人笑我忒疯癫,我笑自己命太贱;
//
import com.cnlive.shenhe.entity.ShyActivity;
import com.cnlive.shenhe.mapper.ShyActivityMapper;
import com.cnlive.shenhe.utils.CommonUtils;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import tk.mybatis.mapper.entity.Example;
import java.security.PublicKey;
import java.util.List;
/**
* @author Administrator
* @author shkstart
* @create 2022-03-08 10:43
*/
@Service
public class ShyActivityImpl {
@Autowired
private ShyActivityMapper ShyActivityMapper;
/**
* 添加活动
* @param ShyActivity
* @return
*/
public int insertShyActivity(ShyActivity ShyActivity) {
int i = ShyActivityMapper.insertSelective(ShyActivity);
return i;
}
/**
* 根据主键删除活动
* @param id
* @return
*/
public int deleteShyActivity(Integer id) {
int i = ShyActivityMapper.deleteByPrimaryKey(id);
return i;
}
/**
* 修改活动
* @param shyActivity
* @return
*/
public int updateShyActivity(ShyActivity shyActivity) {
int i = ShyActivityMapper.updateByPrimaryKeySelective(shyActivity);
return i;
}
/**
* 查询活动
* @param pageNum
* @param pageSize
* @return
*/
public PageInfo<ShyActivity> selectByExample(Integer id,Integer pageNum, Integer pageSize) {
Example example = new Example(ShyActivity.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo(id);
PageHelper.startPage(pageNum, pageSize, true);
List<ShyActivity> shyActivities = ShyActivityMapper.selectByExample(example);
PageInfo<ShyActivity> shyActivityPageInfo = new PageInfo<>(shyActivities);
return shyActivityPageInfo;
}
/**
* 根据条件查询活动
* @param
* @param exempt_from_trial
* @return
*/
public List<Integer> selectByExample(Integer exempt_from_trial) {
List<Integer> shyActivities = ShyActivityMapper.selectAllByExempt_from_trial(exempt_from_trial);
return shyActivities;
}
/**
* 查询所有的数据
*/
public List<ShyActivity> selectAll() {
List<ShyActivity> shyActivities = ShyActivityMapper.selectAll();
return shyActivities;
}
}