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对应数组

文章来自:http://www.cnblogs.com/Anders888/p/7229827.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3