myBatis 批量xml

批量插入xml

  
    insert into categorys_display_mapping (rel_id, display_category_code, display_category_name,
    category_code, status, create_oper_id,
    create_time, update_oper_id, update_time,
    remark, first_cate_code, first_cate_name,
    second_cate_code, second_cate_name, ext_json
    ) values
    
      (#{item.relId,jdbcType=BIGINT}, #{item.displayCategoryCode,jdbcType=VARCHAR}, #{item.displayCategoryName,jdbcType=VARCHAR},
      #{item.categoryCode,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.createOperId,jdbcType=VARCHAR},
      #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateOperId,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
      #{item.remark,jdbcType=VARCHAR}, #{item.firstCateCode,jdbcType=VARCHAR}, #{item.firstCateName,jdbcType=VARCHAR},
      #{item.secondCateCode,jdbcType=VARCHAR}, #{item.secondCateName,jdbcType=VARCHAR}, #{item.extJson,jdbcType=LONGVARCHAR}
      )
    
  

批量修改


    
      UPDATE categorys_display_mapping
      
        
          displayCategoryCode = #{item.displayCategoryCode},
        
        
          displayCategoryName = #{item.displayCategoryName},
        
        
          categoryCode = #{item.categoryCode},
        
        
          status = #{item.status},
        
        
          createOperId = #{item.createOperId},
        
        
          createTime = #{item.createTime},
        
        
          updateOperId = #{item.updateOperId},
        
        
          updateTime = #{item.updateTime},
        
        
          remark = #{item.remark},
        
        
          firstCateCode = #{item.firstCateCode},
        
        
          firstCateName = #{item.firstCateName},
        
        
          secondCateCode = #{item.secondCateCode},
        
        
          secondCateName = #{item.secondCateName},
        
        
          extJson = #{item.extJson},
        
      
      WHERE rel_id = #{categorys_display_mapping.rel_id}
    
  

 

你可能感兴趣的:(MyBatis,java)