How to do Mapper multi-table association query
In this issue, Xiaobian will bring you about how to make Mapper multi-table association queries. The article is rich in content and analyzes and narrates from a professional perspective. After reading this article, I hope you can gain something.
select p.id, p.create_time, p.update_time, p.create_user, p.update_user, p.project_name, p.test_user, p.dev_user, p.simple_desc, p.other_desc, p.project_code, p.belong_env_id, p.status_id,u.status_name,u.description from projectinfo_temp p LEFT JOIN usestatus u on p.status_id = u.id2, offlink pojo@ToStringpublic class ProjectinfoTemp { private Integer id; private Date createTime; private Date updateTime; private String createUser; private String updateUser; private String projectName; private String testUser; private String devUser; private String simpleDesc; private String otherDesc; private String projectCode; private Integer belongEnvId; private Integer statusId; /** * Association Status Table Activation Status */ private Uestatus usestatus; status tables/** * * @author liwen406 * @date 2019-04-21 09:12 */@ToStringpublic class Usestatus { private Integer id; private String statusName; private String description;3 Write an associated sql statement
imitative writing
p.id, p.create_time, p.update_time, p.create_user, p.update_user, p.project_name, p.test_user,p.dev_user, p.simple_desc, p.other_desc, p.project_code, p.belong_env_id, p.status_id,u.status_name,u.description select distinct from projectinfo_temp order by ${orderByClause} select distinct from projectinfo_temp p LEFT JOIN usestatus u on p.status_id = u.id order by ${orderByClause} 4 front-end call writing Application No. application name test leader development lead Module/Interface/Use Case state operation run edit delete , [Home] [Previous] [Next] [Last Page] 5. Visit result display
The above is how to make Mapper multi-table association query shared by Xiaobian for everyone. If there is a similar doubt, please refer to the above analysis for understanding. If you want to know more about it, please pay attention to the industry information channel.