Skip to content

Invalid bound statement (not found): I wondered why I hadn't found it all the time, and I double-checked that both matched #880

Description

@jackjack920

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.example.forum.mapper.AdsMapper.getAdList

my xml :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.forum.mapper.AdsMapper">

    <select id="getAdList" parameterType="int" resultType="com.example.forum.dto.query.AdsQueryDTO">
        SELECT * FROM forum_ads WHERE channel_id IN (#{channelId},0) AND status = 0 ORDER BY sort DESC
    </select>

</mapper>

my dao:

package com.example.forum.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.forum.dto.query.AdsQueryDTO;
import com.example.forum.entity.Ads;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface AdsMapper extends BaseMapper<Ads> {

    List<AdsQueryDTO> getAdList(int channelId);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions