package com.iailab.module.model.mcs.sche.service.impl;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
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.module.model.mcs.sche.dao.StScheduleSuggestDao;
|
import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity;
|
import com.iailab.module.model.mcs.sche.service.StScheduleSuggestService;
|
import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestPageReqVO;
|
import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestSaveReqVO;
|
import org.springframework.stereotype.Service;
|
|
import java.util.List;
|
import java.util.UUID;
|
|
/**
|
* @author PanZhibao
|
* @Description
|
* @createTime 2024年09月06日
|
*/
|
@Service
|
public class StScheduleSuggestServiceImpl extends BaseServiceImpl<StScheduleSuggestDao, StScheduleSuggestEntity>
|
implements StScheduleSuggestService {
|
|
@Override
|
public PageResult<StScheduleSuggestEntity> page(StScheduleSuggestPageReqVO reqVO) {
|
return baseDao.selectPage(reqVO);
|
}
|
|
@Override
|
public void create(StScheduleSuggestSaveReqVO createReqVO) {
|
StScheduleSuggestEntity entity = BeanUtils.toBean(createReqVO, StScheduleSuggestEntity.class);
|
entity.setId(UUID.randomUUID().toString());
|
baseDao.insert(entity);
|
}
|
|
@Override
|
public void update(StScheduleSuggestSaveReqVO createReqVO) {
|
StScheduleSuggestEntity entity = BeanUtils.toBean(createReqVO, StScheduleSuggestEntity.class);
|
baseDao.updateById(entity);
|
}
|
|
@Override
|
public void delete(String id) {
|
baseDao.deleteById(id);
|
}
|
|
@Override
|
public StScheduleSuggestEntity getInfo(String id) {
|
return baseDao.selectById(id);
|
}
|
|
@Override
|
public List<StScheduleSuggestEntity> getList(String scheduleObj, Integer limit) {
|
QueryWrapper<StScheduleSuggestEntity> queryWrapper = new QueryWrapper<>();
|
limit = limit == null ? 1 : limit;
|
queryWrapper.eq("schedule_obj", scheduleObj)
|
.orderByDesc("create_time")
|
.last("limit " + limit);
|
return baseDao.selectList(queryWrapper);
|
}
|
}
|