@MapKey作用以及@MapKey is required解决方案

在引入mybatisplus插件后,mapper文件中的方法会提示 @MapKey is required 

 @MapKey的作用是在返回一个Map的时候,Map的key将映射成注解中的值的字段,从而使map变相可以作为List使用.

举例:

public class UserMapper(){

    //使用list接收
    //[{id:1111,name:"foo"},{id:2222,name:"bar"}]
    public List<User> useList();

    //使用带有@Mapkey("id")的Map<Integer,User>接收
    //{1111:{id:1111,name:"foo"},2222:{id:2222,name:"bar"}}
    @Mapkey("id")
    public Map<Integer,User> useMap();

}

该特性作为以某一字段大批量查找特别方便。

  • 19
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Preface Open Source GIS (Geographic Information Systems) is a growing area with the explosion of Google Maps-based websites and spatially-aware devices and applications. The GIS market is growing rapidly, and as a Python developer you can't afford to be left behind. In today's location-aware world, all commercial Python developers can benefit from an understanding of GIS concepts and development techniques. Working with geo-spatial data can get complicated because you are dealing with mathematical models of the Earth's surface. Since Python is a powerful programming language with high-level toolkits, it is well-suited to GIS development. This book will familiarize you with the Python tools required for geo-spatial development. It introduces GIS at the basic level with a clear, detailed walkthrough of the key GIS concepts such as location, distance, units, projections, datums, and GIS data formats. We then examine a number of Python libraries and combine these with geo-spatial data to accomplish a variety of tasks. The book provides an in-depth look at the concept of storing spatial data in a database and how you can use spatial databases as tools to solve a variety of geo-spatial problems. It goes into the details of generating maps using the Mapnik map-rendering toolkit, and helps you to build a sophisticated web-based geo-spatial map editing application using GeoDjango, Mapnik, and PostGIS. By the end of the book, you will be able to integrate spatial features into your applications and build a complete mapping application from scratch. This book is a hands-on tutorial, teaching you how to access, manipulate, and display geo-spatial data efficiently using a range of Python tools for GIS development.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值