Invalid bound statement (not found): com.aaa.mapper.PaisanMapper.findAllJiang

Posted 慕斯-ing

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Invalid bound statement (not found): com.aaa.mapper.PaisanMapper.findAllJiang相关的知识,希望对你有一定的参考价值。

报错内容: Invalid bound statement (not found): com.aaa.mapper.PaisanMapper.findAllJiang


一直报这个错误,导致界面的数据无法加载出来,后来定位发现,原来是mapper.java与mapper.xml没有对应起来的原因。

修改内容:
PaisanMapper.java

package com.aaa.mapper;
import com.aaa.entity.Jiang;
import com.aaa.entity.Paisan;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface PaisanMapper 
    List<Paisan> findAllPaisan(Paisan paisan);
    int editPaisan(Paisan paisan);
    List<Jiang> findAllJiang();
    int insertPaisan(Paisan paisan);
    int count(Integer Id);

PaisanMapper.xml(原)

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.aaa.mapper.PaibanMapper">
     <select id="findAllPaiban" resultType="paiban">
     select d.doctorId doctorId,d.doctorName  doctorName, p.one one,p.two two,p.three three,p.four four,p.five five,p.six six,p.seven seven from doctor d LEFT JOIN paiban p on  p.doctorId=d.doctorId where d.dstate!=3
      <where>
       <if test="doctorName!=null and doctorName!=''">
        doctorName like concat('%' ,concat(#doctorName,'%'))
       </if>
      </where> order by d.doctorId desc
     </select>

     <update id="editPaiban" parameterType="paiban">
      update paiban set one=#one,two=#two,three=#three,four=#four,five=#five,six=#six,seven=#seven where doctorId=#doctorId
     </update>

    <select id="findAllBan" resultType="ban">
        select*from ban
    </select>

    <insert id="insertPaiban" parameterType="paiban">
        insert into paiban (one,two,three,four,five,six,seven,doctorId)values (#one,#two,#three,#four,#five,#six,#seven,#doctorId)
    </insert>

    <select id="count" resultType="Integer">
        select count(doctorId) from paiban where doctorId=#Id
    </select>
</mapper>

PaisanMapper.xml(现)

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.aaa.mapper.PaisanMapper">
     <select id="findAllPaisan" resultType="paisan">
        select d.doctorId doctorId,d.doctorName  doctorName, p.one one,p.two two,p.three three,p.four four,p.five five,p.six six,p.seven seven from doctor d LEFT JOIN paisan p on  p.doctorId=d.doctorId where d.dstate!=3
          <where>
               <if test="doctorName!=null and doctorName!=''">
                doctorName like concat('%' ,concat(#doctorName,'%'))
               </if>
          </where> order by d.doctorId desc
     </select>

     <update id="editPaisan" parameterType="paisan">
      update paisan set one=#one,two=#two,three=#three,four=#four,five=#five,six=#six,seven=#seven where doctorId=#doctorId
     </update>

    <select id="findAllJiang" resultType="jiang">
        select*from jiang
    </select>

    <insert id="insertPaisan" parameterType="paisan">
        insert into paisan (one,two,three,four,five,six,seven,doctorId)values (#one,#two,#three,#four,#five,#six,#seven,#doctorId)
    </insert>

    <select id="count" resultType="Integer">
        select count(doctorId) from paisan where doctorId=#Id
    </select>
</mapper>

数据展示出现:

以上是关于Invalid bound statement (not found): com.aaa.mapper.PaisanMapper.findAllJiang的主要内容,如果未能解决你的问题,请参考以下文章

Invalid bound statement not found

Invalid bound statement (not found) 错误原因

报错 Invalid bound statement (not found): com.xxx.mapper.xxx

Invalid bound statement (not found)

Mybatis 异常记录: Invalid bound statement (not found)

mybatis错误:Invalid bound statement (not found)