1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| package com.white.dao.impl;
import com.white.dao.UserDao; import com.white.pojo.User;
public class UserDaoImpl extends BaseDao implements UserDao { @Override public User queruserByUsername(String username) { String sql = "select `id`,`username`,`password`,`call` from t_user where username = ?";
return queryForOne(User.class,sql,username); }
@Override public User queruserByUsernameAndPassword(String username, String password) { String sql = "select `id`,`username`,`password`,`call` from t_user where username = ? and password = ?";
return queryForOne(User.class,sql,username,password); }
@Override public int saveUser(User user) { String sql = "INSERT INTO `t_user`(`username`,`password`,`call`) VALUES (?,?,?);\n"; return update(sql,user.getUsername(),user.getPassword(),user.getCall()); } }
|