继续上一篇文章,myibatis传入多参数,有一个list,其中length报错,没有该方法,改为size

来源:互联网 发布:手机去热软件 编辑:程序博客网 时间:2024/04/27 14:44


    <select id="getEmployeesMapParams" resultType="Employees">
        select *
        from EMPLOYEES e
        <where>
            <if test="departmentId!=null and departmentId!=''">
                e.DEPARTMENT_ID=#{departmentId}
            </if>
            <if test="employeeIdsArray!=null and employeeIdsArray.length!=0">
                AND e.EMPLOYEE_ID in
                <foreach collection="employeeIdsArray" item="employeeId"
                    index="index" open="(" close=")" separator=",">
                    #{employeeId}
                </foreach>
            </if>
        </where>
    </select>



employeeIdsArray.length  - 改为  employeeIdsArray.size

0 0
原创粉丝点击