#sqlmapper <resultMap id="BaseResultMap" type="com.LogEntity" > <result column="ID" property="ID" /> <result column="content_md5" property="contentMd5" /> </resultMap> <select id="queryByIds" resultMap="BaseResultMap"> SELECT * FROM `log` WHERE id IN <foreach item="id" index="index" collection="ids" open="(" separator="," close=")"> #{id,jdbcType=INTEGER} </foreach> </select> #接口 public interface LogMapper { List<LogEntity> queryByIds(@Param("ids") Set<Integer> ids); } #实体类 public class LogEntity { /** * ID */ private Integer ID; private String contentMd5; }
标签:Set,private,id,mybatis,查询,public From: https://www.cnblogs.com/oktokeep/p/16639246.html