Java中的代码
Map<String, Object> map = new HashMap<String, Object>();
map.put("iAuditStatus", audisStatusID);
map.put("iUpdateTime", DateFormat.dateToTimeStamp(new Date()));
map.put("iAutoId", str.split(",")); // where 条件中的in参数为数组
res = presentAuditService.updatepl(map);
Mybatis中的sql
<update id= "updatepl" parameterType= "java.util.HashMap">
update t_present_audit<set>
<if test="iAuditStatus != null">
iAuditStatus = #{iAuditStatus,jdbcType=INTEGER},
</if>
<if test="iUpdateTime != null">
iUpdateTime = #{iUpdateTime,jdbcType=INTEGER},
</if>
</set>
where iAutoId in
<foreach collection="iAutoId" item= "iAutoId" index ="index"
open= "(" close =")" separator=",">
#{iAutoId,jdbcType=INTEGER}
</foreach >
</update >