myssm
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

24 lines
758 B

package cn.star.dao;
import cn.star.domian.Users;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository//注入dao数据
//这里是创建一个数据访问层UserDao接口
public interface UsersDao {
//查询所有用户
@Select("select * from users")
public List<Users> findUsers();
//用户注册
@Insert("INSERT INTO USERS (username,password) VALUES(#{username},#{password})")
public void insertUsers(Users users);
//用户登录
@Select("select * from users where username=#{username} and password=#{password}")
public Users login(Users users);
}