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);
|
}
|
}
|