<update id="batchUpdateReserList" parameterType="java.util.List">
<foreach collection="reservationList" item="item" index="index" open="" close="" separator=";">
update t_sds_room_reservation
<set>
<if test="item.status != null and item.status !='' " >
status = #{item.status,jdbcType=VARCHAR},
</if>
<if test="item.remark != null and item.remark != ''" >
remark = #{item.remark,jdbcType=VARCHAR},
</if>
<if test="@com.paascloud.PublicUtil@isNotEmpty(item.approvedPhone)">
approved_phone = #{item.approvedPhone,jdbcType=VARCHAR},
</if>
<if test="@com.paascloud.PublicUtil@isNotEmpty(item.contactNum)">
contact_num = #{item.contactNum,jdbcType=VARCHAR},
</if>
</set>
where id = #{item.id,jdbcType=BIGINT}
</foreach>
</update>
新增
<insert id="batchInsertReserList" parameterType="java.util.List">
insert into t_sds_room_reservation(`id`,`room_id`,`estimated_occupancy`,`contact_num`,`approve_status`,`remark`,`status`,`check_in_time`,`check_out_time`,`organization_id`,`company_id`,`create_by`,
`create_time`,`expense_org`,`approved_by`,`approved_phone`)
VALUES
<foreach collection="reservationList" item="reser" index="index" separator=",">
(
#{reser.id},#{reser.roomId},#{reser.estimatedOccupancy},#{reser.contactNum},#{reser.approveStatus},#{reser.remark},#{reser.status},#{reser.checkInTime},#{reser.checkOutTime},
#{reser.organizationId},#{reser.companyId},#{reser.createBy},#{reser.createTime},#{reser.expenseOrg},#{reser.approvedBy},#{reser.approvedPhone}
)
</foreach>
</insert>