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 

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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM