Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]json_data->>'$.column' AS column #13

Closed
zhwm12 opened this issue May 20, 2021 · 0 comments
Closed

[BUG]json_data->>'$.column' AS column #13

zhwm12 opened this issue May 20, 2021 · 0 comments

Comments

@zhwm12
Copy link

zhwm12 commented May 20, 2021

luckysheet-mysql\src\main\java\com\xc\luckysheet\mysql\impl\RecordSelectHandle.java
public JSONObject getCelldataByGridKey(String listId, String index, String blockId) {
............
String sql="select index,json_data->>'$.celldata' AS celldata,json_data->>'$.column' AS column,json_data->>'$.row' AS row from "+JfGridConfigModel.TABLENAME+" p where p.list_id=? and p.index=? and p.block_id=? and p.is_delete=0 ORDER BY p.id DESC LIMIT 1 ";
Map<String, Object> map= luckySheetJdbcTemplate.queryForMap(sql, new Object[]{listId,index,blockId});
............
}
DataTable sheet [docssheet ] fields:id,block_id,row_col,index,list_id,status,order,json_data,is_delete
json_data : {"celldata": [{"c": 6, "r": 30, "v": {"m": "l", "v": "l", "ct": {"t": "g", "fa": "General"}}}]}

Mysql:
select id,index,json_data->>'$.celldata' AS celldata,json_data->>'$.column' AS column,json_data->>'$.row' AS row from docssheet p where p.list_id='45794d3ceb1f0054a2b6d47b0ac82212' and p.index='Sheet_6aokgc2qSWWH20210505161959' and p.block_id='30_6' and p.is_delete=0 ORDER BY p.id DESC LIMIT 1 ;
Query Result:
id :183152282723028992
index :Sheet_6aokgc2qSWWH20210505161959
celldata:[{"c": 6, "r": 30, "v": {"m": "l", "v": "l", "ct": {"t": "g", "fa": "General"}}}]
column: (NULL)
row : (NULL)

Map<String, Object> map= luckySheetJdbcTemplate.queryForMap(sql, new Object[]{listId,index,blockId});
ERROR Incorrect result size: expected 1, actual 0

problem 1: json_data->>'$.column' Or json_data->>'$.c' ?
problem 2: record count 1; but warning ERROR Incorrect result size: expected 1, actual 0 ?

@zhwm12 zhwm12 closed this as completed Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant