提交 | 用户 | 时间
|
a6de49
|
1 |
package com.iailab.module.mcs.service.impl; |
H |
2 |
|
|
3 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
4 |
import com.iailab.framework.common.service.impl.CrudServiceImpl; |
|
5 |
import com.iailab.framework.common.util.object.ConvertUtils; |
|
6 |
import com.iailab.module.mcs.dao.StModelOutDao; |
|
7 |
import com.iailab.module.mcs.dto.StModelOutDTO; |
|
8 |
import com.iailab.module.mcs.entity.StModelOutEntity; |
|
9 |
import com.iailab.module.mcs.service.StModelOutService; |
|
10 |
import org.apache.commons.lang3.StringUtils; |
|
11 |
import org.springframework.stereotype.Service; |
|
12 |
|
|
13 |
import javax.annotation.Resource; |
|
14 |
import java.util.HashMap; |
|
15 |
import java.util.List; |
|
16 |
import java.util.Map; |
|
17 |
|
|
18 |
/** |
|
19 |
* @author PanZhibao |
|
20 |
* @Description |
|
21 |
* @createTime 2023年08月02日 13:33:00 |
|
22 |
*/ |
|
23 |
@Service |
|
24 |
public class StModelOutServiceImpl extends CrudServiceImpl<StModelOutDao, StModelOutEntity, StModelOutDTO> implements StModelOutService { |
|
25 |
|
|
26 |
@Resource |
|
27 |
private StModelOutDao stModelOutDao; |
|
28 |
|
|
29 |
@Override |
|
30 |
public QueryWrapper<StModelOutEntity> getWrapper(Map<String, Object> params) { |
|
31 |
String modelId = (String) params.get("model_id"); |
|
32 |
|
|
33 |
QueryWrapper<StModelOutEntity> wrapper = new QueryWrapper<>(); |
|
34 |
wrapper.eq(StringUtils.isNotBlank(modelId), "model_id", modelId); |
|
35 |
|
|
36 |
return wrapper; |
|
37 |
} |
|
38 |
|
|
39 |
@Override |
|
40 |
public void deleteByModelId(String modelId) { |
|
41 |
Map<String, Object> params = new HashMap<>(); |
|
42 |
params.put("model_id", modelId); |
|
43 |
baseDao.delete(this.getWrapper(params)); |
|
44 |
} |
|
45 |
|
|
46 |
@Override |
|
47 |
public List<StModelOutDTO> getWriteByModelId(String modelId) { |
|
48 |
QueryWrapper queryWrapper = new QueryWrapper<StModelOutEntity>() |
|
49 |
.eq("model_id", modelId) |
|
50 |
.eq("is_write", "1") |
|
51 |
.orderByAsc("sort"); |
|
52 |
return ConvertUtils.sourceToTarget(baseDao.selectList(queryWrapper), StModelOutDTO.class); |
|
53 |
} |
|
54 |
|
|
55 |
@Override |
|
56 |
public List<StModelOutDTO> getOutPoint(String modelCode) { |
|
57 |
Map<String, Object> params = new HashMap<>(1); |
|
58 |
params.put("modelCode", modelCode); |
|
59 |
return stModelOutDao.getOutPoint(params); |
|
60 |
} |
|
61 |
|
|
62 |
@Override |
|
63 |
public List<StModelOutDTO> getAll(Map<String, Object> out) { |
|
64 |
return stModelOutDao.getAll(out); |
|
65 |
} |
|
66 |
|
|
67 |
} |