提交 | 用户 | 时间
|
97edd7
|
1 |
package com.iailab.module.shasteel.service.demo; |
H |
2 |
|
|
3 |
import com.iailab.framework.common.pojo.PageResult; |
|
4 |
import com.iailab.framework.common.util.object.BeanUtils; |
|
5 |
import com.iailab.module.shasteel.controller.admin.demo.vo.DemoPageReqVO; |
|
6 |
import com.iailab.module.shasteel.controller.admin.demo.vo.DemoSaveReqVO; |
|
7 |
import com.iailab.module.shasteel.dal.dataobject.demo.DemoDO; |
|
8 |
import com.iailab.module.shasteel.dal.mysql.demo.DemoMapper; |
|
9 |
import lombok.extern.slf4j.Slf4j; |
|
10 |
import org.springframework.stereotype.Service; |
|
11 |
|
|
12 |
import javax.annotation.Resource; |
|
13 |
|
|
14 |
/** |
|
15 |
* @author PanZhibao |
|
16 |
* @Description |
|
17 |
* @createTime 2024年08月17日 |
|
18 |
*/ |
|
19 |
@Service |
|
20 |
@Slf4j |
|
21 |
public class DemoServiceImpl implements DemoService { |
|
22 |
|
|
23 |
@Resource |
|
24 |
private DemoMapper demoMapper; |
|
25 |
|
|
26 |
|
|
27 |
@Override |
|
28 |
public Long create(DemoSaveReqVO createReqVO) { |
|
29 |
DemoDO demo = BeanUtils.toBean(createReqVO, DemoDO.class); |
|
30 |
demoMapper.insert(demo); |
|
31 |
return demo.getId(); |
|
32 |
} |
|
33 |
|
|
34 |
@Override |
|
35 |
public Long update(DemoSaveReqVO createReqVO) { |
|
36 |
DemoDO demo = BeanUtils.toBean(createReqVO, DemoDO.class); |
|
37 |
demoMapper.updateById(demo); |
|
38 |
return demo.getId(); |
|
39 |
} |
|
40 |
|
|
41 |
@Override |
|
42 |
public void delete(Long id) { |
|
43 |
demoMapper.deleteById(id); |
|
44 |
} |
|
45 |
|
|
46 |
@Override |
|
47 |
public DemoDO getInfo(Long id) { |
|
48 |
return demoMapper.selectById(id); |
|
49 |
} |
|
50 |
|
|
51 |
@Override |
|
52 |
public PageResult<DemoDO> getPage(DemoPageReqVO pageReqVO) { |
|
53 |
return demoMapper.selectPage(pageReqVO); |
|
54 |
} |
|
55 |
|
|
56 |
} |