mybatis 参数为list时,校验list是否为空

时间:2021-06-25 12:01:55

校验objStatusList 是否为空

<if test="objStatusList != null and objStatusList.size() > 0 ">
  and
  <foreach collection="objStatusList" index="objStatusList" item="obj_status" open="(" separator="or" close=")">
    obj_status = #{obj_status}
  </foreach>
</if>