<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
版權聲明:本文為博主原創文章,轉載請附上博文鏈接!