先上两个sql吧:这是查询
SELECT
t.page_id,
t.page_name,
json_extract (modif_json, '$.list[0].params.text' ) AS something
FROM
t_app_page t
WHERE
t.page_id = '80'
这是修改:
UPDATE t_app_page t
SET t.modif_json = json_set ( t.modif_json, "$.list[0].params.text", "66" )
WHERE
t.page_id = '80'
这是简化的json:
{
"opVersion": 44,
"data": {
"pageSetting": {
"bgColor": "rgba(245, 245, 245, 1)",
"bgImg": "",
"gradientType": "0"
},
"list": [{
"type": "status-bar",
"params": {
"isHasPlace": "0",
"bgColor": "",
"textStyleFontSize": "",
"theme": "theme1",
"text": "合约代码\\名称",
"textStyleFontColor": "",
"cbm": "",
"height": "44",
"colorChange": "1"
}
},
{
"type": "icon-func",
"params": {
"margin": "",
"imgPosition": "1",
"textStyleFontSize": "",
"boradius": "0",
"textStyleFontColor": "",
"cbm": "0",
"bgColor": "rgba(51, 102, 204, 1)",
"sizeHeight": "",
"theme": "",
"gradientType": "0",
"rowNumber": [
"1"
],
"isCovered": "0",
"imgList": [{
"bgColor": "",
"src": "",
"textStyleFontSize": "",
"sizeHeight": "",
"text": "",
"textStyleFontColor": "",
"url": "",
"_n": 1
}],
"snap": ""
}
}
]
}
}