/这是一个操作数据库的方法1
//@Mapper
//public interface AdminMapper {
//根据id来查询数据
//@Select("select * from admin where admin_id=#{adminId}")
//public Admin getAdminByadminId(Integer adminId);
//删除 返回多少行
//@Delete("delete from admin where admin_id=#{adminId}")
//public int deleteAdminByadminId(Integer adminId);
//插入 返回多少行
//@Options(useGeneratedKeys = true,keyProperty = "adminId") //主键
//@Insert("insert into admin(admin_name,admin_password,admin_authority_status,admin_create_time) values(#{adminName,adminPassword,adminAuthorityStatus,adminCreateTime})")
//public int insertAdmin(Admin admin);
//更新
//@Update("update admin set admin_name=#{adminName} where admin_id=#{adminId}")
//public int updateAdmin(Admin admin);
//}
//这是一个操作数据库的方法2
@Mapper
public interface AdminMapper {
public Admin getAdminByadminId(Integer adminId);
}
mapper
最新推荐文章于 2022-01-19 22:59:41 发布