mybatis sql in not in的使用

Posted 来自于四明山的码农

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mybatis sql in not in的使用相关的知识,希望对你有一定的参考价值。

xml配置

<select id="SelectAllByNotsampleNo" resultMap="BaseResultMap" parameterType="java.lang.String">
     SELECT * FROM wshop_report1 a
     left join wshop_report_sms b on a.sampleno=b.sampleno
     where a.sampleno not in 
     <foreach item="item" index="index" collection="list" 
                         open="(" separator="," close=")">
                        #{item}
                </foreach>
  </select>

service层

@Override
    public List<WshopReport1> SelectAllByNotsampleNo(List<String> sampleno) {
        
        return reportdao.SelectAllByNotsampleNo(sampleno);
    }

list对应List    array对应数组

以上是关于mybatis sql in not in的使用的主要内容,如果未能解决你的问题,请参考以下文章

UnicodeEncodeError: ‘latin-1‘ codec can‘t encode characters in position: ordinal not in range(256)(代

Python爬虫安装 pyQuery 遇到的坑 Could not find function xmlCheckVersion in library libxml2. Is libxml2 ins(代

解决 IllegalArgumentException: Could not resolve placeholder in string value "${XXXXXX}"(示例代

windows server 2008 安装MySQL 8.0 遇到报错 1055 - Expression #1 of ORDER BY clause is not in GROUP BY(示例代

在mybatis的@Select中用not in 时

Mybatis异常There is no getter for property named 'XXX' in 'class java.lang.String'(示例代