<select id="findUserByIds" parameterType="com.pojo.QueryVo" resultType="com.pojo.User">
        SELECT * from USER
      <where>
          <if test="ids !=null">
              <!--
              foreach:循环传入的集合参数
              collection:传入的集合的变量名称
              item:每次循环将循环出的数据放入这个变量中
              open循环开始拼接的字符串
              separator:循环中拼接的分隔符
              -->
              <foreach collection="ids" item="id" open="id in(" close=")" separator=",">
              #{id}
              </foreach>
          </if>
      </where>
    </select>

 

相关文章:

  • 2022-12-23
  • 2021-09-09
  • 2022-12-23
  • 2021-11-19
  • 2023-03-21
  • 2022-12-23
猜你喜欢
  • 2022-01-04
  • 2022-12-23
  • 2021-05-07
  • 2021-11-14
  • 2022-12-23
  • 2022-12-23
  • 2022-01-13
相关资源
相似解决方案