package com.muyu.enterpise.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.domain.CarFence;
import com.muyu.domain.CarMiddle;
import com.muyu.domain.CarAndGroupMiddle;
import com.muyu.domain.FenceGroup;
import com.muyu.domain.req.CarFenceGroup;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 围栏服务Mybatis映射器
 *  * @Author：yan
 *  * @Package：com.muyu.car.mapper
 *  * @Project：plues
 *  * @name：CarFenceServiceMybaitsMapper
 *  * @Date：2024/9/22 19:25
 */
@Mapper
public interface CarFenceServiceMybaitsMapper extends BaseMapper<CarMiddle> {

    void fenceAdd(CarFenceGroup carFence);

    Integer addGroup(@Param("fenceGroupId") Integer fenceGroupId, @Param("integer") Integer integer);

    /**
     * 添加多对多围栏组
     * @param fenceGroupId
     * @param
     */
    Integer addFenceGroup(@Param("fenceGroupId") Integer fenceGroupId, @Param("id") Integer id);


    /**
     * 根据围栏组的id查询绑定的围栏的中间表
     * @param groupId
     * @return
     */
    List<CarMiddle> BoundFenceGroup(@Param("groupId") Integer groupId);

    /**
     * 查询围栏组绑定的围栏列表
     *
     * @param carFenceId 参数
     * @return
     */
    CarFence selectBoundCarFenceList(@Param("carFenceId") Integer carFenceId);

    /**
     * 根据围栏组和车辆的id添加中间表
     * @param id
     * @param groupId
     */
    void addFenceGroupAddCarMiddle(@Param("id") Integer id, @Param("groupId") Long groupId);

    /**
     * 获取绑定的围栏组
     * @param carId
     * @return
     */
    List<CarAndGroupMiddle> selectBoundGFenceGroup(@Param("carId") Integer carId);

    /**
     * 获取围栏组的数据
     * @param carGroupId 参数
     * @return
     */
    FenceGroup selectGroup(@Param("carGroupId") Long carGroupId);
}
