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"