提交 | 用户 | 时间
|
a6de49
|
1 |
package com.iailab.module.data.point.service.impl; |
H |
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.DaMathPointDao; |
|
7 |
import com.iailab.module.data.point.dto.DaMathPointDTO; |
|
8 |
import com.iailab.module.data.point.entity.DaMathPointEntity; |
|
9 |
import com.iailab.module.data.point.service.DaMathPointService; |
|
10 |
import org.springframework.stereotype.Service; |
|
11 |
|
|
12 |
import java.util.Arrays; |
01d6f8
|
13 |
import java.util.UUID; |
a6de49
|
14 |
|
H |
15 |
/** |
|
16 |
* @author PanZhibao |
|
17 |
* @Description |
|
18 |
* @createTime 2024年05月12日 |
|
19 |
*/ |
|
20 |
@Service |
|
21 |
public class DaMathPointServiceImpl extends BaseServiceImpl<DaMathPointDao, DaMathPointEntity> implements DaMathPointService { |
|
22 |
|
|
23 |
@Override |
|
24 |
public void add(DaMathPointDTO dto, String pointId) { |
|
25 |
DaMathPointEntity entity = ConvertUtils.sourceToTarget(dto, DaMathPointEntity.class); |
|
26 |
entity.setPointId(pointId); |
|
27 |
baseDao.insert(entity); |
|
28 |
} |
|
29 |
|
|
30 |
@Override |
01d6f8
|
31 |
public void add(String expression, String pointId) { |
潘 |
32 |
DaMathPointEntity entity = new DaMathPointEntity(); |
|
33 |
entity.setId(UUID.randomUUID().toString()); |
|
34 |
entity.setPointId(pointId); |
|
35 |
entity.setExpression(expression); |
|
36 |
baseDao.insert(entity); |
|
37 |
} |
|
38 |
|
|
39 |
@Override |
a6de49
|
40 |
public DaMathPointDTO getByPoint(String pointId) { |
H |
41 |
QueryWrapper<DaMathPointEntity> wrapper = new QueryWrapper<>(); |
|
42 |
wrapper.eq("point_id", pointId); |
|
43 |
DaMathPointEntity entity = baseDao.selectOne(wrapper); |
|
44 |
return ConvertUtils.sourceToTarget(entity, DaMathPointDTO.class); |
|
45 |
} |
|
46 |
|
|
47 |
@Override |
|
48 |
public void update(DaMathPointDTO dto) { |
|
49 |
DaMathPointEntity entity = ConvertUtils.sourceToTarget(dto, DaMathPointEntity.class); |
|
50 |
this.updateById(entity); |
|
51 |
} |
|
52 |
|
|
53 |
@Override |
|
54 |
public void deleteBatch(String[] ids) { |
|
55 |
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|
56 |
} |
|
57 |
|
|
58 |
@Override |
|
59 |
public void deleteByPoint(String[] ids) { |
|
60 |
QueryWrapper<DaMathPointEntity> wrapper = new QueryWrapper<>(); |
|
61 |
wrapper.in("point_id", Arrays.asList(ids)); |
|
62 |
baseDao.delete(wrapper); |
|
63 |
} |
|
64 |
} |