xinwei #3
@ -19,4 +19,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode BLACKLIST_DELIVERY_NOT_EXISTS = new ErrorCode(1_005_001_010, "黑名单配置不存在");
|
||||
// ========== 蓝卡心跳 1_005_001_011 ==========
|
||||
ErrorCode BLUE_CARD_HEARTBEAT_NOT_EXISTS = new ErrorCode(1_005_001_011, "蓝卡心跳不存在");
|
||||
// ========== 固定车续费记录 1_005_001_012 ==========
|
||||
ErrorCode FIXED_VEHICLE_RENEWAL_RECORD_NOT_EXISTS = new ErrorCode(1_005_001_012, "固定车续费记录不存在");
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.fixedvehiclerenewalrecord;
|
||||
|
||||
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.parking.controller.admin.fixedvehiclerenewalrecord.vo.*;
|
||||
import cn.iocoder.yudao.module.parking.dal.dataobject.fixedvehiclerenewalrecord.FixedVehicleRenewalRecordDO;
|
||||
import cn.iocoder.yudao.module.parking.service.fixedvehiclerenewalrecord.FixedVehicleRenewalRecordService;
|
||||
|
||||
@Tag(name = "管理后台 - 固定车续费记录")
|
||||
@RestController
|
||||
@RequestMapping("/parking/fixed-vehicle-renewal-record")
|
||||
@Validated
|
||||
public class FixedVehicleRenewalRecordController {
|
||||
|
||||
@Resource
|
||||
private FixedVehicleRenewalRecordService fixedVehicleRenewalRecordService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建固定车续费记录")
|
||||
@PreAuthorize("@ss.hasPermission('parking:fixed-vehicle-renewal-record:create')")
|
||||
public CommonResult<Long> createFixedVehicleRenewalRecord(@Valid @RequestBody FixedVehicleRenewalRecordSaveReqVO createReqVO) {
|
||||
return success(fixedVehicleRenewalRecordService.createFixedVehicleRenewalRecord(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新固定车续费记录")
|
||||
@PreAuthorize("@ss.hasPermission('parking:fixed-vehicle-renewal-record:update')")
|
||||
public CommonResult<Boolean> updateFixedVehicleRenewalRecord(@Valid @RequestBody FixedVehicleRenewalRecordSaveReqVO updateReqVO) {
|
||||
fixedVehicleRenewalRecordService.updateFixedVehicleRenewalRecord(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除固定车续费记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('parking:fixed-vehicle-renewal-record:delete')")
|
||||
public CommonResult<Boolean> deleteFixedVehicleRenewalRecord(@RequestParam("id") Long id) {
|
||||
fixedVehicleRenewalRecordService.deleteFixedVehicleRenewalRecord(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得固定车续费记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('parking:fixed-vehicle-renewal-record:query')")
|
||||
public CommonResult<FixedVehicleRenewalRecordRespVO> getFixedVehicleRenewalRecord(@RequestParam("id") Long id) {
|
||||
FixedVehicleRenewalRecordDO fixedVehicleRenewalRecord = fixedVehicleRenewalRecordService.getFixedVehicleRenewalRecord(id);
|
||||
return success(BeanUtils.toBean(fixedVehicleRenewalRecord, FixedVehicleRenewalRecordRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得固定车续费记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('parking:fixed-vehicle-renewal-record:query')")
|
||||
public CommonResult<PageResult<FixedVehicleRenewalRecordRespVO>> getFixedVehicleRenewalRecordPage(@Valid FixedVehicleRenewalRecordPageReqVO pageReqVO) {
|
||||
PageResult<FixedVehicleRenewalRecordDO> pageResult = fixedVehicleRenewalRecordService.getFixedVehicleRenewalRecordPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, FixedVehicleRenewalRecordRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出固定车续费记录 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('parking:fixed-vehicle-renewal-record:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportFixedVehicleRenewalRecordExcel(@Valid FixedVehicleRenewalRecordPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<FixedVehicleRenewalRecordDO> list = fixedVehicleRenewalRecordService.getFixedVehicleRenewalRecordPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "固定车续费记录.xls", "数据", FixedVehicleRenewalRecordRespVO.class,
|
||||
BeanUtils.toBean(list, FixedVehicleRenewalRecordRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.fixedvehiclerenewalrecord.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 FixedVehicleRenewalRecordPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "场库编号")
|
||||
private String parkNumber;
|
||||
|
||||
@Schema(description = "接口名称")
|
||||
private String method;
|
||||
|
||||
@Schema(description = "集合大小")
|
||||
private Integer size;
|
||||
|
||||
@Schema(description = "车牌")
|
||||
private String plate;
|
||||
|
||||
@Schema(description = "固定车组名称", example = "王五")
|
||||
private String carGroupName;
|
||||
|
||||
@Schema(description = "支付时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] payTime;
|
||||
|
||||
@Schema(description = "续费金额")
|
||||
private String payCharge;
|
||||
|
||||
@Schema(description = "车位号")
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "续费时长")
|
||||
private String feeMonth;
|
||||
|
||||
@Schema(description = "过期日期")
|
||||
private String end;
|
||||
|
||||
@Schema(description = "续费订单号", example = "29452")
|
||||
private String placeFeeOrderRecId;
|
||||
|
||||
@Schema(description = "车主名称", example = "张三")
|
||||
private String carOwnerName;
|
||||
|
||||
@Schema(description = "支付类型", example = "2")
|
||||
private String payType;
|
||||
|
||||
@Schema(description = "支付流水号")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.fixedvehiclerenewalrecord.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
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 FixedVehicleRenewalRecordRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "4513")
|
||||
@ExcelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("场库编号")
|
||||
private String parkNumber;
|
||||
|
||||
@Schema(description = "接口名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("接口名称")
|
||||
private String method;
|
||||
|
||||
@Schema(description = "集合大小")
|
||||
@ExcelProperty("集合大小")
|
||||
private Integer size;
|
||||
|
||||
@Schema(description = "车牌")
|
||||
@ExcelProperty("车牌")
|
||||
private String plate;
|
||||
|
||||
@Schema(description = "固定车组名称", example = "王五")
|
||||
@ExcelProperty("固定车组名称")
|
||||
private String carGroupName;
|
||||
|
||||
@Schema(description = "支付时间")
|
||||
@ExcelProperty("支付时间")
|
||||
private String payTime;
|
||||
|
||||
@Schema(description = "续费金额")
|
||||
@ExcelProperty("续费金额")
|
||||
private String payCharge;
|
||||
|
||||
@Schema(description = "车位号")
|
||||
@ExcelProperty("车位号")
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "续费时长")
|
||||
@ExcelProperty("续费时长")
|
||||
private String feeMonth;
|
||||
|
||||
@Schema(description = "过期日期")
|
||||
@ExcelProperty("过期日期")
|
||||
private String end;
|
||||
|
||||
@Schema(description = "续费订单号", example = "29452")
|
||||
@ExcelProperty("续费订单号")
|
||||
private String placeFeeOrderRecId;
|
||||
|
||||
@Schema(description = "车主名称", example = "张三")
|
||||
@ExcelProperty("车主名称")
|
||||
private String carOwnerName;
|
||||
|
||||
@Schema(description = "支付类型", example = "2")
|
||||
@ExcelProperty("支付类型")
|
||||
private String payType;
|
||||
|
||||
@Schema(description = "支付流水号")
|
||||
@ExcelProperty("支付流水号")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.parking.controller.admin.fixedvehiclerenewalrecord.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 FixedVehicleRenewalRecordSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "4513")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "场库编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "场库编号不能为空")
|
||||
private String parkNumber;
|
||||
|
||||
@Schema(description = "接口名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "接口名称不能为空")
|
||||
private String method;
|
||||
|
||||
@Schema(description = "集合大小")
|
||||
private Integer size;
|
||||
|
||||
@Schema(description = "车牌")
|
||||
private String plate;
|
||||
|
||||
@Schema(description = "固定车组名称", example = "王五")
|
||||
private String carGroupName;
|
||||
|
||||
@Schema(description = "支付时间")
|
||||
private String payTime;
|
||||
|
||||
@Schema(description = "续费金额")
|
||||
private String payCharge;
|
||||
|
||||
@Schema(description = "车位号")
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "续费时长")
|
||||
private String feeMonth;
|
||||
|
||||
@Schema(description = "过期日期")
|
||||
private String end;
|
||||
|
||||
@Schema(description = "续费订单号", example = "29452")
|
||||
private String placeFeeOrderRecId;
|
||||
|
||||
@Schema(description = "车主名称", example = "张三")
|
||||
private String carOwnerName;
|
||||
|
||||
@Schema(description = "支付类型", example = "2")
|
||||
private String payType;
|
||||
|
||||
@Schema(description = "支付流水号")
|
||||
private String orderNo;
|
||||
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package cn.iocoder.yudao.module.parking.dal.dataobject.fixedvehiclerenewalrecord;
|
||||
|
||||
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("fixed_vehicle_renewal_record")
|
||||
@KeySequence("fixed_vehicle_renewal_record_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class FixedVehicleRenewalRecordDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 场库编号
|
||||
*/
|
||||
private String parkNumber;
|
||||
/**
|
||||
* 接口名称
|
||||
*/
|
||||
private String method;
|
||||
/**
|
||||
* 集合大小
|
||||
*/
|
||||
private Integer size;
|
||||
/**
|
||||
* 车牌
|
||||
*/
|
||||
private String plate;
|
||||
/**
|
||||
* 固定车组名称
|
||||
*/
|
||||
private String carGroupName;
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
private String payTime;
|
||||
/**
|
||||
* 续费金额
|
||||
*/
|
||||
private String payCharge;
|
||||
/**
|
||||
* 车位号
|
||||
*/
|
||||
private Integer number;
|
||||
/**
|
||||
* 续费时长
|
||||
*/
|
||||
private String feeMonth;
|
||||
/**
|
||||
* 过期日期
|
||||
*/
|
||||
private String end;
|
||||
/**
|
||||
* 续费订单号
|
||||
*/
|
||||
private String placeFeeOrderRecId;
|
||||
/**
|
||||
* 车主名称
|
||||
*/
|
||||
private String carOwnerName;
|
||||
/**
|
||||
* 支付类型
|
||||
*/
|
||||
private String payType;
|
||||
/**
|
||||
* 支付流水号
|
||||
*/
|
||||
private String orderNo;
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.parking.dal.mysql.fixedvehiclerenewalrecord;
|
||||
|
||||
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.parking.dal.dataobject.fixedvehiclerenewalrecord.FixedVehicleRenewalRecordDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.parking.controller.admin.fixedvehiclerenewalrecord.vo.*;
|
||||
|
||||
/**
|
||||
* 固定车续费记录 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface FixedVehicleRenewalRecordMapper extends BaseMapperX<FixedVehicleRenewalRecordDO> {
|
||||
|
||||
default PageResult<FixedVehicleRenewalRecordDO> selectPage(FixedVehicleRenewalRecordPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<FixedVehicleRenewalRecordDO>()
|
||||
.eqIfPresent(FixedVehicleRenewalRecordDO::getParkNumber, reqVO.getParkNumber())
|
||||
.eqIfPresent(FixedVehicleRenewalRecordDO::getMethod, reqVO.getMethod())
|
||||
.eqIfPresent(FixedVehicleRenewalRecordDO::getSize, reqVO.getSize())
|
||||
.eqIfPresent(FixedVehicleRenewalRecordDO::getPlate, reqVO.getPlate())
|
||||
.likeIfPresent(FixedVehicleRenewalRecordDO::getCarGroupName, reqVO.getCarGroupName())
|
||||
.betweenIfPresent(FixedVehicleRenewalRecordDO::getPayTime, reqVO.getPayTime())
|
||||
.eqIfPresent(FixedVehicleRenewalRecordDO::getPayCharge, reqVO.getPayCharge())
|
||||
.eqIfPresent(FixedVehicleRenewalRecordDO::getNumber, reqVO.getNumber())
|
||||
.eqIfPresent(FixedVehicleRenewalRecordDO::getFeeMonth, reqVO.getFeeMonth())
|
||||
.eqIfPresent(FixedVehicleRenewalRecordDO::getEnd, reqVO.getEnd())
|
||||
.eqIfPresent(FixedVehicleRenewalRecordDO::getPlaceFeeOrderRecId, reqVO.getPlaceFeeOrderRecId())
|
||||
.likeIfPresent(FixedVehicleRenewalRecordDO::getCarOwnerName, reqVO.getCarOwnerName())
|
||||
.eqIfPresent(FixedVehicleRenewalRecordDO::getPayType, reqVO.getPayType())
|
||||
.eqIfPresent(FixedVehicleRenewalRecordDO::getOrderNo, reqVO.getOrderNo())
|
||||
.betweenIfPresent(FixedVehicleRenewalRecordDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(FixedVehicleRenewalRecordDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.parking.service.fixedvehiclerenewalrecord;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.parking.controller.admin.fixedvehiclerenewalrecord.vo.*;
|
||||
import cn.iocoder.yudao.module.parking.dal.dataobject.fixedvehiclerenewalrecord.FixedVehicleRenewalRecordDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 固定车续费记录 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface FixedVehicleRenewalRecordService {
|
||||
|
||||
/**
|
||||
* 创建固定车续费记录
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createFixedVehicleRenewalRecord(@Valid FixedVehicleRenewalRecordSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新固定车续费记录
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateFixedVehicleRenewalRecord(@Valid FixedVehicleRenewalRecordSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除固定车续费记录
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteFixedVehicleRenewalRecord(Long id);
|
||||
|
||||
/**
|
||||
* 获得固定车续费记录
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 固定车续费记录
|
||||
*/
|
||||
FixedVehicleRenewalRecordDO getFixedVehicleRenewalRecord(Long id);
|
||||
|
||||
/**
|
||||
* 获得固定车续费记录分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 固定车续费记录分页
|
||||
*/
|
||||
PageResult<FixedVehicleRenewalRecordDO> getFixedVehicleRenewalRecordPage(FixedVehicleRenewalRecordPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.parking.service.fixedvehiclerenewalrecord;
|
||||
|
||||
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.parking.controller.admin.fixedvehiclerenewalrecord.vo.*;
|
||||
import cn.iocoder.yudao.module.parking.dal.dataobject.fixedvehiclerenewalrecord.FixedVehicleRenewalRecordDO;
|
||||
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.parking.dal.mysql.fixedvehiclerenewalrecord.FixedVehicleRenewalRecordMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.parking.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 固定车续费记录 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class FixedVehicleRenewalRecordServiceImpl implements FixedVehicleRenewalRecordService {
|
||||
|
||||
@Resource
|
||||
private FixedVehicleRenewalRecordMapper fixedVehicleRenewalRecordMapper;
|
||||
|
||||
@Override
|
||||
public Long createFixedVehicleRenewalRecord(FixedVehicleRenewalRecordSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
FixedVehicleRenewalRecordDO fixedVehicleRenewalRecord = BeanUtils.toBean(createReqVO, FixedVehicleRenewalRecordDO.class);
|
||||
fixedVehicleRenewalRecordMapper.insert(fixedVehicleRenewalRecord);
|
||||
// 返回
|
||||
return fixedVehicleRenewalRecord.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFixedVehicleRenewalRecord(FixedVehicleRenewalRecordSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateFixedVehicleRenewalRecordExists(updateReqVO.getId());
|
||||
// 更新
|
||||
FixedVehicleRenewalRecordDO updateObj = BeanUtils.toBean(updateReqVO, FixedVehicleRenewalRecordDO.class);
|
||||
fixedVehicleRenewalRecordMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteFixedVehicleRenewalRecord(Long id) {
|
||||
// 校验存在
|
||||
validateFixedVehicleRenewalRecordExists(id);
|
||||
// 删除
|
||||
fixedVehicleRenewalRecordMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateFixedVehicleRenewalRecordExists(Long id) {
|
||||
if (fixedVehicleRenewalRecordMapper.selectById(id) == null) {
|
||||
throw exception(FIXED_VEHICLE_RENEWAL_RECORD_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public FixedVehicleRenewalRecordDO getFixedVehicleRenewalRecord(Long id) {
|
||||
return fixedVehicleRenewalRecordMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<FixedVehicleRenewalRecordDO> getFixedVehicleRenewalRecordPage(FixedVehicleRenewalRecordPageReqVO pageReqVO) {
|
||||
return fixedVehicleRenewalRecordMapper.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.iocoder.yudao.module.parking.dal.mysql.fixedvehiclerenewalrecord.FixedVehicleRenewalRecordMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user