提交 | 用户 | 时间
|
449017
|
1 |
package com.iailab.module.model.mpk.service.impl; |
D |
2 |
|
|
3 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
558ffc
|
4 |
import com.baomidou.mybatisplus.core.enums.SqlMethod; |
449017
|
5 |
import com.baomidou.mybatisplus.core.metadata.IPage; |
D |
6 |
import com.iailab.framework.common.page.PageData; |
558ffc
|
7 |
import com.iailab.framework.common.service.impl.BaseServiceImpl; |
449017
|
8 |
import com.iailab.framework.common.service.impl.CrudServiceImpl; |
D |
9 |
import com.iailab.module.model.mpk.dao.ProjectPackageHistoryModelDao; |
|
10 |
import com.iailab.module.model.mpk.dto.ProjectPackageHistoryModelDTO; |
|
11 |
import com.iailab.module.model.mpk.entity.ProjectPackageHistoryModelEntity; |
|
12 |
import com.iailab.module.model.mpk.service.ProjectPackageHistoryModelService; |
|
13 |
import org.apache.commons.lang3.StringUtils; |
|
14 |
import org.apache.poi.ss.formula.functions.T; |
|
15 |
import org.springframework.stereotype.Service; |
|
16 |
|
558ffc
|
17 |
import java.util.Collection; |
D |
18 |
import java.util.List; |
449017
|
19 |
import java.util.Map; |
D |
20 |
|
|
21 |
/** |
|
22 |
* @description: |
|
23 |
* @author: dzd |
|
24 |
* @date: 2024/8/22 14:41 |
|
25 |
**/ |
|
26 |
@Service |
558ffc
|
27 |
public class ProjectPackageHistoryModelServiceImpl extends BaseServiceImpl<ProjectPackageHistoryModelDao, ProjectPackageHistoryModelEntity> implements ProjectPackageHistoryModelService { |
D |
28 |
|
|
29 |
public void insertList(List<ProjectPackageHistoryModelEntity> entityList) { |
|
30 |
baseDao.insertBatch(entityList); |
|
31 |
} |
449017
|
32 |
|
D |
33 |
@Override |
|
34 |
public PageData<ProjectPackageHistoryModelDTO> page(Map<String, Object> params) { |
|
35 |
IPage<ProjectPackageHistoryModelEntity> page = baseDao.selectPage( |
|
36 |
getPage(params, "py_name", true), |
|
37 |
getWrapper(params) |
|
38 |
); |
|
39 |
|
|
40 |
return getPageData(page, ProjectPackageHistoryModelDTO.class); |
|
41 |
} |
|
42 |
|
|
43 |
@Override |
|
44 |
public void deleteByMap(Map<String,Object> map) { |
|
45 |
baseDao.delete(getWrapper(map)); |
|
46 |
} |
|
47 |
|
|
48 |
public QueryWrapper<ProjectPackageHistoryModelEntity> getWrapper(Map<String, Object> params){ |
|
49 |
String id = (String)params.get("id"); |
|
50 |
String packageHistoryId = (String)params.get("packageHistoryId"); |
|
51 |
String projectId = (String)params.get("projectId"); |
|
52 |
String pyName = (String)params.get("pyName"); |
|
53 |
|
|
54 |
QueryWrapper<ProjectPackageHistoryModelEntity> wrapper = new QueryWrapper<>(); |
|
55 |
wrapper.eq(StringUtils.isNotBlank(id), "id", id) |
|
56 |
.eq(StringUtils.isNotBlank(packageHistoryId), "package_history_id", packageHistoryId) |
|
57 |
.eq(StringUtils.isNotBlank(projectId),"project_id",projectId) |
|
58 |
.like(StringUtils.isNotBlank(pyName),"py_name",pyName); |
|
59 |
|
|
60 |
return wrapper; |
|
61 |
} |
|
62 |
} |