Mybatis foreach cannot get a value of null

mybatis foreach cannot get a value

my 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=")">
                -sharp{item,jdbcType=INTEGER}
            </foreach>
        </if>
        <if test="type != null and type != """>
            AND ma.type = -sharp{type,jdbcType=VARCHAR}
        </if>
        <if test="width != null and width != 0">
            AND ma.width = -sharp{width,jdbcType=INTEGER}
        </if>
        <if test="height != null and height != 0">
            AND ma.height = -sharp{height,jdbcType=INTEGER}
        </if>
        <if test="fileSize != null and fileSize != 0">
            AND ma.fileSize <![CDATA[ <= ]]> -sharp{fileSize,jdbcType=INTEGER}
        </if>
    </select>

request object

sql


Mar.09,2021

also encountered. There is a paging plug-in, can be used is ${item}, do not need to add jdbcType


, it is a comma, replace it. Try (- sharp {item,jdbcType=INTEGER})

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3d938-2bbf9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3d938-2bbf9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?