函数:

List<Variable>  searchVarsInNames(@Param("names") List<String> names,@Param("uid") long uid);

 

Mapper.xml:

<select id="searchVarsInNames" resultType="com.hyt.myapp.entity.Variable">

    select ....

    from ....

    where create_uid=#{uid}

    and name in

        <foreach collection="names" item="name" index="index" open="(" separator="," close=")">

            #{name}

        </foreach>

</select>

确实挺别扭的,而且注解里还不能用,只能被动适应了。

END

相关文章:

  • 2021-11-20
  • 2021-06-29
  • 2022-12-23
  • 2022-01-07
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
猜你喜欢
  • 2021-10-02
  • 2022-02-04
  • 2021-08-04
  • 2021-12-13
  • 2022-01-24
相关资源
相似解决方案