package cn.iocoder.yudao.module.shop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.iocoder.yudao.module.shop.entity.ShopUserCar;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 用户车辆Mapper接口
 *
 * @author ruoyi
 * @date 2023-07-10
 */
@Mapper
public interface ShopUserCarMapper extends BaseMapper<ShopUserCar>
{
    /**
     * 查询用户车辆
     *
     * @param carId 用户车辆主键
     * @return 用户车辆
     */
    public ShopUserCar selectShopUserCarByCarId(Long carId);



    /**
     * 查询用户车辆列表
     *
     * @param shopUserCar 用户车辆
     * @return 用户车辆集合
     */
    public IPage<ShopUserCar> selectShopUserCarList(Page<ShopUserCar> page, @Param("vo") ShopUserCar shopUserCar);

    /**
     * 新增用户车辆
     *
     * @param shopUserCar 用户车辆
     * @return 结果
     */
    public int insertShopUserCar(ShopUserCar shopUserCar);

    /**
     * 修改用户车辆
     *
     * @param shopUserCar 用户车辆
     * @return 结果
     */
    public int updateShopUserCar(ShopUserCar shopUserCar);

    /**
     * 删除用户车辆
     *
     * @param carId 用户车辆主键
     * @return 结果
     */
    public int deleteShopUserCarByCarId(Long carId);

    /**
     * 批量删除用户车辆
     *
     * @param carIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteShopUserCarByCarIds(Long[] carIds);

    public ShopUserCar selectShopUserCarByUserId(Long userId);

    List<ShopUserCar> selectUserCarsByUserId(Long userId);
    List<ShopUserCar> getDbCars(Long userId);

    ShopUserCar selectUserCarsByUserIdCarNum(@Param("userId") Long userId,@Param("carNum") String carNum);

    void deleteShopUserCarByUserId(Long userId);
}
