package com.muyu.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 围栏组中间表围栏
 * @Author：yang
 * @Package：com.muyu.domain
 * @Project：cloud-server-8
 * @name：carMiddleGroup
 * @Date：2024/9/22 10:35
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Tag(name = "围栏组中间表围栏")
@TableName(value = "car_middle_group",autoResultMap = true)
public class CarMiddleGroup {

    /**
     * 中间ID
     */
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    /**
     * 围栏ID
     */
    private Integer carFenceId;
    /**
     * 围栏组
     */
    private Integer fenceGroupId;

    public CarMiddleGroup(Integer carFenceId, Integer fenceGroupId) {
        this.carFenceId = carFenceId;
        this.fenceGroupId = fenceGroupId;
    }

    public static CarMiddleGroup carMiddleGroupBuilder(CarMiddleGroup carMiddleGroup) {
        return CarMiddleGroup.builder()
                .id(carMiddleGroup.getId())
                .carFenceId(carMiddleGroup.getCarFenceId())
                .fenceGroupId(carMiddleGroup.getFenceGroupId())
                .build();
    }
}
