spring-boot-starter icon indicating copy to clipboard operation
spring-boot-starter copied to clipboard

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

Open jackjack920 opened this issue 2 years ago • 1 comments
trafficstars

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);
}

jackjack920 avatar Sep 15 '23 08:09 jackjack920

@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 avatar Oct 23 '23 21:10 kazuki43zoo