|
|
|
|
@ -1,7 +1,11 @@ |
|
|
|
|
package org.springblade.desk.oem.service.impl; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.desk.device.pojo.entity.MeasurementRecordsEntity; |
|
|
|
|
import org.springblade.desk.device.wrapper.MeasurementRecordsWrapper; |
|
|
|
|
import org.springblade.desk.oem.pojo.entity.OemProcessEntity; |
|
|
|
|
import org.springblade.desk.oem.pojo.entity.PlatingTypeRulesEntity; |
|
|
|
|
import org.springblade.desk.oem.pojo.excel.PlatingTypeRulesExcel; |
|
|
|
|
@ -9,6 +13,7 @@ import org.springblade.desk.oem.pojo.excel.PlatingTypeRulesImport; |
|
|
|
|
import org.springblade.desk.oem.pojo.vo.PlatingTypeRulesVO; |
|
|
|
|
import org.springblade.desk.oem.mapper.PlatingTypeRulesMapper; |
|
|
|
|
import org.springblade.desk.oem.service.IPlatingTypeRulesService; |
|
|
|
|
import org.springblade.desk.oem.wrapper.PlatingTypeRulesWrapper; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
|
@ -18,6 +23,9 @@ import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
|
|
import static com.alibaba.druid.sql.visitor.SQLEvalVisitorUtils.like; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 外协镀种规则 服务实现类 |
|
|
|
|
@ -29,8 +37,19 @@ import java.util.List; |
|
|
|
|
public class PlatingTypeRulesServiceImpl extends BaseServiceImpl<PlatingTypeRulesMapper, PlatingTypeRulesEntity> implements IPlatingTypeRulesService { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<PlatingTypeRulesVO> selectPlatingTypeRulesPage(IPage<PlatingTypeRulesVO> page, PlatingTypeRulesVO mesPlatingTypeRules) { |
|
|
|
|
return page.setRecords(baseMapper.selectPlatingTypeRulesPage(page, mesPlatingTypeRules)); |
|
|
|
|
public IPage<PlatingTypeRulesVO> selectPlatingTypeRulesPage(IPage<PlatingTypeRulesEntity> page, PlatingTypeRulesVO mesPlatingTypeRules) { |
|
|
|
|
// 1. 创建条件构造器
|
|
|
|
|
LambdaQueryWrapper<PlatingTypeRulesEntity> wrapper = Wrappers.<PlatingTypeRulesEntity>lambdaQuery(); |
|
|
|
|
|
|
|
|
|
// 2. 动态添加条件(核心!)
|
|
|
|
|
// 根据实体对象 entity 中字段是否为空,来动态拼接WHERE条件
|
|
|
|
|
wrapper.like(Objects.nonNull(mesPlatingTypeRules.getOrderPlat()), PlatingTypeRulesEntity::getOrderPlat, mesPlatingTypeRules.getOrderPlat()) |
|
|
|
|
.like(Objects.nonNull(mesPlatingTypeRules.getQuotationPlat()), PlatingTypeRulesEntity::getQuotationPlat, mesPlatingTypeRules.getQuotationPlat()); |
|
|
|
|
|
|
|
|
|
// 3. 执行分页查询
|
|
|
|
|
IPage<PlatingTypeRulesEntity> platingTypeRulesEntityIPage = baseMapper.selectPage(page, wrapper); |
|
|
|
|
|
|
|
|
|
return PlatingTypeRulesWrapper.build().pageVO(platingTypeRulesEntityIPage); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|