mysql 5.7新特新 操作json 数组
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 数组的更多相关文章
- JQUERY操作JSON数组添加新的属性和值
语法: var data = {}; data["Order"] =order; data["Sort"] = sort; 但是需要注意的是,如果data后面还 ...
- .net很简介的操作json数组
using Newtonsoft.Json.Linq;//添加的引用,Newtonsoft.dll可以到guget里面下载 string json="json字符串" JObjec ...
- [转] jQuery 操作 JSON 数据
jquery下json数组的操作用法实例: jquery中操作JSON数组的情况中遍历方法用的比较多,但用添加移除这些好像就不是太多了. 试过json[i].remove(),json.remove( ...
- jquery下json数组的操作用法实例
jquery下json数组的操作用法实例: jquery中操作JSON数组的情况中遍历方法用的比较多,但用添加移除这些好像就不是太多了. 试过json[i].remove(),json.remove( ...
- 操作JSON对象
JSON类型对象,最简单了,就是键值对,key:value.key:value.一直不停地key:value下去,层层嵌套,理论上多少层都可以,只要你喜欢. 可是,每次应用JSON,我都心烦意乱,甚至 ...
- MySQL 8.0有什么新功能
https://mysqlserverteam.com/whats-new-in-mysql-8-0-generally-available/ 我们自豪地宣布MySQL 8.0的一般可用性. 现在下载 ...
- MySQL 8.0.2复制新特性(翻译)
译者:知数堂星耀队 MySQL 8.0.2复制新特性 MySQL 8 正在变得原来越好,而且这也在我们MySQL复制研发团队引起了一阵热潮.我们一直致力于全面提升MySQL复制,通过引入新的和一些有趣 ...
- 【Mysql】- Mysql 8.0正式版新亮点
MySQL 8.0 正式版 8.0.11 已发布,官方表示 MySQL 8 要比 MySQL 5.7 快 2 倍,还带来了大量的改进和更快的性能! 注意:从 MySQL 5.7 升级到 MySQL 8 ...
- [译]试用新的System.Text.Json API
译注 可能有的小伙伴已经知道了,在.NET Core 3.0中微软加入了对JSON的内置支持. 一直以来.NET开发者们已经习惯使用Json.NET这个强大的库来处理JSON. 那么.NET为什么要增 ...
随机推荐
- 结构体内的函数与bfs的情景变量
关于结构体内的函数,太难的尚且不会用,下面是一个简单一点的结构体内函数的代码 定义这样一个结构体函数之后就能像如下这样使用了 以上为结构体内的简单函数,下面重点来了,关于bfs找最短路由于需要避免走回 ...
- 网络流--最小费用最大流MCMF模板
标准大白书式模板 #include<stdio.h> //大概这么多头文件昂 #include<string.h> #include<vector> #includ ...
- mac 终端显示彩色
修改~/.bash_profile文件,在文件中加入下面两行配置. export CLICOLOR=1 export LSCOLORS=gxfxaxdxcxegedabagacad 保存文件, ...
- C语言面试题3
编程题 1.读文件file1.txt的内容(例如): 123456 输出到file2.txt: 563412 #include <stdio.h> #include <stdlib. ...
- SQL语言:DDL/DML/DQL/DCL
SQL (Structure Query Language)语言是数据库的核心语言. SQL 的发展是从1974年开始的,其发展过程如下: 1974年-----由Boyce和Chamberlin提出, ...
- yarn 制作 npm 包
yarn publish yarn info [package_name]
- python Django Nginx+ uWSGI 安装配置
环境: CentOS7.python-3.5.3.Nignx 1.10.3 .Django 1.10.6.uWSGI 2.0.14 django项目目录:/var/webRoot/p1 项目结构: 基 ...
- TX Textcontrol 使用总结一模板
以下内容纯属个人使用感想,如有问题,还望讲解!!! 简介与使用感想: TX Text Control是一套功能丰富的文字处理控件,它以可重复使用控件的形式为开发人员提供了Word中常用的文字处理功能, ...
- ios获取安装的app
http://www.iphonedevsdk.com/forum/iphone-sdk-development/22289-possible-retrieve-these-information.h ...
- Android启动过程中背景图片显示
转自:http://blog.csdn.net/zhangzhikaixinya/article/details/17001321 大部分Android App启动过程中,都会设置一个背景图片,直到A ...