select * from  EDI.edi_history where id = ;

UPDATE EDI.edi_history SET response_summary = JSON_REPLACE(response_summary, '$[0].isOverMileStone', 'php') WHERE id = ;

对于json数组,使用$[*]  然后在获取节点.

@Query(value = "select * from EDI.edi_history where json_contains(response_summary, ?1) and json_contains(response_summary, ?2) and json_contains(response_summary, ?3) and json_contains(response_summary, ?4)", nativeQuery = true)
public List<EdiHistoryDO> findByResponseSummary(String result, String orderNo, String orderId, String docType);

// UPDATE EDI.edi_history SET response_summary = JSON_REPLACE(response_summary,
// '$[0].isOverMileStone', 'true')
// WHERE
// json_contains(response_summary, '{"courierBillNo":"159900000091"}')
// and json_contains(response_summary, '{"result":"SUCCESS"}')
// and response_summary like "%dest_stn%" ;
@Modifying(clearAutomatically = true)
//@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT)
@Query(value = " UPDATE EDI.edi_history SET response_summary = JSON_REPLACE(response_summary, '$[0].isOverMileStone', ?1) \n "
+ " WHERE \n " + " json_contains(response_summary, ?2)\n "
+ " and json_contains(response_summary, '{\"result\":\"SUCCESS\"}')\n "
+ " and response_summary like \"%dest_stn%\"", nativeQuery = true)
public int updateResponseSummaryIsOverMileStoneByCourierBillNo(String trueOrfalse, String courierBillNoJson);

/**
* get id from ediHistory which include milestone info
*/
@Query(value = " select id from EDI.edi_history "
+ " WHERE \n " + " json_contains(response_summary, ?1)\n "
+ " and json_contains(response_summary, '{\"result\":\"SUCCESS\"}')\n "
+ " and response_summary like \"%dest_stn%\"", nativeQuery = true)
public BigInteger findEdiHistoryId(String courierBillNoJson);

mysql 5.7新特新 操作json 数组的更多相关文章

  1. JQUERY操作JSON数组添加新的属性和值

    语法: var data = {}; data["Order"] =order; data["Sort"] = sort; 但是需要注意的是,如果data后面还 ...

  2. .net很简介的操作json数组

    using Newtonsoft.Json.Linq;//添加的引用,Newtonsoft.dll可以到guget里面下载 string json="json字符串" JObjec ...

  3. [转] jQuery 操作 JSON 数据

    jquery下json数组的操作用法实例: jquery中操作JSON数组的情况中遍历方法用的比较多,但用添加移除这些好像就不是太多了. 试过json[i].remove(),json.remove( ...

  4. jquery下json数组的操作用法实例

    jquery下json数组的操作用法实例: jquery中操作JSON数组的情况中遍历方法用的比较多,但用添加移除这些好像就不是太多了. 试过json[i].remove(),json.remove( ...

  5. 操作JSON对象

    JSON类型对象,最简单了,就是键值对,key:value.key:value.一直不停地key:value下去,层层嵌套,理论上多少层都可以,只要你喜欢. 可是,每次应用JSON,我都心烦意乱,甚至 ...

  6. MySQL 8.0有什么新功能

    https://mysqlserverteam.com/whats-new-in-mysql-8-0-generally-available/ 我们自豪地宣布MySQL 8.0的一般可用性. 现在下载 ...

  7. MySQL 8.0.2复制新特性(翻译)

    译者:知数堂星耀队 MySQL 8.0.2复制新特性 MySQL 8 正在变得原来越好,而且这也在我们MySQL复制研发团队引起了一阵热潮.我们一直致力于全面提升MySQL复制,通过引入新的和一些有趣 ...

  8. 【Mysql】- Mysql 8.0正式版新亮点

    MySQL 8.0 正式版 8.0.11 已发布,官方表示 MySQL 8 要比 MySQL 5.7 快 2 倍,还带来了大量的改进和更快的性能! 注意:从 MySQL 5.7 升级到 MySQL 8 ...

  9. [译]试用新的System.Text.Json API

    译注 可能有的小伙伴已经知道了,在.NET Core 3.0中微软加入了对JSON的内置支持. 一直以来.NET开发者们已经习惯使用Json.NET这个强大的库来处理JSON. 那么.NET为什么要增 ...

随机推荐

  1. IDEA中遇到One of the two will be used. Which one is undefined.

    某次启动idea的时候看到控制台提示如下错误 : objc[]: Class JavaLaunchHelper is implemented .0_131.jdk/Contents/Home/bin/ ...

  2. hdu1428 记忆化搜索(BFS预处理最短路径和+DP+DFS)

    题意:有一块 n * n 大小的方形区域,要从左上角 (1,1)走到右下角(n,n),每个格子都有通过所需的时间,并且每次所走的下一格到终点的最短时间必须比当前格子走到重点的最短时间短,问一共有多少种 ...

  3. leetcode:Single Number【Python版】

    1.用双重循环逐个遍历(超时) 2.用list B的append和remove函数(超时) 3.用dict B(AC) class Solution: # @param A, a list of in ...

  4. streamsets 集成 rabbitmq 以及benthos stream 处理框架

    benthos 是一个stream 处理框架,streamsets 也是,但是两者可以通过不同的工具进行集成起来 一般我们可以使用http 服务,消息中间件(kafka.rabbitmq ...) 使 ...

  5. MySQL只有.frm文件恢复表结构

    http://www.ttlsa.com/mysql/mysql-utilities-mysqlfrm/ 以诊断模式读取目录中的所有的FRM文件: D:\Program Files (x86)\Eas ...

  6. button使用注意

    <button type="button" class="btn btn-primary" onclick="ChangePassword(); ...

  7. 数独求解程序 php版

    数独求解程序 php版 <?php class Sudoku { var $matrix; function __construct($arr = null) { if ($arr == nul ...

  8. django orm 常用查询筛选

    大于.大于等于 __gt 大于 __gte 大于等于 User.objects.filter(age__gt=10) // 查询年龄大于10岁的用户 User.objects.filter(age__ ...

  9. ALGO-7_蓝桥杯_算法训练_逆序对

    出处:http://blog.csdn.net/enjoying_science/article/details/44114035 (有难度,以后回来填坑) 阅读代码中: #include<st ...

  10. BASIC-6_蓝桥杯_杨辉三角形

    示例代码: #include <stdio.h>#include <stdlib.h> int main(void){ int n = 0 ; int i = 0 , j = ...