问题描述
- mybatis 不执行sql,什么指教请
-
<select id="queryTomId" parameterType="java.lang.String" resultType="java.lang.String"> select TOM_ID from TOM_SERVER_CFG where 1=1 <if test="ipAddr!= null and ipAddr!= ''"> AND HOST_IP = #{ipAddr} </if> </select>
输出日志:
11:04:02.942 [http-bio-8080-exec-5] DEBUG org.mybatis.spring.SqlSessionUtils - Creating a new SqlSession
11:04:02.942 [http-bio-8080-exec-5] DEBUG org.mybatis.spring.SqlSessionUtils - SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7ecc30a4] was not registered for synchronization because synchronization is not active
11:04:02.942 [http-bio-8080-exec-5] DEBUG org.mybatis.spring.SqlSessionUtils - Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7ecc30a4]程序就卡在这,也没有返回
解决方案
不知道你怎么配置的,可以看一下这个http://www.mamicode.com/info-detail-204849.html
解决方案二:
mybatis打印sql
时间: 2024-09-13 07:26:34