1.引入fastjson依赖
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.47</version>
</dependency>
Map<String, Object> paramMap=new HashMap<>;
~~~
String mapString = JSONObject.toJSONString(paramMap);
User hospital = JSONObject.parseObject(mapString, Hospital.class);