resultMap中association標簽的select屬性使用嵌套查詢的時候需要引用其它xml文件的配置
此時可以用要引用xml的namespace.引用select的ID
如
<resultMap id="BaseResultMap" type="com.jbt.pojo.SectorStaffInfo" >
<id column="Id" property="id" jdbcType="INTEGER" />
<result column="Position" property="position" jdbcType="VARCHAR" />
<result column="Description" property="description" jdbcType="VARCHAR" />
<result column="CreateDate" property="createdate" jdbcType="VARCHAR" />
<association property="staffinfo" column="StaffInfo" select="com.jbt.dao.StaffInfoMapper.selectByPrimaryKey"/>
<association property="sectorinfo" column="SectorInfo" select="com.jbt.dao.SectorInfoMapper.selectByPrimaryKey"/>
</resultMap>
要引用staffInfo中的selectByPrimaryKey來進行嵌套查詢,則select="com.jbt.dao.StaffInfoMapper.selectByPrimaryKey"