当前位置:Gxlcms > mysql > mybatis表关联查询_MySQL

mybatis表关联查询_MySQL

时间:2021-07-01 10:21:17 帮助过:21人阅读

作三张表的关联查询

cfm_requirement_vendor_date为cfm_requirement_vendor的子表

cfm_requirement_vendor为cfm_requirement的子表

一、mybatis映射文件定义

       								     																						   		

二、java类定义

1、mapper.java

List selectNestedByRequirementId(int requirementId);

2、持久化对象

public class NestedRequirement extends Requirement {    private List requirementVendorList;	public List getRequirementVendorList() {		return requirementVendorList;	}	public void setRequirementVendorList(			List requirementVendorList) {		this.requirementVendorList = requirementVendorList;	}      }

人气教程排行