提交 | 用户 | 时间
|
449017
|
1 |
package com.iailab.module.model.mpk.service.impl; |
D |
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.model.mpk.dao.ProjectModelDao; |
|
7 |
import com.iailab.module.model.mpk.dto.ProjectModelDTO; |
|
8 |
import com.iailab.module.model.mpk.entity.ProjectModelEntity; |
|
9 |
import com.iailab.module.model.mpk.service.ProjectModelService; |
|
10 |
import org.apache.commons.collections.CollectionUtils; |
|
11 |
import org.apache.commons.lang3.StringUtils; |
|
12 |
import org.springframework.stereotype.Service; |
|
13 |
|
|
14 |
import java.util.List; |
|
15 |
import java.util.Map; |
|
16 |
|
|
17 |
/** |
|
18 |
* @description: |
|
19 |
* @author: dzd |
|
20 |
* @date: 2024/8/22 14:41 |
|
21 |
**/ |
|
22 |
@Service |
|
23 |
public class ProjectModelServiceImpl extends CrudServiceImpl<ProjectModelDao, ProjectModelEntity, ProjectModelDTO> implements ProjectModelService { |
|
24 |
@Override |
|
25 |
public List<ProjectModelDTO> list(Map<String, Object> params) { |
|
26 |
List<ProjectModelEntity> entityList = baseDao.selectList(getWrapper(params)); |
|
27 |
|
|
28 |
return ConvertUtils.sourceToTarget(entityList, ProjectModelDTO.class); |
|
29 |
} |
|
30 |
|
|
31 |
@Override |
|
32 |
public void deleteByMap(Map<String,Object> map) { |
|
33 |
baseDao.delete(getWrapper(map)); |
|
34 |
} |
|
35 |
|
|
36 |
@Override |
|
37 |
public QueryWrapper<ProjectModelEntity> getWrapper(Map<String, Object> params){ |
|
38 |
String id = (String)params.get("id"); |
|
39 |
String projectId = (String)params.get("projectId"); |
|
40 |
String modelId = (String)params.get("modelId"); |
|
41 |
|
|
42 |
QueryWrapper<ProjectModelEntity> wrapper = new QueryWrapper<>(); |
|
43 |
wrapper.eq(StringUtils.isNotBlank(id), "id", id) |
|
44 |
.eq(StringUtils.isNotBlank(projectId), "project_id", projectId) |
|
45 |
.eq(StringUtils.isNotBlank(modelId),"model_id",modelId); |
|
46 |
|
|
47 |
return wrapper; |
|
48 |
} |
|
49 |
|
|
50 |
|
|
51 |
} |