mybatis xml文件
<!-- 批量更新 -->
<update id="batchUpdate" parameterType="java.util.List">
<if test="list != null">
<foreach collection="list" item="item" index="index" open="begin" close="; end;" separator=";">
update REPORT_CHARGED_HOMEWORK
<set >
<if test="item.departmentName != null" >
DEPARTMENT_NAME = #{item.departmentName,jdbcType=VARCHAR},
</if>
<if test="item.workTicket != null" >
WORK_TICKET = #{item.workTicket,jdbcType=VARCHAR},
</if>
<if test="item.teamNumber != null" >
TEAM_NUMBER = #{item.teamNumber,jdbcType=VARCHAR},
</if>
<if test="item.responsiblePerson != null" >
RESPONSIBLE_PERSON = #{item.responsiblePerson,jdbcType=VARCHAR},
</if>
<if test="item.substation != null" >
SUBSTATION = #{item.substation,jdbcType=VARCHAR},
</if>
</set>
where TEMPORARY_ID = #{item.temporaryId,jdbcType=VARCHAR}
</foreach>
</if>
</update>
service层
int i=ChargedHomeworkMapper.batchUpdate(list);
经过debug模式调试发现 每次执行 批量更新的时候 返回值都为-1 这个为什么呢? 求各位大哥大姐帮帮忙
慕移动5207743
Franciswmf
Jimin
相关分类