工作小总结

mybatis批量update的时候失败,解决办法

mybatis批量更新:形式一:更新的时候带有判断条件的:<!-- 添加数据权限后,数据补充。批量更新入库 --><update id="batechUpdateInfoForOaAuth" parameterType="list"> &

mybatis批量更新:

形式一:

更新的时候带有判断条件的:

<!-- 添加数据权限后,数据补充。批量更新入库 -->
<update id="batechUpdateInfoForOaAuth" parameterType="list">
      <foreach collection="aList"   index="index" item="item" open="" close="" separator=";">
          update a表
          <set>
              <if test="item.deptCode !=null">
                  dept_code = #{item.deptCode,jdbcType=VARCHAR},
              </if>

              <if test="item.deptName !=null">
                  dept_name = #{item.deptName,jdbcType=VARCHAR},
              </if>


              <if test="item.productLineCode !=null">
                  product_line_code = #{item.productLineCode,jdbcType=VARCHAR},
              </if>

              <if test="i

原创不易,完成人机校验,阅读全文

相关推荐