mybatis include refid="Base_Column_List"含义

<sql id="Base_Column_List" >

        collegeID, collegeName

</sql> 

 

<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >

       select 

        <include refid="Base_Column_List" />

        from t_notification_template

       where id = #{id,jdbcType=BIGINT}

 </select>

 <include refid="Base_Column_List" /> 这个在MyBatis查询数据库的sql中经常会出现。它的在上面已经定义,作用相当于 * ,

 

Base_Column_List是固定的几个字段,而用*号的话会降低查询效率,因为后期数据库的字段会不断增加。

--------------------- 

作者:ShirleyQueen321 

来源:CSDN 

原文:https://blog.csdn.net/weixin_40569991/article/details/88724739 

版权声明:本文为博主原创文章,转载请附上博文链接!

posted @ 2019-07-22 18:00  zzfx  阅读(3185)  评论(1编辑  收藏  举报