$ select * from a where id = ${recId} 最后生成的SQL为: 1select * from a where id = 1 即:直接将参数值替换到了原来${recId}的位置,相当于硬拼SQL # select * from a where id = #{recid} 最后生成的SQL为: select * from a where id = ? 即:#{...}被识别为一个SQL参数