mybatis 关于集合查询

1.ArrayList查询

select * from t_hjjk3
      <where>
          1=1
          <if test="devAddrList != null and devAddrList.size() > 0">
            AND t_hjjk3.`DevAddr` IN
            <foreach  collection="devAddrList" item="devAddr" open="("  separator=","  close=")">
              #{devAddr}
            </foreach>
          </if>
      </where>

猜你喜欢

转载自blog.csdn.net/Lei_Da_Gou/article/details/82743723