Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jackjack920 opened this issue Sep 15, 2023 · 1 comment

Comments

@jackjack920
Copy link

jackjack920 commented Sep 15, 2023

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);
}
@kazuki43zoo
Copy link
Member

@jackjack920

I cannot found a cause by only your provided information.
Could you provide a small reproduce project with your GitHub repo or attached file ?

@kazuki43zoo kazuki43zoo added dependencies Pull requests that update a dependency file waiting-feedback and removed dependencies Pull requests that update a dependency file labels Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants