函數:
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
