package com.hai.dao;

import com.hai.entity.HighUserEtc;
import com.hai.entity.HighUserEtcExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;

/**
 * 
 * 代码由工具生成,请勿修改!!!
 * 如果需要扩展请在其父类进行扩展
 * 
 **/
@Repository
public interface HighUserEtcMapper extends HighUserEtcMapperExt {
    @SelectProvider(type=HighUserEtcSqlProvider.class, method="countByExample")
    long countByExample(HighUserEtcExample example);

    @DeleteProvider(type=HighUserEtcSqlProvider.class, method="deleteByExample")
    int deleteByExample(HighUserEtcExample example);

    @Delete({
        "delete from high_user_etc",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into high_user_etc (user_id, vehicle_id, ",
        "vehicle_plate, customer_name, ",
        "customer_tel, create_time, ",
        "`status`, ext_1, ext_2, ",
        "ext_3)",
        "values (#{userId,jdbcType=BIGINT}, #{vehicleId,jdbcType=VARCHAR}, ",
        "#{vehiclePlate,jdbcType=VARCHAR}, #{customerName,jdbcType=VARCHAR}, ",
        "#{customerTel,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
        "#{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(HighUserEtc record);

    @InsertProvider(type=HighUserEtcSqlProvider.class, method="insertSelective")
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insertSelective(HighUserEtc record);

    @SelectProvider(type=HighUserEtcSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="vehicle_id", property="vehicleId", jdbcType=JdbcType.VARCHAR),
        @Result(column="vehicle_plate", property="vehiclePlate", jdbcType=JdbcType.VARCHAR),
        @Result(column="customer_name", property="customerName", jdbcType=JdbcType.VARCHAR),
        @Result(column="customer_tel", property="customerTel", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
    })
    List<HighUserEtc> selectByExample(HighUserEtcExample example);

    @Select({
        "select",
        "id, user_id, vehicle_id, vehicle_plate, customer_name, customer_tel, create_time, ",
        "`status`, ext_1, ext_2, ext_3",
        "from high_user_etc",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="vehicle_id", property="vehicleId", jdbcType=JdbcType.VARCHAR),
        @Result(column="vehicle_plate", property="vehiclePlate", jdbcType=JdbcType.VARCHAR),
        @Result(column="customer_name", property="customerName", jdbcType=JdbcType.VARCHAR),
        @Result(column="customer_tel", property="customerTel", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
    })
    HighUserEtc selectByPrimaryKey(Integer id);

    @UpdateProvider(type=HighUserEtcSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") HighUserEtc record, @Param("example") HighUserEtcExample example);

    @UpdateProvider(type=HighUserEtcSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") HighUserEtc record, @Param("example") HighUserEtcExample example);

    @UpdateProvider(type=HighUserEtcSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(HighUserEtc record);

    @Update({
        "update high_user_etc",
        "set user_id = #{userId,jdbcType=BIGINT},",
          "vehicle_id = #{vehicleId,jdbcType=VARCHAR},",
          "vehicle_plate = #{vehiclePlate,jdbcType=VARCHAR},",
          "customer_name = #{customerName,jdbcType=VARCHAR},",
          "customer_tel = #{customerTel,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "`status` = #{status,jdbcType=INTEGER},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(HighUserEtc record);
}