只需在mybatis的configuration 下添加一句话
<settings> <!-- 打印查询语句 --> <setting name="logImpl" value="STDOUT_LOGGING" /> </settings>