完成了配方类型

plp
86158 3 months ago
parent a22e9c8052
commit 0cca100356

@ -52,7 +52,8 @@ public interface ErrorCodeConstants {
ErrorCode CREATE_TDENGINE_FAILURE= new ErrorCode(1_003_000_000, "创建Tdengine子表失败");
ErrorCode RECIPE_NOT_EXISTS = new ErrorCode(1_003_000_000, "配方主不存在");
ErrorCode RECIPE_POINT_NOT_EXISTS = new ErrorCode(1_003_000_000, "配方点位配置表(配方与设备点位关联)不存在");
ErrorCode RECIPE_TYPE_NOT_EXISTS = new ErrorCode(1_003_000_000, "配方类型表(基础字典)不存在");
ErrorCode RECIPE_POINT_NOT_EXISTS = new ErrorCode(1_003_000_000, "手动配置参数表(绑定配方)不存在");
ErrorCode RECIPE_DEVICE_ATTRIBUTE_NOT_EXISTS = new ErrorCode(1_003_000_000, "配方配置(关联采集设备模型-点位管理)不存在");
}

@ -87,7 +87,6 @@ public class RecipeController {
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<RecipeDO> list = recipeService.getRecipePage(pageReqVO).getList();
PageResult<RecipeDO> pageResult = recipeService.getRecipePage(pageReqVO);
// 导出 Excel
ExcelUtils.write(response, "配方管理主.xls", "数据", RecipeRespVO.class,
BeanUtils.toBean(list, RecipeRespVO.class));

@ -15,25 +15,19 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@ToString(callSuper = true)
public class RecipePageReqVO extends PageParam {
@Schema(description = "配方名称", example = "赵六")
@Schema(description = "配方名称", example = "李四")
private String name;
@Schema(description = "配方编码")
private String recipeCode;
@Schema(description = "配方类型(关联配方类型表code", example = "2")
@Schema(description = "关联配方类型", example = "2")
private String recipeType;
@Schema(description = "关联产品名称", example = "李四")
@Schema(description = "关联产品名字", example = "赵六")
private String productName;
@Schema(description = "关联设备ID关联iot_device.id", example = "14725")
private Long machineId;
@Schema(description = "关联设备编码(冗余字段)")
private String machineCode;
@Schema(description = "关联设备名称(冗余字段)", example = "芋艿")
@Schema(description = "关联设备名字", example = "赵六")
private String machineName;
@Schema(description = "配方描述")
@ -49,7 +43,8 @@ public class RecipePageReqVO extends PageParam {
@Schema(description = "数据单位")
private String dataUnit;
@Schema(description = "id集合导出用多选导出时传逗号分隔的ID")
// 新增多选导出的ids字段逗号分隔的id字符串如"1,2,3"
@Schema(description = "多选导出ID集合逗号分隔", example = "1,2,3")
private String ids;
}

@ -12,36 +12,28 @@ import com.alibaba.excel.annotation.*;
@ExcelIgnoreUnannotated
public class RecipeRespVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6587")
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "631")
// @ExcelProperty("主键ID")
private Long id;
@Schema(description = "配方名称", example = "赵六")
@Schema(description = "配方名称", example = "李四")
@ExcelProperty("配方名称")
private String name;
@Schema(description = "配方编码")
// @ExcelProperty("配方编码")
@ExcelProperty("配方编码")
private String recipeCode;
@Schema(description = "配方类型(关联配方类型表code", example = "2")
@ExcelProperty("配方类型(工序)")
@Schema(description = "关联配方类型", example = "2")
@ExcelProperty("配方类型")
private String recipeType;
@Schema(description = "关联产品名称", example = "李四")
// @ExcelProperty("关联产品名称")
@Schema(description = "关联产品名字", example = "赵六")
@ExcelProperty("关联产品")
private String productName;
@Schema(description = "关联设备ID关联iot_device.id", example = "14725")
// @ExcelProperty("关联设备ID关联iot_device.id")
private Long machineId;
@Schema(description = "关联设备编码(冗余字段)")
// @ExcelProperty("关联设备编码(冗余字段)")
private String machineCode;
@Schema(description = "关联设备名称(冗余字段)", example = "芋艿")
// @ExcelProperty("关联设备名称(冗余字段)")
@Schema(description = "关联设备名字", example = "赵六")
@ExcelProperty("关联设备")
private String machineName;
@Schema(description = "配方描述")

@ -9,28 +9,22 @@ import javax.validation.constraints.*;
@Data
public class RecipeSaveReqVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6587")
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "631")
private Long id;
@Schema(description = "配方名称", example = "赵六")
@Schema(description = "配方名称", example = "李四")
private String name;
@Schema(description = "配方编码")
private String recipeCode;
@Schema(description = "配方类型(关联配方类型表code", example = "2")
@Schema(description = "关联配方类型", example = "2")
private String recipeType;
@Schema(description = "关联产品名称", example = "李四")
@Schema(description = "关联产品名字", example = "赵六")
private String productName;
@Schema(description = "关联设备ID关联iot_device.id", example = "14725")
private Long machineId;
@Schema(description = "关联设备编码(冗余字段)")
private String machineCode;
@Schema(description = "关联设备名称(冗余字段)", example = "芋艿")
@Schema(description = "关联设备名字", example = "赵六")
private String machineName;
@Schema(description = "配方描述")

