feat: 装箱区点位表
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
package cn.code.nl.module.lms.controller.admin.packagepoint;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.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 jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.PageParam;
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.framework.common.util.object.BeanUtils;
|
||||
import static cn.code.nl.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.code.nl.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.code.nl.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.code.nl.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.code.nl.module.lms.controller.admin.packagepoint.vo.*;
|
||||
import cn.code.nl.module.lms.dal.dataobject.packagepoint.PackagePointDO;
|
||||
import cn.code.nl.module.lms.service.packagepoint.PackagePointService;
|
||||
import org.dromara.core.trans.anno.TransMethodResult;
|
||||
|
||||
@Tag(name = "管理后台 - 装箱区点位库存")
|
||||
@RestController
|
||||
@RequestMapping("/lms/package-point")
|
||||
@Validated
|
||||
public class PackagePointController {
|
||||
|
||||
@Resource
|
||||
private PackagePointService packagePointService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建装箱区点位库存")
|
||||
@PreAuthorize("@ss.hasPermission('lms:package-point:create')")
|
||||
public CommonResult<Long> createPackagePoint(@Valid @RequestBody PackagePointSaveReqVO createReqVO) {
|
||||
return success(packagePointService.createPackagePoint(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新装箱区点位库存")
|
||||
@PreAuthorize("@ss.hasPermission('lms:package-point:update')")
|
||||
public CommonResult<Boolean> updatePackagePoint(@Valid @RequestBody PackagePointSaveReqVO updateReqVO) {
|
||||
packagePointService.updatePackagePoint(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除装箱区点位库存")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('lms:package-point:delete')")
|
||||
public CommonResult<Boolean> deletePackagePoint(@RequestParam("id") Long id) {
|
||||
packagePointService.deletePackagePoint(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除装箱区点位库存")
|
||||
@PreAuthorize("@ss.hasPermission('lms:package-point:delete')")
|
||||
public CommonResult<Boolean> deletePackagePointList(@RequestParam("ids") List<Long> ids) {
|
||||
packagePointService.deletePackagePointListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得装箱区点位库存")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('lms:package-point:query')")
|
||||
public CommonResult<PackagePointRespVO> getPackagePoint(@RequestParam("id") Long id) {
|
||||
PackagePointDO packagePoint = packagePointService.getPackagePoint(id);
|
||||
return success(BeanUtils.toBean(packagePoint, PackagePointRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得装箱区点位库存分页")
|
||||
@TransMethodResult
|
||||
@PreAuthorize("@ss.hasPermission('lms:package-point:query')")
|
||||
public CommonResult<PageResult<PackagePointRespVO>> getPackagePointPage(@Valid PackagePointPageReqVO pageReqVO) {
|
||||
PageResult<PackagePointDO> pageResult = packagePointService.getPackagePointPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PackagePointRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出装箱区点位库存 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('lms:package-point:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPackagePointExcel(@Valid PackagePointPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PackagePointDO> list = packagePointService.getPackagePointPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "装箱区点位库存.xls", "数据", PackagePointRespVO.class,
|
||||
BeanUtils.toBean(list, PackagePointRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.code.nl.module.lms.controller.admin.packagepoint.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.code.nl.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.code.nl.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 装箱区点位库存分页 Request VO")
|
||||
@Data
|
||||
public class PackagePointPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "点位名称", example = "赵六")
|
||||
private String pointName;
|
||||
|
||||
@Schema(description = "点位类型", example = "2")
|
||||
private String pointType;
|
||||
|
||||
@Schema(description = "子卷号", example = "赵六")
|
||||
private String containerName;
|
||||
|
||||
@Schema(description = "库存状态", example = "2")
|
||||
private String pointStatus;
|
||||
|
||||
@Schema(description = "载具号")
|
||||
private String vehicleCode;
|
||||
|
||||
@Schema(description = "位置")
|
||||
private String pointLocation;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private Boolean isUsed;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package cn.code.nl.module.lms.controller.admin.packagepoint.vo;
|
||||
|
||||
import cn.code.nl.module.system.api.user.AdminUserApi;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.dromara.core.trans.anno.Trans;
|
||||
import org.dromara.core.trans.constant.TransType;
|
||||
import org.dromara.core.trans.vo.VO;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 装箱区点位库存 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PackagePointRespVO implements VO {
|
||||
|
||||
@Schema(description = "库存记录标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "837")
|
||||
@ExcelProperty("库存记录标识")
|
||||
@TableId
|
||||
private Long pointId;
|
||||
|
||||
@Schema(description = "点位编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("点位编码")
|
||||
private String pointCode;
|
||||
|
||||
@Schema(description = "点位名称", example = "赵六")
|
||||
@ExcelProperty("点位名称")
|
||||
private String pointName;
|
||||
|
||||
@Schema(description = "点位类型", example = "2")
|
||||
@ExcelProperty("点位类型")
|
||||
private String pointType;
|
||||
|
||||
@Schema(description = "子卷号", example = "赵六")
|
||||
@ExcelProperty("子卷号")
|
||||
private String containerName;
|
||||
|
||||
@Schema(description = "库存状态", example = "2")
|
||||
@ExcelProperty("库存状态")
|
||||
private String pointStatus;
|
||||
|
||||
@Schema(description = "载具号")
|
||||
@ExcelProperty("载具号")
|
||||
private String vehicleCode;
|
||||
|
||||
@Schema(description = "区块")
|
||||
@ExcelProperty("区块")
|
||||
private String block;
|
||||
|
||||
@Schema(description = "位置")
|
||||
@ExcelProperty("位置")
|
||||
private String pointLocation;
|
||||
|
||||
@Schema(description = "顺序号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("顺序号")
|
||||
private Integer sortSeq;
|
||||
|
||||
@Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否启用")
|
||||
private Boolean isUsed;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "规划")
|
||||
@ExcelProperty("规划")
|
||||
private String plan;
|
||||
|
||||
@Schema(description = "排")
|
||||
@ExcelProperty("排")
|
||||
private String rowNum;
|
||||
|
||||
@Schema(description = "列")
|
||||
@ExcelProperty("列")
|
||||
private String colNum;
|
||||
|
||||
@Schema(description = "深浅位0浅位1深位")
|
||||
@ExcelProperty("深浅位0浅位1深位")
|
||||
private String depth;
|
||||
|
||||
@Schema(description = "所属等待点类型", example = "2")
|
||||
@ExcelProperty("所属等待点类型")
|
||||
private String waitPointType;
|
||||
|
||||
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "更新者")
|
||||
@ExcelProperty("更新者")
|
||||
@Trans(type = TransType.AUTO_TRANS, key = AdminUserApi.PREFIX, fields = "nickname", ref = "updaterName")
|
||||
private String updater;
|
||||
|
||||
@Schema(description = "更新者名称")
|
||||
private String updaterName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package cn.code.nl.module.lms.controller.admin.packagepoint.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 装箱区点位库存新增/修改 Request VO")
|
||||
@Data
|
||||
public class PackagePointSaveReqVO {
|
||||
|
||||
@Schema(description = "库存记录标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "837")
|
||||
private Long pointId;
|
||||
|
||||
@Schema(description = "点位编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "点位编码不能为空")
|
||||
private String pointCode;
|
||||
|
||||
@Schema(description = "点位名称", example = "赵六")
|
||||
private String pointName;
|
||||
|
||||
@Schema(description = "点位类型", example = "2")
|
||||
private String pointType;
|
||||
|
||||
@Schema(description = "子卷号", example = "赵六")
|
||||
private String containerName;
|
||||
|
||||
@Schema(description = "库存状态", example = "2")
|
||||
private String pointStatus;
|
||||
|
||||
@Schema(description = "载具号")
|
||||
private String vehicleCode;
|
||||
|
||||
@Schema(description = "区块")
|
||||
private String block;
|
||||
|
||||
@Schema(description = "位置")
|
||||
private String pointLocation;
|
||||
|
||||
@Schema(description = "顺序号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "顺序号不能为空")
|
||||
private Integer sortSeq;
|
||||
|
||||
@Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否启用不能为空")
|
||||
private Boolean isUsed;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "规划")
|
||||
private String plan;
|
||||
|
||||
@Schema(description = "排")
|
||||
private String rowNum;
|
||||
|
||||
@Schema(description = "列")
|
||||
private String colNum;
|
||||
|
||||
@Schema(description = "深浅位0浅位1深位")
|
||||
private String depth;
|
||||
|
||||
@Schema(description = "所属等待点类型", example = "2")
|
||||
private String waitPointType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package cn.code.nl.module.lms.dal.dataobject.packagepoint;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.code.nl.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 装箱区点位库存 DO
|
||||
*
|
||||
* @author 诺力管理员
|
||||
*/
|
||||
@TableName("lms_package_point")
|
||||
@KeySequence("lms_package_point_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PackagePointDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 库存记录标识
|
||||
*/
|
||||
@TableId
|
||||
private Long pointId;
|
||||
/**
|
||||
* 点位编码
|
||||
*/
|
||||
private String pointCode;
|
||||
/**
|
||||
* 点位名称
|
||||
*/
|
||||
private String pointName;
|
||||
/**
|
||||
* 点位类型
|
||||
*/
|
||||
private String pointType;
|
||||
/**
|
||||
* 子卷号
|
||||
*/
|
||||
private String containerName;
|
||||
/**
|
||||
* 库存状态
|
||||
*/
|
||||
private String pointStatus;
|
||||
/**
|
||||
* 载具号
|
||||
*/
|
||||
private String vehicleCode;
|
||||
/**
|
||||
* 区块
|
||||
*/
|
||||
private String block;
|
||||
/**
|
||||
* 位置
|
||||
*/
|
||||
private String pointLocation;
|
||||
/**
|
||||
* 顺序号
|
||||
*/
|
||||
private Integer sortSeq;
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Boolean isUsed;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 规划
|
||||
*/
|
||||
private String plan;
|
||||
/**
|
||||
* 排
|
||||
*/
|
||||
private String rowNum;
|
||||
/**
|
||||
* 列
|
||||
*/
|
||||
private String colNum;
|
||||
/**
|
||||
* 深浅位0浅位1深位
|
||||
*/
|
||||
private String depth;
|
||||
/**
|
||||
* 所属等待点类型
|
||||
*/
|
||||
private String waitPointType;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package cn.code.nl.module.lms.dal.mysql.packagepoint;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.code.nl.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.code.nl.module.lms.controller.admin.packagepoint.vo.PackagePointPageReqVO;
|
||||
import cn.code.nl.module.lms.dal.dataobject.packagepoint.PackagePointDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* 装箱区点位库存 Mapper
|
||||
*
|
||||
* @author 诺力管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface PackagePointMapper extends BaseMapperX<PackagePointDO> {
|
||||
|
||||
default PageResult<PackagePointDO> selectPage(PackagePointPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PackagePointDO>()
|
||||
.eqIfPresent(PackagePointDO::getPointType, reqVO.getPointType())
|
||||
.likeIfPresent(PackagePointDO::getContainerName, reqVO.getContainerName())
|
||||
.eqIfPresent(PackagePointDO::getPointStatus, reqVO.getPointStatus())
|
||||
.eqIfPresent(PackagePointDO::getVehicleCode, reqVO.getVehicleCode())
|
||||
.eqIfPresent(PackagePointDO::getPointLocation, reqVO.getPointLocation())
|
||||
.eqIfPresent(PackagePointDO::getIsUsed, reqVO.getIsUsed())
|
||||
.and(StringUtils.hasText(reqVO.getPointName()), wrapper -> wrapper
|
||||
.like(PackagePointDO::getPointName, reqVO.getPointName())
|
||||
.or()
|
||||
.like(PackagePointDO::getPointCode, reqVO.getPointName()))
|
||||
.orderByAsc(PackagePointDO::getPointId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package cn.code.nl.module.lms.service.packagepoint;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import cn.code.nl.module.lms.controller.admin.packagepoint.vo.*;
|
||||
import cn.code.nl.module.lms.dal.dataobject.packagepoint.PackagePointDO;
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 装箱区点位库存 Service 接口
|
||||
*
|
||||
* @author 诺力管理员
|
||||
*/
|
||||
public interface PackagePointService {
|
||||
|
||||
/**
|
||||
* 创建装箱区点位库存
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createPackagePoint(@Valid PackagePointSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新装箱区点位库存
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePackagePoint(@Valid PackagePointSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除装箱区点位库存
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePackagePoint(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除装箱区点位库存
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deletePackagePointListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得装箱区点位库存
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 装箱区点位库存
|
||||
*/
|
||||
PackagePointDO getPackagePoint(Long id);
|
||||
|
||||
/**
|
||||
* 获得装箱区点位库存分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 装箱区点位库存分页
|
||||
*/
|
||||
PageResult<PackagePointDO> getPackagePointPage(PackagePointPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package cn.code.nl.module.lms.service.packagepoint;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.code.nl.module.lms.controller.admin.packagepoint.vo.*;
|
||||
import cn.code.nl.module.lms.dal.dataobject.packagepoint.PackagePointDO;
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.common.pojo.PageParam;
|
||||
import cn.code.nl.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.code.nl.module.lms.dal.mysql.packagepoint.PackagePointMapper;
|
||||
|
||||
import static cn.code.nl.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.code.nl.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.code.nl.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static cn.code.nl.module.lms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 装箱区点位库存 Service 实现类
|
||||
*
|
||||
* @author 诺力管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PackagePointServiceImpl implements PackagePointService {
|
||||
|
||||
@Resource
|
||||
private PackagePointMapper packagePointMapper;
|
||||
|
||||
@Override
|
||||
public Long createPackagePoint(PackagePointSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
PackagePointDO packagePoint = BeanUtils.toBean(createReqVO, PackagePointDO.class);
|
||||
packagePointMapper.insert(packagePoint);
|
||||
|
||||
// 返回
|
||||
return packagePoint.getPointId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePackagePoint(PackagePointSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validatePackagePointExists(updateReqVO.getPointId());
|
||||
// 更新
|
||||
PackagePointDO updateObj = BeanUtils.toBean(updateReqVO, PackagePointDO.class);
|
||||
packagePointMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePackagePoint(Long id) {
|
||||
// 校验存在
|
||||
validatePackagePointExists(id);
|
||||
// 删除
|
||||
packagePointMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePackagePointListByIds(List<Long> ids) {
|
||||
// 删除
|
||||
packagePointMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
private void validatePackagePointExists(Long id) {
|
||||
if (packagePointMapper.selectById(id) == null) {
|
||||
throw exception(PACKAGE_POINT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PackagePointDO getPackagePoint(Long id) {
|
||||
return packagePointMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PackagePointDO> getPackagePointPage(PackagePointPageReqVO pageReqVO) {
|
||||
return packagePointMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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.code.nl.module.lms.dal.mysql.packagepoint.PackagePointMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user