当前位置 : 主页 > 编程语言 > c++ >

运用注解完成sql的增删改查

来源:互联网 收集:自由互联 发布时间:2021-07-03
UsersMapper.java package org.jxnd.mapper;import java.util.List;import org.apache.ibatis.annotations.Param;import org.apache.ibatis.annotations.Select;import org.jxnd.bean.Systems;import org.jxnd.bean.Users;public interface UsersMapper {//根据
UsersMapper.java
package org.jxnd.mapper;

import java.util.List;


import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jxnd.bean.Systems;
import org.jxnd.bean.Users;

public interface UsersMapper {
	//根据用户名和密码查询用户信息
	@Select("select * from users where uname=#{uname} and upassword=#{upassword}")
	Users getUserByNameAndPwd(@Param("uname")String uname,@Param("upassword")String upassword);
	//查询角色所有权限
	@Select("select * from systems where id in(select sid from rolesystems where rid=#{rid})")
	List
 
   getSystemsByRid(int rid);
}
 
网友评论