package com.luozhihui.project.mapper;
import com.luozhihui.project.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface UserShowMapper {
    // 查询所有车辆信息r
    @Select("select * from  `user`")
    List<User> FindAllUser();
    //通过id查找用户信息
    @Select("select * from  `user` where `UserId`=#{UserId}")
    List<User> FindUserById(String UserId);
    //通过用户名查找用户信息
    @Select("select * from  `user` where `userName`=#{userName}")
    List<User> FindUserByuserName(String userName);
    //通过userid删除用户信息
    @Delete("delete  from  `user` where `UserId`=#{UserId}")
    boolean DeleteUserById(String phone);
    //新增用户
    @Insert("insert into `user`(`Phone`,`UserName`,`PassWord`,`IdCard`,`DriverLicense`) VALUES(#{Phone},#{UserName},#{PassWord},#{IdCard},#{DriverLicense})")
    @Transactional
    void adduser(User user);
}
