sql如何遍历后台传过来的List

mybatis的xml配置文件中的sql遍历后台传过来的String类型的List如下,其中productCodes是后台穿过来的String类型的List
  	<select id="selectByProductCodes" resultType="com.***.***.***.***.entity.P2pBasicInformation">
		SELECT * FROM 表名
		<where>
			productCode in (
			<foreach collection="productCodes" item="productCode" separator=",">
				#{productCode}
			</foreach>
			)
		</where>
	</select>

你可能感兴趣的:(sql如何遍历后台传过来的List)