// List 存储 json 格式后的查询
.apply("JSON_CONTAINS(JSON_EXTRACT(order_id_list, '$.data[*]'), CONCAT('\"', {0}, '\"'))", orderId)
// List 存储 json 格式后的查询
.apply("JSON_CONTAINS(JSON_EXTRACT(pass_node_codes, '$.data[*]'), {0})", passNode));
为什么查询会有区别呢?
因为 List 格式转换成 json 存储到数据库是这样的
而 List 存储到数据库是这样的
数据多了一对引号,所以在查询时,我们需要将引号拼上去
Original: https://www.cnblogs.com/pandacode/p/16388914.html
Author: 这个杀手冷死了
Title: Mybatis-Plus json 格式数据查询
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/575880/
转载文章受原作者版权保护。转载请注明原作者出处!