为了账号安全,请及时绑定邮箱和手机立即绑定

查询全部数据都出来了,就是条件查询没有数据,怎么回事啊

查询全部数据都出来了,就是条件查询没有数据,怎么回事啊

qq_i_18 2017-05-26 18:46:08
<mapper namespace="Message">   <resultMap type="com.ljm.java.entity.Message" id="MessageResult">     <id column="ID" jdbcType="INTEGER" property="id"/>     <result column="COMMAND" jdbcType="VARCHAR" property="command"/>     <result column="DESCRIPTION" jdbcType="VARCHAR" property="description"/>     <result column="CONTENT" jdbcType="VARCHAR" property="content"/>   </resultMap>   <select id="queryMessageList" parameterType="com.ljm.java.entity.Message" resultMap="MessageResult">     select ID,COMMAND,DESCRIPTION,CONTENT from MESSAGE     <where>      <if test="command != null and !&quot;&quot;.equals(command.trim())">      and COMMAND like '%' #{command}'%'     </if>     <if test="description != null and !&quot;&quot;.equals(description.trim())">      and DESCRIPTION like '%' #{description} '%'      </if>     </where>   </select>
查看完整描述

1 回答

?
qq_飘随风_0

TA贡献1条经验 获得超1个赞

你的sql写错了   like  ‘%  #{command} %'  你那里多了两个分号

查看完整回答
1 反对 回复 2017-05-27
  • 1 回答
  • 0 关注
  • 1651 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信