Sql中可将重复的sql提取出来,使用时用include引用即可,最终达到sql重用的目的,如下: <select id="findUserByNameAndSex" parameterType="com.huida.po.User" resultType="com.huida.po.User"> <!-- select * from user where 1=1 and username like "%${usern…
/* Preparing: SELECT * FROM tb_user WHERE id = ? AND user_name = ? 目标是打印:SELECT * FROM tb_user WHERE id = 1000059081 AND user_name = '积极'*/ 这部分代码只是拦截了查询和更新,如果想对其他语句进行拦截,在@Intercepts中添加对应方法即可 package dao.Interceptor; import org.apache.commons.collect…