需求 A表中有 设备的ID ,sbid ,以及设备名称 sbmcb 都是以字符串进行拼接。
sbid:sb123,sb567
sbmc:mc设备01,mc设备02,
B表有 dpt【代表拍摄的流程】字段,以及设备IDa,和设备名称 sbmch, 一个设备一张照片【一条数据】
dpt:朝阳东 sb123, mc设备01 ipath
dpt:朝阳西 sb567, mc设备02 ipath
给前端返回如下格式
[
{
"value": "48124", //设备的ID
"children": [ //dpt 字段
{
"value": "61",
"label": "现场"
},
{
"value": "60",
"label": "直线"
},
{
"value": "62",
"label": "寸"
},
{
"value": "63",
"label": "尺寸"
}
],
"label": "南槐接头01" //设备名称
},
{
"value": "48125",
"children": [
{
"value": "67",
"label": "w间距"
},
{
"value": "65",
"label": "绝缘"
},
{
"value": "64",
"label": "检查"
},
{
"value": "66",
"label": "间距"
}
],
"label": "南槐接头02"
},
{
"value": "0",
"label": "全部"
}
]
JdbcTemplate jdbcTemplate3 = (JdbcTemplate) ctx.getBean("CmJdbcTemplate");
String sqlhwe = " select t.SBQDMC as LABELM, t.SBQD as VALUE from gw_jxjsy_jxjh t where t.id='" + rwid + "'";
List