答:
Mapper接口定义一个方法
List<String> selectValue(@Param("oneLevels") List<Long> oneLevels, @Param("twoLevels") List<Long> twoLevels, @Param("threeLevels") List<Long> threeLevels, @Param("savaTime") Date savaTime);
XML 里面SQL可以这样写
select value from tablename
WHERE one_level in
<foreach collection="oneLevels" item="oneLevel" separator="," open="(" close=")">
#{onLevel}
</foreach>
and two_level in
<foreach collection="twoLevels" item="twoLevel" separator="," open="(" close=")">
#{twoLevel}
</foreach>
and three_level in
<foreach collection="threeLevels" item="threeLevel" separator="," open="(" close=")">
#{threeLevel}
</foreach>
and save_time= #{saveTime}