码迷,mamicode.com
首页 > 数据库 > 详细

sql语句

时间:2018-03-04 16:10:35      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:value   insert   where   oid   led   添加   用户信息   列表   end   

@Mapper
public interface UserMapper {
    
    //登录查询
@Select("select * from user where username=#{username} and password=#{password}")
    public User getUser(User user);

//用户列表查询
@Select("select * from user")
public List<User> getAllUsers(User user);

//删除用户信息,根据UID
@Delete("delete from user where uid=#{uid}")
public void deleteByUid(int uid);

//根据用户UID查询用户信息
@Select("select * from user where uid=#{uid}")
public User getUserByuid(int uid);

//修改用户信息
@Update("update user set username=‘${username}‘,password=‘${password}‘,"
        +" gender=‘${gender}‘,money=‘${money}‘,pledge=‘${pledge}‘,description=‘${description}‘,"
        + "age=#{age},phone=‘${phone}‘ where uid=#{uid}")
public void updateUserByUid(User user);

//删除多个用户信息
@Delete("delete from user where uid=#{uid}")
public void deleteAllUserByUid(int uid);

//添加用户
@Insert("insert into user(username,password,gender,money,pledge,description,age,phone) value"
        + "(#{username},#{password},#{password},#{money},#{pledge},#{description},#{age},#{phone})")
public void insertUser(User user);

 

sql语句

标签:value   insert   where   oid   led   添加   用户信息   列表   end   

原文地址:https://www.cnblogs.com/limin-java/p/8504648.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!