映射文件如下:
<resultMap type="java.util.HashMap" id="queryListResult">
<!-- <collection property=""></collection> -->
<result property="Id" column="id"/>
<result property="Name" column="name"/>
</resultMap>
<select id="queryList" parameterType="java.util.HashMap" resultMap="queryListResult">
select id,name from test1
<where>
<if test="id!=null and !id.isEmpty()">id=#{id} </if>
<!-- <if test="id!=null and id!=''">id=#{id} </if> -->
<!-- <if test="name!=null">and name like #{name} </if> -->
<if test="name!=null">and name like concat('%',#{name},'%') </if>
</where>
</select>
无论是这个语句<if test="name!=null">and name like #{name} </if>
还是<if test="name!=null">and name like concat('%',#{name},'%') </if>
都不能查出来结果,但是单独执行能查出来结果这到底是怎么回事???用的spring4.0.6,mybatis3.3