package com.cpxt.biz.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cpxt.biz.domain.BizCar;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * 车辆Mapper接口
 * 
 * @author YIN
 * @date 2024-12-16
 */
@Mapper
public interface BizCarMapper extends BaseMapper<BizCar>
{
    @Update("create table ${tableName} as select * from track_temp")
    void createTable(String tableName);

    @Update("ALTER TABLE ${tableName} MODIFY COLUMN id INT NOT NULL AUTO_INCREMENT")
    void setAutoIncrement(String tableName);

    @Update("ALTER TABLE ${tableName} ADD PRIMARY KEY (id)")
    void addPrimaryKey(String tableName);

    @Select("select * from biz_car where car_no = #{carNo}")
    BizCar selectByCarNo(String carNo);

}
