用的MyBits测试SQL没问题,但是在页面查询stauts=2(删除状态)时候会报错 ,数据库里没有这个状态的数据,坐等大神!
<!-- 分页查询 -->
<select id="findAll" parameterType="com.lyc.entity.page.AccountPage" resultType="com.lyc.entity.Account" >
select * from account
<where>
<if test="idcard_no!=null && idcard_no.length()>0">
and idcard_no=#{idcard_no}
</if>
<if test="real_name!=null && real_name.length()>0">
and real_name = #{real_name}
</if>
<if test="login_name!=null && login_name.length()>0">
and login_name = #{login_name}
</if>
<if test='status!=null && status.length()>0 && !status.equals("-1")'>
and status = #{status}
</if>
</where>
order by account_id limit #{begin}, #{pageSize}
</select>
------解决思路----------------------
报错信息是什么
<if test="idcard_no!=null && idcard_no.length()>0">
&& 这个可以写成 and
------解决思路----------------------
最好把拼接过后完整的sql语句在客户端工具里执行下,看是不是哪边写的不对或者传的值有问题
begin确认是负五?