1. 程式人生 > >mybatis sql in not in的使用

mybatis sql in not in的使用

col item select lis log div ots sel index

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的使用