pjf преди 2 седмици
родител
ревизия
8836e18e85

+ 9 - 0
src/main/java/com/sqx/modules/car/dao/CarDao.java

@@ -0,0 +1,9 @@
+package com.sqx.modules.car.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.car.entity.Car;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface CarDao extends BaseMapper<Car> {
+}

+ 62 - 0
src/main/java/com/sqx/modules/car/entity/Car.java

@@ -0,0 +1,62 @@
+package com.sqx.modules.car.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description car
+ * @author Administrator
+ * @date 2025-5-22
+ */
+@Data
+public class Car implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 车辆id
+     */
+    @TableId(type = IdType.AUTO)
+    private Long carId;
+
+    /**
+     * 用户id
+     */
+    private Long userId;
+
+    /**
+     * 车辆品牌
+     */
+    private String carBrand;
+
+    /**
+     * 车牌
+     */
+    private String carPlate;
+
+    /**
+     * 车辆颜色
+     */
+    private String carColor;
+
+    /**
+     * 可提供的座位数
+     */
+    private Long seatNum;
+
+    /**
+     * 车辆图片
+     */
+    private String carPhoto;
+
+    /**
+     * 状态 1审核中 2使用中 3未通过
+     */
+    private Long status;
+
+}

+ 16 - 0
src/main/java/com/sqx/modules/car/service/CarService.java

@@ -0,0 +1,16 @@
+package com.sqx.modules.car.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sqx.common.utils.Result;
+import com.sqx.modules.car.entity.Car;
+import com.sqx.modules.emergencyContact.entity.EmergencyContact;
+
+public interface CarService extends IService<Car> {
+
+    Result insert(Car car);
+
+    Result updateCar(Car car);
+
+    Result deleteCar(Long carId);
+
+}

+ 34 - 0
src/main/java/com/sqx/modules/car/service/impl/CarServiceImpl.java

@@ -0,0 +1,34 @@
+package com.sqx.modules.car.service.impl;
+
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.common.utils.Result;
+import com.sqx.modules.car.dao.CarDao;
+import com.sqx.modules.car.entity.Car;
+import com.sqx.modules.car.service.CarService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+@Slf4j
+@Service
+public class CarServiceImpl extends ServiceImpl<CarDao, Car> implements CarService {
+
+
+    @Override
+    public Result insert(Car car) {
+        baseMapper.insert(car);
+        return Result.success();
+    }
+
+    @Override
+    public Result updateCar(Car car) {
+        baseMapper.updateById(car);
+        return Result.success();
+    }
+
+    @Override
+    public Result deleteCar(Long carId) {
+        baseMapper.deleteById(carId);
+        return Result.success();
+    }
+}