mybatis 参数list放入map

<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>

猜你喜欢

转载自www.cnblogs.com/wangzj/p/10155151.html
今日推荐