mybatis foreach 取不到值
我的sql
<select id="findByCustomerId" resultMap="BaseResultMap">
SELECT ma.* FROM media_material_relation mr,media_material ma
WHERE mr.material_id = ma.material_id
<if test="customerIds != null">
AND mr.customer_id IN
<foreach item="item" index="index" collection="customerIds" open="(" separator="," close=")">
#{item,jdbcType=INTEGER}
</foreach>
</if>
<if test="type != null and type != ''">
AND ma.type = #{type,jdbcType=VARCHAR}
</if>
<if test="width != null and width != 0">
AND ma.width = #{width,jdbcType=INTEGER}
</if>
<if test="height != null and height != 0">
AND ma.height = #{height,jdbcType=INTEGER}
</if>
<if test="fileSize != null and fileSize != 0">
AND ma.fileSize <![CDATA[ <= ]]> #{fileSize,jdbcType=INTEGER}
</if>
</select>
请求对象
sql语句打印
为啥取不到值呢?
,是逗号吧,换成.试试(#{item,jdbcType=INTEGER})