MyBatis-返回List类型参数。

Mapper.java

public interface StorageMapper extends BaseMapper<Storage> {

	List<Integer> getStorageIdByChannelId(List<Integer> channelIds);

}

  

mapper.xml

<select id="getStorageIdByChannelId" resultType="java.lang.String">
		select 
			storage_id
		from 
		res_storage 
		<where>
			<if test="#{0} != null and #{0}.size() != 0">
				channel_id in
				<foreach item="tempId" collection="list" open="(" separator="," close=")">
    	                #{tempId}
        	    </foreach>
			</if>
         
		</where>  
		
</select>

  

resultType设置成String,myBatis会自动将结果转成List集合。

 
上一篇:临时存储 Ephemeral Storage


下一篇:SAP MM MARD 表里的Storage Bin 字段