企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## Json自动映射 如果查询结果集跟java类定义匹配,则不需要显示的json配置,可以AutoJsonMapper ```java @Data @ResultProvider(AutoJsonMapper.class) public class MyUserView { Integer id; String name; DepartmentEntity dept; } ``` 如上配置,可以自动映射如下查询结果 ```java String sql = "select u.id ,u.name ,d.id `dept.id`,d.name `dept.name` " + " from sys_user u left join department d on d.id=u.department_id"; SQLReady ready = new SQLReady(sql); List<MyUserView> list = sqlManager.execute(ready,MyUserView.class); ``` 之所以成为AutoJsonMapper,是因为AutoJsonMapper会解析POJO类,生成一个json配置,类似如下 ```json { "id":"id", "name":"name", "dept": { "id":"dept.id", "name":"dept.name" } } ```