提交 | 用户 | 时间
|
449017
|
1 |
package com.iailab.module.model.mpk.service.impl; |
D |
2 |
|
|
3 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
4 |
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
5 |
import com.iailab.framework.common.page.PageData; |
|
6 |
import com.iailab.framework.common.service.impl.CrudServiceImpl; |
|
7 |
import com.iailab.module.model.mpk.dao.ProjectPackageHistoryModelDao; |
|
8 |
import com.iailab.module.model.mpk.dto.ProjectPackageHistoryModelDTO; |
|
9 |
import com.iailab.module.model.mpk.entity.ProjectPackageHistoryModelEntity; |
|
10 |
import com.iailab.module.model.mpk.service.ProjectPackageHistoryModelService; |
|
11 |
import org.apache.commons.lang3.StringUtils; |
|
12 |
import org.apache.poi.ss.formula.functions.T; |
|
13 |
import org.springframework.stereotype.Service; |
|
14 |
|
|
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 ProjectPackageHistoryModelServiceImpl extends CrudServiceImpl<ProjectPackageHistoryModelDao, ProjectPackageHistoryModelEntity, ProjectPackageHistoryModelDTO> implements ProjectPackageHistoryModelService { |
|
24 |
|
|
25 |
@Override |
|
26 |
public PageData<ProjectPackageHistoryModelDTO> page(Map<String, Object> params) { |
|
27 |
IPage<ProjectPackageHistoryModelEntity> page = baseDao.selectPage( |
|
28 |
getPage(params, "py_name", true), |
|
29 |
getWrapper(params) |
|
30 |
); |
|
31 |
|
|
32 |
return getPageData(page, ProjectPackageHistoryModelDTO.class); |
|
33 |
} |
|
34 |
|
|
35 |
@Override |
|
36 |
public void deleteByMap(Map<String,Object> map) { |
|
37 |
baseDao.delete(getWrapper(map)); |
|
38 |
} |
|
39 |
|
|
40 |
@Override |
|
41 |
public QueryWrapper<ProjectPackageHistoryModelEntity> getWrapper(Map<String, Object> params){ |
|
42 |
String id = (String)params.get("id"); |
|
43 |
String packageHistoryId = (String)params.get("packageHistoryId"); |
|
44 |
String projectId = (String)params.get("projectId"); |
|
45 |
String pyName = (String)params.get("pyName"); |
|
46 |
|
|
47 |
QueryWrapper<ProjectPackageHistoryModelEntity> wrapper = new QueryWrapper<>(); |
|
48 |
wrapper.eq(StringUtils.isNotBlank(id), "id", id) |
|
49 |
.eq(StringUtils.isNotBlank(packageHistoryId), "package_history_id", packageHistoryId) |
|
50 |
.eq(StringUtils.isNotBlank(projectId),"project_id",projectId) |
|
51 |
.like(StringUtils.isNotBlank(pyName),"py_name",pyName); |
|
52 |
|
|
53 |
return wrapper; |
|
54 |
} |
|
55 |
|
|
56 |
|
|
57 |
} |