Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named

我在xml里的内容,我是写了where标签导致的,在我判断sid>0的时候就报这个错误说我没这个属性,我以为是<resultMap</resultMap>标签里的问题,但不是

<select id="findAll" resultMap="baseResultMap" >
        select * from t_scenic_sport
        
        <where>
        <if test="sid >0 ">
           and sid =#{sid}
        </if>
    	</where>
    </select>

我检查到了mapper的接口层

发现了问题

public interface xxxMapper{

        public List<某实体类> findAll(int sid);

}

这个函数没用定义参数名字所以导致的报错,下面是解决问题代码,加了@Param("sid")

public List<某实体类> findAll(@Param("sid")int sid);