<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]
程序就卡在这,也没有返回