随笔 - 836  文章 - 1 评论 - 40 阅读 - 102万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

select * from  EDI.edi_history where id = 2577;

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

 

对于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);

 

posted on   lshan  阅读(1115)  评论(0编辑  收藏  举报
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
点击右上角即可分享
微信分享提示