提交 | 用户 | 时间
|
0ed8ac
|
1 |
package com.iailab.module.data.point.service.impl; |
潘 |
2 |
|
|
3 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
4 |
import com.iailab.framework.common.service.impl.BaseServiceImpl; |
|
5 |
import com.iailab.framework.common.util.object.ConvertUtils; |
|
6 |
import com.iailab.module.data.point.dao.DaCumulatePointDao; |
|
7 |
import com.iailab.module.data.point.dto.DaCumulatePointDTO; |
|
8 |
import com.iailab.module.data.point.entity.DaCumulatePointEntity; |
|
9 |
import com.iailab.module.data.point.service.DaCumulatePointService; |
|
10 |
import org.springframework.stereotype.Service; |
|
11 |
|
|
12 |
import java.util.Arrays; |
|
13 |
|
|
14 |
/** |
|
15 |
* @author PanZhibao |
|
16 |
* @Description |
|
17 |
* @createTime 2024年11月28日 |
|
18 |
*/ |
|
19 |
@Service |
|
20 |
public class DaCumulatePointServiceImpl extends BaseServiceImpl<DaCumulatePointDao, DaCumulatePointEntity> implements DaCumulatePointService { |
|
21 |
|
|
22 |
@Override |
|
23 |
public void add(DaCumulatePointDTO dto, String pointId) { |
|
24 |
DaCumulatePointEntity entity = ConvertUtils.sourceToTarget(dto, DaCumulatePointEntity.class); |
|
25 |
entity.setPointId(pointId); |
|
26 |
baseDao.insert(entity); |
|
27 |
} |
|
28 |
|
|
29 |
@Override |
|
30 |
public DaCumulatePointDTO getByPoint(String pointId) { |
|
31 |
QueryWrapper<DaCumulatePointEntity> wrapper = new QueryWrapper<>(); |
|
32 |
wrapper.eq("point_id", pointId); |
|
33 |
DaCumulatePointEntity entity = baseDao.selectOne(wrapper); |
|
34 |
return ConvertUtils.sourceToTarget(entity, DaCumulatePointDTO.class); |
|
35 |
} |
|
36 |
|
|
37 |
@Override |
|
38 |
public void update(DaCumulatePointDTO dto) { |
|
39 |
DaCumulatePointEntity entity = ConvertUtils.sourceToTarget(dto, DaCumulatePointEntity.class); |
|
40 |
this.updateById(entity); |
|
41 |
} |
|
42 |
|
|
43 |
@Override |
|
44 |
public void deleteBatch(String[] ids) { |
|
45 |
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|
46 |
} |
|
47 |
|
|
48 |
@Override |
|
49 |
public void deleteByPoint(String[] ids) { |
|
50 |
QueryWrapper<DaCumulatePointEntity> wrapper = new QueryWrapper<>(); |
|
51 |
wrapper.in("point_id", Arrays.asList(ids)); |
|
52 |
baseDao.delete(wrapper); |
|
53 |
} |
|
54 |
|
|
55 |
} |