|
|
|
@ -1,7 +1,43 @@
|
|
|
|
|
|
|
|
//package cn.iocoder.yudao.module.iot.dal.mysql.recipe;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//import java.util.*;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
|
|
|
|
//import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
|
|
|
|
|
|
//import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
|
|
|
|
|
|
|
//import cn.iocoder.yudao.module.iot.dal.dataobject.recipe.RecipeDO;
|
|
|
|
|
|
|
|
//import org.apache.ibatis.annotations.Mapper;
|
|
|
|
|
|
|
|
//import cn.iocoder.yudao.module.iot.controller.admin.recipe.vo.*;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
///**
|
|
|
|
|
|
|
|
// * 配方管理主 Mapper
|
|
|
|
|
|
|
|
// *
|
|
|
|
|
|
|
|
// * @author 内蒙必硕
|
|
|
|
|
|
|
|
// */
|
|
|
|
|
|
|
|
//@Mapper
|
|
|
|
|
|
|
|
//public interface RecipeMapper extends BaseMapperX<RecipeDO> {
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// default PageResult<RecipeDO> selectPage(RecipePageReqVO reqVO) {
|
|
|
|
|
|
|
|
// return selectPage(reqVO, new LambdaQueryWrapperX<RecipeDO>()
|
|
|
|
|
|
|
|
// .likeIfPresent(RecipeDO::getName, reqVO.getName())
|
|
|
|
|
|
|
|
// .eqIfPresent(RecipeDO::getRecipeCode, reqVO.getRecipeCode())
|
|
|
|
|
|
|
|
// .eqIfPresent(RecipeDO::getRecipeType, reqVO.getRecipeType())
|
|
|
|
|
|
|
|
// .likeIfPresent(RecipeDO::getProductName, reqVO.getProductName())
|
|
|
|
|
|
|
|
// .eqIfPresent(RecipeDO::getMachineId, reqVO.getMachineId())
|
|
|
|
|
|
|
|
// .eqIfPresent(RecipeDO::getMachineCode, reqVO.getMachineCode())
|
|
|
|
|
|
|
|
// .likeIfPresent(RecipeDO::getMachineName, reqVO.getMachineName())
|
|
|
|
|
|
|
|
// .eqIfPresent(RecipeDO::getRecipeDesc, reqVO.getRecipeDesc())
|
|
|
|
|
|
|
|
// .eqIfPresent(RecipeDO::getIsEnable, reqVO.getIsEnable())
|
|
|
|
|
|
|
|
// .betweenIfPresent(RecipeDO::getCreateTime, reqVO.getCreateTime())
|
|
|
|
|
|
|
|
// .eqIfPresent(RecipeDO::getDataUnit, reqVO.getDataUnit())
|
|
|
|
|
|
|
|
// .orderByDesc(RecipeDO::getId));
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//}
|
|
|
|
package cn.iocoder.yudao.module.iot.dal.mysql.recipe;
|
|
|
|
package cn.iocoder.yudao.module.iot.dal.mysql.recipe;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
import com.alibaba.excel.util.StringUtils;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
|
|
|
@ -9,6 +45,9 @@ import cn.iocoder.yudao.module.iot.dal.dataobject.recipe.RecipeDO;
|
|
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
|
|
import cn.iocoder.yudao.module.iot.controller.admin.recipe.vo.*;
|
|
|
|
import cn.iocoder.yudao.module.iot.controller.admin.recipe.vo.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 配方管理主 Mapper
|
|
|
|
* 配方管理主 Mapper
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@ -18,7 +57,7 @@ import cn.iocoder.yudao.module.iot.controller.admin.recipe.vo.*;
|
|
|
|
public interface RecipeMapper extends BaseMapperX<RecipeDO> {
|
|
|
|
public interface RecipeMapper extends BaseMapperX<RecipeDO> {
|
|
|
|
|
|
|
|
|
|
|
|
default PageResult<RecipeDO> selectPage(RecipePageReqVO reqVO) {
|
|
|
|
default PageResult<RecipeDO> selectPage(RecipePageReqVO reqVO) {
|
|
|
|
return selectPage(reqVO, new LambdaQueryWrapperX<RecipeDO>()
|
|
|
|
LambdaQueryWrapperX<RecipeDO> queryWrapper = new LambdaQueryWrapperX<RecipeDO>()
|
|
|
|
.likeIfPresent(RecipeDO::getName, reqVO.getName())
|
|
|
|
.likeIfPresent(RecipeDO::getName, reqVO.getName())
|
|
|
|
.eqIfPresent(RecipeDO::getRecipeCode, reqVO.getRecipeCode())
|
|
|
|
.eqIfPresent(RecipeDO::getRecipeCode, reqVO.getRecipeCode())
|
|
|
|
.eqIfPresent(RecipeDO::getRecipeType, reqVO.getRecipeType())
|
|
|
|
.eqIfPresent(RecipeDO::getRecipeType, reqVO.getRecipeType())
|
|
|
|
@ -30,7 +69,18 @@ public interface RecipeMapper extends BaseMapperX<RecipeDO> {
|
|
|
|
.eqIfPresent(RecipeDO::getIsEnable, reqVO.getIsEnable())
|
|
|
|
.eqIfPresent(RecipeDO::getIsEnable, reqVO.getIsEnable())
|
|
|
|
.betweenIfPresent(RecipeDO::getCreateTime, reqVO.getCreateTime())
|
|
|
|
.betweenIfPresent(RecipeDO::getCreateTime, reqVO.getCreateTime())
|
|
|
|
.eqIfPresent(RecipeDO::getDataUnit, reqVO.getDataUnit())
|
|
|
|
.eqIfPresent(RecipeDO::getDataUnit, reqVO.getDataUnit())
|
|
|
|
.orderByDesc(RecipeDO::getId));
|
|
|
|
.orderByDesc(RecipeDO::getId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 新增:处理ids多选导出条件
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(reqVO.getIds())) {
|
|
|
|
|
|
|
|
List<Long> idList = Arrays.stream(reqVO.getIds().split(","))
|
|
|
|
|
|
|
|
.map(String::trim)
|
|
|
|
|
|
|
|
.map(Long::valueOf)
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
queryWrapper.in(RecipeDO::getId, idList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return selectPage(reqVO, queryWrapper);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|