提交 | 用户 | 时间
|
bbc1ee
|
1 |
package com.iailab.module.model.mcs.sche.service.impl; |
潘 |
2 |
|
055765
|
3 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
潘 |
4 |
import com.iailab.framework.common.pojo.PageResult; |
bbc1ee
|
5 |
import com.iailab.framework.common.service.impl.BaseServiceImpl; |
055765
|
6 |
import com.iailab.framework.common.util.object.BeanUtils; |
bbc1ee
|
7 |
import com.iailab.module.model.mcs.sche.dao.StScheduleSuggestDao; |
潘 |
8 |
import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity; |
|
9 |
import com.iailab.module.model.mcs.sche.service.StScheduleSuggestService; |
055765
|
10 |
import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestPageReqVO; |
潘 |
11 |
import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestSaveReqVO; |
bbc1ee
|
12 |
import org.springframework.stereotype.Service; |
055765
|
13 |
|
潘 |
14 |
import java.util.List; |
|
15 |
import java.util.UUID; |
bbc1ee
|
16 |
|
潘 |
17 |
/** |
|
18 |
* @author PanZhibao |
|
19 |
* @Description |
|
20 |
* @createTime 2024年09月06日 |
|
21 |
*/ |
|
22 |
@Service |
|
23 |
public class StScheduleSuggestServiceImpl extends BaseServiceImpl<StScheduleSuggestDao, StScheduleSuggestEntity> |
|
24 |
implements StScheduleSuggestService { |
055765
|
25 |
|
潘 |
26 |
@Override |
|
27 |
public PageResult<StScheduleSuggestEntity> page(StScheduleSuggestPageReqVO reqVO) { |
|
28 |
return baseDao.selectPage(reqVO); |
|
29 |
} |
|
30 |
|
|
31 |
@Override |
|
32 |
public void create(StScheduleSuggestSaveReqVO createReqVO) { |
|
33 |
StScheduleSuggestEntity entity = BeanUtils.toBean(createReqVO, StScheduleSuggestEntity.class); |
|
34 |
entity.setId(UUID.randomUUID().toString()); |
|
35 |
baseDao.insert(entity); |
|
36 |
} |
|
37 |
|
|
38 |
@Override |
|
39 |
public void update(StScheduleSuggestSaveReqVO createReqVO) { |
|
40 |
StScheduleSuggestEntity entity = BeanUtils.toBean(createReqVO, StScheduleSuggestEntity.class); |
|
41 |
baseDao.updateById(entity); |
|
42 |
} |
|
43 |
|
|
44 |
@Override |
|
45 |
public void delete(String id) { |
|
46 |
baseDao.deleteById(id); |
|
47 |
} |
|
48 |
|
|
49 |
@Override |
|
50 |
public StScheduleSuggestEntity getInfo(String id) { |
|
51 |
return baseDao.selectById(id); |
|
52 |
} |
|
53 |
|
|
54 |
@Override |
|
55 |
public List<StScheduleSuggestEntity> getList(String scheduleObj, Integer limit) { |
|
56 |
QueryWrapper<StScheduleSuggestEntity> queryWrapper = new QueryWrapper<>(); |
|
57 |
limit = limit == null ? 1 : limit; |
|
58 |
queryWrapper.eq("schedule_obj", scheduleObj) |
|
59 |
.orderByDesc("create_time") |
|
60 |
.last("limit " + limit); |
|
61 |
return baseDao.selectList(queryWrapper); |
|
62 |
} |
bbc1ee
|
63 |
} |