mybatis是我们开发者常用的dao框架,亿轻巧灵活为特征,在crud操作中,动态更新是常用的操作。我搜集了两种动态更新的sql写法,以备日后备用! 方法1: update loan_product product_id = #{productId,jdbcType=VARCHAR}, product_name = #{productName,jdbcType=VARCHAR}, product_source = #{productSource,jdbcType=VARCHAR}, level_one = #{levelOne,jdbcType=VARCHAR}, level_two = #{levelTwo,jdbcType=VARCHAR}, status = #{status,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP}, where id = #{id,jdbcType=INTEGER} 这种方式简单易写,易阅读。 方法2 update loan_borrow status=#{status},borrow_name=#{borrowName}, where borrow_nid = #{borrowNid}

相关文章:

  • 2021-06-08
  • 2022-12-23
  • 2022-12-23
  • 2021-04-09
  • 2021-06-15
  • 2022-01-25
猜你喜欢
  • 2022-12-23
  • 2021-09-30
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
相关资源
相似解决方案