Mapper.xml
<update id="updateByMultiConditions" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="begin" close="; end;" separator=";">
update TB_DUTY
<set>
<if test="item.morningPeopleIds != null and item.morningPeopleIds != '' " >
MORNING_PEOPLE_IDS=#{item.morningPeopleIds,jdbcType=VARCHAR},
</if>
<if test="item.morningPeopleNames != null and item.morningPeopleNames != '' " >
MORNING_PEOPLE_NAMES=#{item.morningPeopleNames,jdbcType=VARCHAR},
</if>
<if test="item.afternoonPeopleIds != null and item.afternoonPeopleIds != '' " >
AFTERNOON_PEOPLE_IDS=#{item.afternoonPeopleIds,jdbcType=VARCHAR},
</if>
<if test="item.afternoonPeopleNames != null and item.afternoonPeopleNames != '' " >
AFTERNOON_PEOPLE_NAMES=#{item.afternoonPeopleNames,jdbcType=VARCHAR},
</if>
<if test="item.eveningPeopleIds != null and item.eveningPeopleIds != '' " >
EVENING_PEOPLE_IDS=#{item.eveningPeopleIds,jdbcType=VARCHAR},
</if>
<if test="item.eveningPeopleNames != null and item.eveningPeopleNames != '' " >
EVENING_PEOPLE_NAMES=#{item.eveningPeopleNames,jdbcType=VARCHAR},
</if>
<if test="item.leaderIds != null and item.leaderIds != '' " >
LEADER_IDS=#{item.leaderIds,jdbcType=VARCHAR},
</if>
<if test="item.leaderNames != null and item.leaderNames != '' " >
LEADER_NAMES=#{item.leaderNames,jdbcType=VARCHAR},
</if>
</set>
where DUTY_ID=#{item.dutyId,jdbcType=INTEGER}
</foreach>
</update>
Controller:
int resultFlag=dutyService.updateByMultiConditions(dutyList2);
问题:
批量修改成功后返回的值是resultFlag=-1,作何解释?如何才能获得修改的行数?