package com.iailab.module.model.mpk.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.enums.SqlMethod; import com.baomidou.mybatisplus.core.metadata.IPage; import com.iailab.framework.common.page.PageData; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.framework.common.service.impl.CrudServiceImpl; import com.iailab.module.model.mpk.dao.ProjectPackageHistoryModelDao; import com.iailab.module.model.mpk.dto.ProjectPackageHistoryModelDTO; import com.iailab.module.model.mpk.entity.ProjectPackageHistoryModelEntity; import com.iailab.module.model.mpk.service.ProjectPackageHistoryModelService; import org.apache.commons.lang3.StringUtils; import org.apache.poi.ss.formula.functions.T; import org.springframework.stereotype.Service; import java.util.Collection; import java.util.List; import java.util.Map; /** * @description: * @author: dzd * @date: 2024/8/22 14:41 **/ @Service public class ProjectPackageHistoryModelServiceImpl extends BaseServiceImpl implements ProjectPackageHistoryModelService { public void insertList(List entityList) { baseDao.insertBatch(entityList); } @Override public PageData page(Map params) { IPage page = baseDao.selectPage( getPage(params, "py_name", true), getWrapper(params) ); return getPageData(page, ProjectPackageHistoryModelDTO.class); } @Override public void deleteByMap(Map map) { baseDao.delete(getWrapper(map)); } public QueryWrapper getWrapper(Map params){ String id = (String)params.get("id"); String packageHistoryId = (String)params.get("packageHistoryId"); String projectId = (String)params.get("projectId"); String pyName = (String)params.get("pyName"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), "id", id) .eq(StringUtils.isNotBlank(packageHistoryId), "package_history_id", packageHistoryId) .eq(StringUtils.isNotBlank(projectId),"project_id",projectId) .like(StringUtils.isNotBlank(pyName),"py_name",pyName); return wrapper; } }