工业互联网平台2.0版本后端代码
houzhongjian
2025-05-29 24996ea75ec4ca3b7d154387bfe37ec9dd387255
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
package com.iailab.module.model.mcs.sche.service.impl;
 
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.service.impl.BaseServiceImpl;
import com.iailab.framework.common.util.object.BeanUtils;
import com.iailab.framework.common.util.object.ConvertUtils;
import com.iailab.module.model.mcs.sche.dao.StSuggestSnapshotConfDetDao;
import com.iailab.module.model.mcs.sche.entity.StSuggestSnapshotConfDetEntity;
import com.iailab.module.model.mcs.sche.service.StSuggestSnapshotConfDetService;
import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfDetPageReqVO;
import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfDetRespVO;
import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfDetSaveReqVO;
import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfMainRespVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
import java.util.UUID;
 
 
/**
 * @author Jay
 */
@Service
public class StSuggestSnapshotConfDetServiceImpl extends BaseServiceImpl<StSuggestSnapshotConfDetDao, StSuggestSnapshotConfDetEntity>
        implements StSuggestSnapshotConfDetService {
 
 
    @Autowired
    private StSuggestSnapshotConfDetService stSuggestSnapshotConfDetService;
 
    @Override
    public PageResult<StSuggestSnapshotConfDetEntity> page(StSuggestSnapshotConfDetPageReqVO reqVO) {
        return baseDao.selectPage(reqVO);
    }
 
    @Override
    @DSTransactional(rollbackFor = Exception.class)
    public void create(StSuggestSnapshotConfDetSaveReqVO createReqVO) {
        StSuggestSnapshotConfDetEntity entity = BeanUtils.toBean(createReqVO, StSuggestSnapshotConfDetEntity.class);
        entity.setId(UUID.randomUUID().toString());
        baseDao.insert(entity);
    }
 
    @Override
    @DSTransactional(rollbackFor = Exception.class)
    public void update(StSuggestSnapshotConfDetSaveReqVO updateReqVO) {
        StSuggestSnapshotConfDetEntity entity = BeanUtils.toBean(updateReqVO, StSuggestSnapshotConfDetEntity.class);
        baseDao.updateById(entity);
    }
 
    @Override
    @DSTransactional(rollbackFor = Exception.class)
    public void delete(String id) {
        baseDao.deleteById(id);
    }
 
    @Override
    public List<StSuggestSnapshotConfDetRespVO> getByConfId(String confId) {
        return ConvertUtils.sourceToTarget(baseDao.selectList("conf_id", confId), StSuggestSnapshotConfDetRespVO.class);
    }
 
    @Override
    public StSuggestSnapshotConfDetRespVO get(String id) {
        return ConvertUtils.sourceToTarget( baseDao.selectById(id), StSuggestSnapshotConfDetRespVO.class);
    }
}