首页 > 代码库 > MyBatis一对多关联表查询 映射文件

MyBatis一对多关联表查询 映射文件

    <!--一对多-->    <!--根据广告组编号获取广告项列表一-->    <select id="getAdInfoByAdSysNo" resultType="ec.model.advertising.AdInfo" parameterType="int">        SELECT *  FROM T_AD_ADINFO WHERE adSysNo = #{sysNo,jdbcType=INTEGER}    </select>    <resultMap id="adSettingMoreAdInfoResultMap" type="ec.model.advertising.AdSetting">        <id column="sysNo" property="sysNo"/>        <result column="showName" property="showName"/>        <collection property="adInfo" column="sysNo" ofType="ec.model.advertising.AdInfo" select="getAdInfoByAdSysNo"/>    </resultMap>    <select id="getAdSettingMoreAdInfo" resultMap="adSettingMoreAdInfoResultMap">        SELECT *  FROM T_AD_ADSETTING WHERE sysNo = #{sysNo,jdbcType=INTEGER}    </select>

 

MyBatis一对多关联表查询 映射文件