package com.muyu.enterprise.mapper;

import com.github.yulichang.base.MPJBaseMapper;
import com.muyu.domain.WarnStrategy;
import com.muyu.domain.resp.WarnStrategyAndVinResp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WarnStrategyMapper extends MPJBaseMapper<WarnStrategy> {


    @Select("SELECT vehicle.vehicle_vin, warn_strategy.warn_strategy_id, warn_strategy.vehicle_type_id, warn_strategy.message_template_id FROM vehicle LEFT JOIN warn_strategy ON vehicle.warn_strategy_id = warn_strategy.warn_strategy_id WHERE vehicle.vehicle_id = #{vehicleId}")
    List<WarnStrategyAndVinResp> findById(Long vehicleId);

}