@ -0,0 +1,95 @@
package cn.iocoder.yudao.module.iot.controller.admin.recipedeviceattribute;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.iot.controller.admin.recipedeviceattribute.vo.*;
import cn.iocoder.yudao.module.iot.dal.dataobject.recipedeviceattribute.RecipeDeviceAttributeDO;
import cn.iocoder.yudao.module.iot.service.recipedeviceattribute.RecipeDeviceAttributeService;
@Tag(name = "管理后台 - 配方配置(关联采集设备模型-点位管理)")
@RestController
@RequestMapping("/iot/recipe-device-attribute")
@Validated
public class RecipeDeviceAttributeController {
@Resource
private RecipeDeviceAttributeService recipeDeviceAttributeService;
@PostMapping("/create")
@Operation(summary = "创建配方配置(关联采集设备模型-点位管理)")
@PreAuthorize("@ss.hasPermission('iot:recipe-device-attribute:create')")
public CommonResult<Boolean> createRecipeDeviceAttribute(@Valid @RequestBody RecipeDeviceAttributeSaveReqVO createReqVO) {
return success(recipeDeviceAttributeService.createRecipeDeviceAttributeBatch(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新配方配置(关联采集设备模型-点位管理)")
@PreAuthorize("@ss.hasPermission('iot:recipe-device-attribute:update')")
public CommonResult<Boolean> updateRecipeDeviceAttribute(@Valid @RequestBody RecipeDeviceAttributeSaveReqVO updateReqVO) {
recipeDeviceAttributeService.updateRecipeDeviceAttribute(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除配方配置(关联采集设备模型-点位管理)")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('iot:recipe-device-attribute:delete')")
public CommonResult<Boolean> deleteRecipeDeviceAttribute(@RequestParam("id") Long id) {
recipeDeviceAttributeService.deleteRecipeDeviceAttribute(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得配方配置(关联采集设备模型-点位管理)")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('iot:recipe-device-attribute:query')")
public CommonResult<RecipeDeviceAttributeRespVO> getRecipeDeviceAttribute(@RequestParam("id") Long id) {
RecipeDeviceAttributeDO recipeDeviceAttribute = recipeDeviceAttributeService.getRecipeDeviceAttribute(id);
return success(BeanUtils.toBean(recipeDeviceAttribute, RecipeDeviceAttributeRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得配方配置(关联采集设备模型-点位管理)分页")
@PreAuthorize("@ss.hasPermission('iot:recipe-device-attribute:query')")
public CommonResult<PageResult<RecipeDeviceAttributeRespVO>> getRecipeDeviceAttributePage(@Valid RecipeDeviceAttributePageReqVO pageReqVO) {
PageResult<RecipeDeviceAttributeDO> pageResult = recipeDeviceAttributeService.getRecipeDeviceAttributePage(pageReqVO);
return success(BeanUtils.toBean(pageResult, RecipeDeviceAttributeRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出配方配置(关联采集设备模型-点位管理) Excel")
@PreAuthorize("@ss.hasPermission('iot:recipe-device-attribute:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportRecipeDeviceAttributeExcel(@Valid RecipeDeviceAttributePageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<RecipeDeviceAttributeDO> list = recipeDeviceAttributeService.getRecipeDeviceAttributePage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "配方配置(关联采集设备模型-点位管理).xls", "数据", RecipeDeviceAttributeRespVO.class,
BeanUtils.toBean(list, RecipeDeviceAttributeRespVO.class));
}
}

@ -0,0 +1,40 @@
package cn.iocoder.yudao.module.iot.controller.admin.recipedeviceattribute.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 配方配置(关联采集设备模型-点位管理)分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class RecipeDeviceAttributePageReqVO extends PageParam {
@Schema(description = "关联配方id", example = "1102")
private Long recipeId;
@Schema(description = "关联点位id", example = "21675")
private Long attributeId;
@Schema(description = "点位名字", example = "王五")
private String attributeName;
@Schema(description = "点位类型", example = "1")
private String attributeType;
@Schema(description = "数据类型", example = "2")
private String dataType;
@Schema(description = "单位")
private String dataUnit;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

@ -0,0 +1,47 @@
package cn.iocoder.yudao.module.iot.controller.admin.recipedeviceattribute.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 配方配置(关联采集设备模型-点位管理) Response VO")
@Data
@ExcelIgnoreUnannotated
public class RecipeDeviceAttributeRespVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1118")
@ExcelProperty("主键ID")
private Long id;
@Schema(description = "关联配方id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1102")
@ExcelProperty("关联配方id")
private Long recipeId;
@Schema(description = "关联点位id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21675")
@ExcelProperty("关联点位id")
private Long attributeId;
@Schema(description = "点位名字", example = "王五")
@ExcelProperty("点位名字")
private String attributeName;
@Schema(description = "点位类型", example = "1")
@ExcelProperty("点位类型")
private String attributeType;
@Schema(description = "数据类型", example = "2")
@ExcelProperty("数据类型")
private String dataType;
@Schema(description = "单位")
@ExcelProperty("单位")
private String dataUnit;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.iot.controller.admin.recipedeviceattribute.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 配方配置(关联采集设备模型-点位管理)新增/修改 Request VO")
@Data
public class RecipeDeviceAttributeSaveReqVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1118")
private Long id;
@Schema(description = "关联配方id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1102")
// @NotNull(message = "关联配方id不能为空")
private Long recipeId;
@Schema(description = "关联点位id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21675")
// @NotNull(message = "关联点位id不能为空")
private Long attributeId;
@Schema(description = "点位名字", example = "王五")
private String attributeName;
@Schema(description = "点位类型", example = "1")
private String attributeType;
@Schema(description = "数据类型", example = "2")
private String dataType;
@Schema(description = "单位")
private String dataUnit;
// 新增批量创建的属性ID集合
@Schema(description = "批量创建的属性ID集合", requiredMode = Schema.RequiredMode.REQUIRED)
private List<Long> ids;
}

@ -29,7 +29,7 @@ import cn.iocoder.yudao.module.iot.controller.admin.recipepoint.vo.*;
import cn.iocoder.yudao.module.iot.dal.dataobject.recipepoint.RecipePointDO;
import cn.iocoder.yudao.module.iot.service.recipepoint.RecipePointService;
@Tag(name = "管理后台 - 配方点位配置表(配方与设备点位关联")
@Tag(name = "管理后台 - 手动配置参数表(绑定配方")
@RestController
@RequestMapping("/iot/recipe-point")
@Validated
@ -39,14 +39,14 @@ public class RecipePointController {
private RecipePointService recipePointService;
@PostMapping("/create")
@Operation(summary = "创建配方点位配置表(配方与设备点位关联")
@Operation(summary = "创建手动配置参数表(绑定配方")
@PreAuthorize("@ss.hasPermission('iot:recipe-point:create')")
public CommonResult<Long> createRecipePoint(@Valid @RequestBody RecipePointSaveReqVO createReqVO) {
return success(recipePointService.createRecipePoint(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新配方点位配置表(配方与设备点位关联")
@Operation(summary = "更新手动配置参数表(绑定配方")
@PreAuthorize("@ss.hasPermission('iot:recipe-point:update')")
public CommonResult<Boolean> updateRecipePoint(@Valid @RequestBody RecipePointSaveReqVO updateReqVO) {
recipePointService.updateRecipePoint(updateReqVO);
@ -54,7 +54,7 @@ public class RecipePointController {
}
@DeleteMapping("/delete")
@Operation(summary = "删除配方点位配置表(配方与设备点位关联")
@Operation(summary = "删除手动配置参数表(绑定配方")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('iot:recipe-point:delete')")
public CommonResult<Boolean> deleteRecipePoint(@RequestParam("id") Long id) {
@ -63,7 +63,7 @@ public class RecipePointController {
}
@GetMapping("/get")
@Operation(summary = "获得配方点位配置表(配方与设备点位关联")
@Operation(summary = "获得手动配置参数表(绑定配方")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('iot:recipe-point:query')")
public CommonResult<RecipePointRespVO> getRecipePoint(@RequestParam("id") Long id) {
@ -72,7 +72,7 @@ public class RecipePointController {
}
@GetMapping("/page")
@Operation(summary = "获得配方点位配置表(配方与设备点位关联)分页")
@Operation(summary = "获得手动配置参数表(绑定配方)分页")
@PreAuthorize("@ss.hasPermission('iot:recipe-point:query')")
public CommonResult<PageResult<RecipePointRespVO>> getRecipePointPage(@Valid RecipePointPageReqVO pageReqVO) {
PageResult<RecipePointDO> pageResult = recipePointService.getRecipePointPage(pageReqVO);
@ -80,7 +80,7 @@ public class RecipePointController {
}
@GetMapping("/export-excel")
@Operation(summary = "导出配方点位配置表(配方与设备点位关联 Excel")
@Operation(summary = "导出手动配置参数表(绑定配方 Excel")
@PreAuthorize("@ss.hasPermission('iot:recipe-point:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportRecipePointExcel(@Valid RecipePointPageReqVO pageReqVO,
@ -88,7 +88,7 @@ public class RecipePointController {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<RecipePointDO> list = recipePointService.getRecipePointPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "配方点位配置表(配方与设备点位关联.xls", "数据", RecipePointRespVO.class,
ExcelUtils.write(response, "手动配置参数表(绑定配方.xls", "数据", RecipePointRespVO.class,
BeanUtils.toBean(list, RecipePointRespVO.class));
}

@ -4,40 +4,38 @@ import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 配方点位配置表(配方与设备点位关联)分页 Request VO")
@Schema(description = "管理后台 - 手动配置参数表(绑定配方)分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class RecipePointPageReqVO extends PageParam {
@Schema(description = "关联配方ID关联iot_recipe.id", example = "8760")
@Schema(description = "关联配方ID", example = "28516")
private Long recipeId;
@Schema(description = "点位编码关联iot_device_attribute_type.code")
private String pointCode;
@Schema(description = "参数名字", example = "李四")
private String name;
@Schema(description = "点位名称", example = "李四")
private String pointName;
@Schema(description = "上限")
private BigDecimal max;
@Schema(description = "点位类型", example = "1")
private String pointType;
@Schema(description = "下限")
private BigDecimal min;
@Schema(description = "数据类型Time、Number等", example = "1")
@Schema(description = "数据类型", example = "1")
private String dataType;
@Schema(description = "单位s、min等")
private String unit;
@Schema(description = "单位")
private String dataUnit;
@Schema(description = "设定值")
private String setValue;
@Schema(description = "实际值(从设备上载同步)")
private String actualValue;
@Schema(description = "备注", example = "你说的对")
private String remark;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)

@ -3,52 +3,49 @@ package cn.iocoder.yudao.module.iot.controller.admin.recipepoint.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 配方点位配置表(配方与设备点位关联 Response VO")
@Schema(description = "管理后台 - 手动配置参数表(绑定配方 Response VO")
@Data
@ExcelIgnoreUnannotated
public class RecipePointRespVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27323")
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16742")
@ExcelProperty("主键ID")
private Long id;
@Schema(description = "关联配方ID关联iot_recipe.id", example = "8760")
@ExcelProperty("关联配方ID关联iot_recipe.id")
@Schema(description = "关联配方ID", example = "28516")
@ExcelProperty("关联配方ID")
private Long recipeId;
@Schema(description = "点位编码关联iot_device_attribute_type.code")
@ExcelProperty("点位编码关联iot_device_attribute_type.code")
private String pointCode;
@Schema(description = "参数名字", example = "李四")
@ExcelProperty("参数名字")
private String name;
@Schema(description = "点位名称", example = "李四")
@ExcelProperty("点位名称")
private String pointName;
@Schema(description = "上限")
@ExcelProperty("上限")
private BigDecimal max;
@Schema(description = "点位类型", example = "1")
@ExcelProperty("点位类型")
private String pointType;
@Schema(description = "下限")
@ExcelProperty("下限")
private BigDecimal min;
@Schema(description = "数据类型Time、Number等", example = "1")
@ExcelProperty("数据类型Time、Number等")
@Schema(description = "数据类型", example = "1")
@ExcelProperty("数据类型")
private String dataType;
@Schema(description = "单位s、min等")
@ExcelProperty("单位s、min等")
private String unit;
@Schema(description = "单位")
@ExcelProperty("单位")
private String dataUnit;
@Schema(description = "设定值")
@ExcelProperty("设定值")
private String setValue;
@Schema(description = "备注", example = "你说的对")
@ExcelProperty("备注")
private String remark;
@Schema(description = "实际值(从设备上载同步)")
@ExcelProperty("实际值(从设备上载同步)")
private String actualValue;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;

@ -4,36 +4,34 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 配方点位配置表(配方与设备点位关联)新增/修改 Request VO")
@Schema(description = "管理后台 - 手动配置参数表(绑定配方)新增/修改 Request VO")
@Data
public class RecipePointSaveReqVO {
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27323")
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16742")
private Long id;
@Schema(description = "关联配方ID关联iot_recipe.id", example = "8760")
@Schema(description = "关联配方ID", example = "28516")
private Long recipeId;
@Schema(description = "点位编码关联iot_device_attribute_type.code")
private String pointCode;
@Schema(description = "参数名字", example = "李四")
private String name;
@Schema(description = "点位名称", example = "李四")
private String pointName;
@Schema(description = "上限")
private BigDecimal max;
@Schema(description = "点位类型", example = "1")
private String pointType;
@Schema(description = "下限")
private BigDecimal min;
@Schema(description = "数据类型Time、Number等", example = "1")
@Schema(description = "数据类型", example = "1")
private String dataType;
@Schema(description = "单位s、min等")
private String unit;
@Schema(description = "单位")
private String dataUnit;
@Schema(description = "设定值")
private String setValue;
@Schema(description = "实际值(从设备上载同步)")
private String actualValue;
@Schema(description = "备注", example = "你说的对")
private String remark;
}

@ -79,6 +79,31 @@ public class RecipeTypeController {
return success(BeanUtils.toBean(pageResult, RecipeTypeRespVO.class));
}
@GetMapping("/page-all")
@Operation(summary = "获得配方类型表(不传分页参数查全部,传则分页)")
@PreAuthorize("@ss.hasPermission('iot:recipe-type:query')")
public CommonResult<PageResult<RecipeTypeRespVO>> getRecipeTypePageAll(
RecipeTypePageReqVO pageReqVO,
HttpServletRequest request) { // 注入request判断参数是否传了
// 核心优化判断前端是否真的传了pageNo/pageSize而非判断值避免前端传1/10时误判
boolean hasPageNo = request.getParameter("pageNo") != null;
boolean hasPageSize = request.getParameter("pageSize") != null;
boolean isQueryAll = !hasPageNo && !hasPageSize;
PageResult<RecipeTypeDO> pageResult;
if (isQueryAll) {
// 查全部逻辑
pageResult = recipeTypeService.getRecipeTypeAll(pageReqVO);
} else {
// 传了分页参数则手动校验(替代@Valid避免必填报错
// ValidatorUtil.validate(pageReqVO);
// 复用原有分页逻辑
pageResult = recipeTypeService.getRecipeTypePage(pageReqVO);
}
return success(BeanUtils.toBean(pageResult, RecipeTypeRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出配方类型表(基础字典) Excel")
@PreAuthorize("@ss.hasPermission('iot:recipe-type:export')")

@ -36,23 +36,15 @@ public class RecipeDO extends BaseDO {
*/
private String recipeCode;
/**
* code
*
*/
private String recipeType;
/**
*
*
*/
private String productName;
/**
* IDiot_device.id
*/
private Long machineId;
/**
*
*/
private String machineCode;
/**
*
*
*/
private String machineName;
/**

@ -0,0 +1,55 @@
package cn.iocoder.yudao.module.iot.dal.dataobject.recipedeviceattribute;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* - DO
*
* @author
*/
@TableName("iot_recipe_device_attribute")
@KeySequence("iot_recipe_device_attribute_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class RecipeDeviceAttributeDO extends BaseDO {
/**
* ID
*/
@TableId
private Long id;
/**
* id
*/
private Long recipeId;
/**
* id
*/
private Long attributeId;
/**
*
*/
private String attributeName;
/**
*
*/
private String attributeType;
/**
*
*/
private String dataType;
/**
*
*/
private String dataUnit;
}

@ -2,13 +2,15 @@ package cn.iocoder.yudao.module.iot.dal.dataobject.recipepoint;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* DO
* DO
*
* @author
*/
@ -28,36 +30,32 @@ public class RecipePointDO extends BaseDO {
@TableId
private Long id;
/**
* IDiot_recipe.id
* ID
*/
private Long recipeId;
/**
* iot_device_attribute_type.code
*
*/
private String pointCode;
private String name;
/**
*
*
*/
private String pointName;
private BigDecimal max;
/**
*
*
*/
private String pointType;
private BigDecimal min;
/**
* TimeNumber
*
*/
private String dataType;
/**
* smin
*
*/
private String unit;
private String dataUnit;
/**
*
*
*/
private String setValue;
/**
*
*/
private String actualValue;
private String remark;
}

@ -1,53 +1,17 @@
//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;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.excel.util.StringUtils;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
//import cn.iocoder.yudao.framework.common.util.StringUtils;
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.*;
import cn.iocoder.yudao.module.iot.controller.admin.recipe.vo.RecipePageReqVO;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* Mapper
*
@ -57,13 +21,13 @@ import java.util.stream.Collectors;
public interface RecipeMapper extends BaseMapperX<RecipeDO> {
default PageResult<RecipeDO> selectPage(RecipePageReqVO reqVO) {
// 1. 先创建查询条件对象
LambdaQueryWrapperX<RecipeDO> queryWrapper = new LambdaQueryWrapperX<RecipeDO>()
// 原有所有查询条件(保留不变)
.likeIfPresent(RecipeDO::getName, reqVO.getName())
.eqIfPresent(RecipeDO::getRecipeCode, reqVO.getRecipeCode())
.likeIfPresent(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())
@ -71,15 +35,18 @@ public interface RecipeMapper extends BaseMapperX<RecipeDO> {
.eqIfPresent(RecipeDO::getDataUnit, reqVO.getDataUnit())
.orderByDesc(RecipeDO::getId);
// 新增处理ids多选导出条件
// 2. 新增处理ids多选导出条件(和参考代码逻辑一致)
if (StringUtils.isNotBlank(reqVO.getIds())) {
// 将逗号分隔的ids字符串转为Long类型的List
List<Long> idList = Arrays.stream(reqVO.getIds().split(","))
.map(String::trim)
.map(Long::valueOf)
.map(String::trim) // 去除空格,避免空字符导致转换失败
.map(Long::valueOf) // 转为Long类型
.collect(Collectors.toList());
// 添加idIn条件只查询指定ids的记录
queryWrapper.in(RecipeDO::getId, idList);
}
// 3. 执行分页查询
return selectPage(reqVO, queryWrapper);
}

@ -0,0 +1,32 @@
package cn.iocoder.yudao.module.iot.dal.mysql.recipedeviceattribute;
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.recipedeviceattribute.RecipeDeviceAttributeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.iot.controller.admin.recipedeviceattribute.vo.*;
/**
* - Mapper
*
* @author
*/
@Mapper
public interface RecipeDeviceAttributeMapper extends BaseMapperX<RecipeDeviceAttributeDO> {
default PageResult<RecipeDeviceAttributeDO> selectPage(RecipeDeviceAttributePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<RecipeDeviceAttributeDO>()
.eqIfPresent(RecipeDeviceAttributeDO::getRecipeId, reqVO.getRecipeId())
.eqIfPresent(RecipeDeviceAttributeDO::getAttributeId, reqVO.getAttributeId())
.likeIfPresent(RecipeDeviceAttributeDO::getAttributeName, reqVO.getAttributeName())
.eqIfPresent(RecipeDeviceAttributeDO::getAttributeType, reqVO.getAttributeType())
.eqIfPresent(RecipeDeviceAttributeDO::getDataType, reqVO.getDataType())
.eqIfPresent(RecipeDeviceAttributeDO::getDataUnit, reqVO.getDataUnit())
.betweenIfPresent(RecipeDeviceAttributeDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(RecipeDeviceAttributeDO::getId));
}
}

@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.iot.controller.admin.recipepoint.vo.*;
/**
* Mapper
* Mapper
*
* @author
*/
@ -20,13 +20,12 @@ public interface RecipePointMapper extends BaseMapperX<RecipePointDO> {
default PageResult<RecipePointDO> selectPage(RecipePointPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<RecipePointDO>()
.eqIfPresent(RecipePointDO::getRecipeId, reqVO.getRecipeId())
.eqIfPresent(RecipePointDO::getPointCode, reqVO.getPointCode())
.likeIfPresent(RecipePointDO::getPointName, reqVO.getPointName())
.eqIfPresent(RecipePointDO::getPointType, reqVO.getPointType())
.likeIfPresent(RecipePointDO::getName, reqVO.getName())
.eqIfPresent(RecipePointDO::getMax, reqVO.getMax())
.eqIfPresent(RecipePointDO::getMin, reqVO.getMin())
.eqIfPresent(RecipePointDO::getDataType, reqVO.getDataType())
.eqIfPresent(RecipePointDO::getUnit, reqVO.getUnit())
.eqIfPresent(RecipePointDO::getSetValue, reqVO.getSetValue())
.eqIfPresent(RecipePointDO::getActualValue, reqVO.getActualValue())
.eqIfPresent(RecipePointDO::getDataUnit, reqVO.getDataUnit())
.eqIfPresent(RecipePointDO::getRemark, reqVO.getRemark())
.betweenIfPresent(RecipePointDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(RecipePointDO::getId));
}

@ -19,12 +19,54 @@ import cn.iocoder.yudao.module.iot.controller.admin.recipetype.vo.*;
*
* @author
*/
//@Mapper
//public interface RecipeTypeMapper extends BaseMapperX<RecipeTypeDO> {
//
// default PageResult<RecipeTypeDO> selectPage(RecipeTypePageReqVO reqVO) {
// LambdaQueryWrapperX<RecipeTypeDO> queryWrapper = new LambdaQueryWrapperX<RecipeTypeDO>()
//// return selectPage(reqVO, new LambdaQueryWrapperX<RecipeTypeDO>()
// .eqIfPresent(RecipeTypeDO::getCode, reqVO.getCode())
// .likeIfPresent(RecipeTypeDO::getName, reqVO.getName())
// .eqIfPresent(RecipeTypeDO::getProcess, reqVO.getProcess())
// .eqIfPresent(RecipeTypeDO::getRemark, reqVO.getRemark())
// .eqIfPresent(RecipeTypeDO::getSort, reqVO.getSort())
// .betweenIfPresent(RecipeTypeDO::getCreateTime, reqVO.getCreateTime())
// .orderByDesc(RecipeTypeDO::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(RecipeTypeDO::getId, idList);
// }
//
// return selectPage(reqVO, queryWrapper);
//
//
// }
//
//}
@Mapper
public interface RecipeTypeMapper extends BaseMapperX<RecipeTypeDO> {
// 原有selectPage方法保留不动
default PageResult<RecipeTypeDO> selectPage(RecipeTypePageReqVO reqVO) {
LambdaQueryWrapperX<RecipeTypeDO> queryWrapper = buildQueryWrapper(reqVO);
return selectPage(reqVO, queryWrapper);
}
// 新增selectList方法复用查询条件仅查全部列表解决Service报错
default List<RecipeTypeDO> selectList(RecipeTypePageReqVO reqVO) {
LambdaQueryWrapperX<RecipeTypeDO> queryWrapper = buildQueryWrapper(reqVO);
return selectList(queryWrapper); // 调用BaseMapperX的selectList方法
}
// 抽取通用查询条件构造方法(复用,避免代码重复)
default LambdaQueryWrapperX<RecipeTypeDO> buildQueryWrapper(RecipeTypePageReqVO reqVO) {
LambdaQueryWrapperX<RecipeTypeDO> queryWrapper = new LambdaQueryWrapperX<RecipeTypeDO>()
// return selectPage(reqVO, new LambdaQueryWrapperX<RecipeTypeDO>()
.eqIfPresent(RecipeTypeDO::getCode, reqVO.getCode())
.likeIfPresent(RecipeTypeDO::getName, reqVO.getName())
.eqIfPresent(RecipeTypeDO::getProcess, reqVO.getProcess())
@ -33,7 +75,7 @@ public interface RecipeTypeMapper extends BaseMapperX<RecipeTypeDO> {
.betweenIfPresent(RecipeTypeDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(RecipeTypeDO::getId);
// 新增:处理ids多选导出条件
// 处理ids多选导出条件(复用原有逻辑)
if (StringUtils.isNotBlank(reqVO.getIds())) {
List<Long> idList = Arrays.stream(reqVO.getIds().split(","))
.map(String::trim)
@ -41,10 +83,7 @@ public interface RecipeTypeMapper extends BaseMapperX<RecipeTypeDO> {
.collect(Collectors.toList());
queryWrapper.in(RecipeTypeDO::getId, idList);
}
return selectPage(reqVO, queryWrapper);
return queryWrapper;
}
}

@ -71,5 +71,4 @@ public class RecipeServiceImpl implements RecipeService {
return recipeMapper.selectPage(pageReqVO);
}
}

@ -0,0 +1,57 @@
package cn.iocoder.yudao.module.iot.service.recipedeviceattribute;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.iot.controller.admin.recipedeviceattribute.vo.*;
import cn.iocoder.yudao.module.iot.dal.dataobject.recipedeviceattribute.RecipeDeviceAttributeDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
/**
* - Service
*
* @author
*/
public interface RecipeDeviceAttributeService {
/**
* -
*
* @param createReqVO
* @return
*/
// Long createRecipeDeviceAttribute(@Valid RecipeDeviceAttributeSaveReqVO createReqVO);
/**
* -
*
* @param updateReqVO
*/
void updateRecipeDeviceAttribute(@Valid RecipeDeviceAttributeSaveReqVO updateReqVO);
/**
* -
*
* @param id
*/
void deleteRecipeDeviceAttribute(Long id);
/**
* -
*
* @param id
* @return -
*/
RecipeDeviceAttributeDO getRecipeDeviceAttribute(Long id);
/**
* -
*
* @param pageReqVO
* @return -
*/
PageResult<RecipeDeviceAttributeDO> getRecipeDeviceAttributePage(RecipeDeviceAttributePageReqVO pageReqVO);
Boolean createRecipeDeviceAttributeBatch(RecipeDeviceAttributeSaveReqVO createReqVO);
}

@ -0,0 +1,110 @@
package cn.iocoder.yudao.module.iot.service.recipedeviceattribute;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import cn.iocoder.yudao.module.iot.controller.admin.recipedeviceattribute.vo.*;
import cn.iocoder.yudao.module.iot.dal.dataobject.recipedeviceattribute.RecipeDeviceAttributeDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.iot.dal.mysql.recipedeviceattribute.RecipeDeviceAttributeMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.iot.enums.ErrorCodeConstants.*;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; // 或芋道的CollectionUtils
import java.util.List;
import java.util.stream.Collectors;
//import cn.iocoder.yudao.framework.common.util.bean.BeanUtils; // 确保BeanUtils的导入正确
/**
* - Service
*
* @author
*/
@Service
@Validated
public class RecipeDeviceAttributeServiceImpl implements RecipeDeviceAttributeService {
@Resource
private RecipeDeviceAttributeMapper recipeDeviceAttributeMapper;
// @Override
// public Long createRecipeDeviceAttribute(RecipeDeviceAttributeSaveReqVO createReqVO) {
// // 插入
// RecipeDeviceAttributeDO recipeDeviceAttribute = BeanUtils.toBean(createReqVO, RecipeDeviceAttributeDO.class);
// recipeDeviceAttributeMapper.insert(recipeDeviceAttribute);
// // 返回
// return recipeDeviceAttribute.getId();
// }
@Override
public Boolean createRecipeDeviceAttributeBatch(RecipeDeviceAttributeSaveReqVO createReqVO) {
// 1. 非空校验ids集合不能为空
if (CollectionUtils.isEmpty(createReqVO.getIds())) {
throw new IllegalArgumentException("批量创建失败属性ID集合ids不能为空");
}
// 2. 非空校验基础字段如recipe_id不能为空
if (createReqVO.getRecipeId() == null) {
throw new IllegalArgumentException("批量创建失败配方IDrecipeId不能为空");
}
List<RecipeDeviceAttributeDO> attributeList = createReqVO.getIds().stream()
.map(attributeId -> {
RecipeDeviceAttributeDO attributeDO = BeanUtils.toBean(createReqVO, RecipeDeviceAttributeDO.class);
attributeDO.setAttributeId(attributeId);
return attributeDO;
})
.collect(Collectors.toList());
// 4. 批量插入(调整接收类型)
Boolean insertSuccess = recipeDeviceAttributeMapper.insertBatch(attributeList);
// 5. 返回是否批量插入成功
return insertSuccess;
}
@Override
public void updateRecipeDeviceAttribute(RecipeDeviceAttributeSaveReqVO updateReqVO) {
// 校验存在
validateRecipeDeviceAttributeExists(updateReqVO.getId());
// 更新
RecipeDeviceAttributeDO updateObj = BeanUtils.toBean(updateReqVO, RecipeDeviceAttributeDO.class);
recipeDeviceAttributeMapper.updateById(updateObj);
}
@Override
public void deleteRecipeDeviceAttribute(Long id) {
// 校验存在
validateRecipeDeviceAttributeExists(id);
// 删除
recipeDeviceAttributeMapper.deleteById(id);
}
private void validateRecipeDeviceAttributeExists(Long id) {
if (recipeDeviceAttributeMapper.selectById(id) == null) {
throw exception(RECIPE_DEVICE_ATTRIBUTE_NOT_EXISTS);
}
}
@Override
public RecipeDeviceAttributeDO getRecipeDeviceAttribute(Long id) {
return recipeDeviceAttributeMapper.selectById(id);
}
@Override
public PageResult<RecipeDeviceAttributeDO> getRecipeDeviceAttributePage(RecipeDeviceAttributePageReqVO pageReqVO) {
return recipeDeviceAttributeMapper.selectPage(pageReqVO);
}
}

@ -8,14 +8,14 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
/**
* Service
* Service
*
* @author
*/
public interface RecipePointService {
/**
*
*
*
* @param createReqVO
* @return
@ -23,32 +23,32 @@ public interface RecipePointService {
Long createRecipePoint(@Valid RecipePointSaveReqVO createReqVO);
/**
*
*
*
* @param updateReqVO
*/
void updateRecipePoint(@Valid RecipePointSaveReqVO updateReqVO);
/**
*
*
*
* @param id
*/
void deleteRecipePoint(Long id);
/**
*
*
*
* @param id
* @return
* @return
*/
RecipePointDO getRecipePoint(Long id);
/**
*
*
*
* @param pageReqVO
* @return
* @return
*/
PageResult<RecipePointDO> getRecipePointPage(RecipePointPageReqVO pageReqVO);

@ -18,7 +18,7 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU
import static cn.iocoder.yudao.module.iot.enums.ErrorCodeConstants.*;
/**
* Service
* Service
*
* @author
*/

@ -52,4 +52,14 @@ public interface RecipeTypeService {
*/
PageResult<RecipeTypeDO> getRecipeTypePage(RecipeTypePageReqVO pageReqVO);
/**
*
* @param pageReqVO
* @return
*/
PageResult<RecipeTypeDO> getRecipeTypeAll(RecipeTypePageReqVO pageReqVO);
}

@ -71,4 +71,12 @@ public class RecipeTypeServiceImpl implements RecipeTypeService {
return recipeTypeMapper.selectPage(pageReqVO);
}
@Override
public PageResult<RecipeTypeDO> getRecipeTypeAll(RecipeTypePageReqVO pageReqVO) {
// 调用Mapper查询全部数据复用原有分页的查询条件只是不分页
List<RecipeTypeDO> list = recipeTypeMapper.selectList(pageReqVO);
// 封装成PageResult返回总数=列表长度,保持返回格式和分页接口一致)
return new PageResult<>(list, (long) list.size());
}
}

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.iot.dal.mysql.recipedeviceattribute.RecipeDeviceAttributeMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>
Loading…
Cancel
Save