mybatis ORDER BY排序问题

来源:互联网 发布:淘宝金币可以送人吗 编辑:程序博客网 时间:2024/06/06 04:43
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >    select     <include refid="Base_Column_List" />    from tb_user    where yhbhid = #{yhbhid,jdbcType=INTEGER}
ORDER BY ${'yhbhid '} DESC  </select>

注意:用order by 排序时  要用“$”符,不能使用“#”,不解释为什么,百度有很多可以查

           “{}”里的变量一定要用单引号 '' 包起来(${'yhbhid '}

DESC:降序

ASC:升序

原创粉丝点击