实现动态表单功能,支持表单自定义并实现后期的数据统计、分析。
{
"item": [
{
"repeats": 0,
"childType": "text",
"itemType": 1,
"updateDate": "1619599422000",
"max": 0,
"prefix": "1",
"readOnly": 0,
"optionRepeats": 0,
"qtId": "584824102494277632",
"sectionId": "584824208362704896",
"type": "string",
"required": 0,
"itemId": "569271103424434176",
"score": 0,
"sequence": 1,
"configRes": {
"childType": "text",
"configContent": "{\"childType\":\"text\",\"max\":0,\"showTypeName\":\"¶àÐÐÎı¾Ìâ\",\"typeName\":\"×Ö·û´®\",\"characterLimit\":\"none\",\"textType\":\"string\",\"type\":\"string\",\"categoryName\":\"ÎÒµÄÌâ¿â\",\"min\":0,\"showType\":\"text\",\"id\":\"569271103424434176\",\"text\":\"ÐÕÃû\",\"categoryId\":\"1371773393070960641\"}",
"textType": "string",
"characterLimit": "none"
},
"linkId": "ab108b9f-86ae-43c7-885c-9eb3de2935e9",
"min": 0,
"showType": "text",
"sectionItemRId": "1387326646303043586",
"id": "1387326646303043586",
"text": "ÐÕÃû",
"createDate": "1619599422000",
"status": 1
},
{
"repeats": 0,
"arrayType": "1",
"itemType": 1,
"updateDate": "1619599422000",
"prefix": "2",
"readOnly": 0,
"optionRepeats": 0,
"qtId": "584824102494277632",
"sectionId": "584824208362704896",
"type": "choice",
"required": 0,
"itemId": "569271034725928960",
"score": 0,
"sequence": 2,
"configRes": {
"configContent": "{\"arrayType\":\"1\",\"optionValue\":\"ÄÐ | Å®\",\"showTypeName\":\"µ¥Ñ¡Ìâ\",\"optionList\":[{\"defaultStatus\":\"0\",\"itemId\":\"569271034725928960\",\"sequence\":1,\"code\":\"0\",\"detailedStatus\":\"0\",\"display\":\"ÄÐ\",\"itemOptionId\":\"569271034797232128\"},{\"defaultStatus\":\"0\",\"itemId\":\"569271034725928960\",\"sequence\":2,\"code\":\"1\",\"detailedStatus\":\"0\",\"display\":\"Å®\",\"itemOptionId\":\"569271034797232129\"}],\"typeName\":\"Ñ¡Ôñ\",\"showType\":\"choice\",\"id\":\"569271034725928960\",\"text\":\"ÐÔ±ð\",\"type\":\"choice\",\"categoryName\":\"ÎÒµÄÌâ¿â\",\"categoryId\":\"1371773393070960641\"}"
},
"linkId": "2ddd6ba5-394b-4634-9802-099ce64eb3b0",
"showType": "choice",
"sectionItemRId": "1387326646324015106",
"id": "1387326646324015106",
"text": "ÐÔ±ð",
"createDate": "1619599422000",
"option": [
{
"value": {
"defaultStatus": "0",
"code": "0",
"detailedStatus": "0",
"display": "ÄÐ",
"itemOptionRId": "584824208413036544"
}
},
{
"value": {
"defaultStatus": "0",
"code": "1",
"detailedStatus": "0",
"display": "Å®",
"itemOptionRId": "584824208429813760"
}
}
],
"status": 1
},
{
"repeats": 0,
"itemType": 1,
"updateDate": "1619599422000",
"prefix": "3",
"type": "integer",
"required": 0,
"score": 0,
"min": 0,
"showType": "text",
"id": "1387326646361763842",
"text": "ÄêÁä",
"createDate": "1619599422000",
"childType": "number",
"max": 0,
"readOnly": 0,
"optionRepeats": 0,
"qtId": "584824102494277632",
"sectionId": "584824208362704896",
"itemId": "569271835015909376",
"sequence": 3,
"configRes": {
"childType": "number",
"configContent": "{\"childType\":\"number\",\"max\":0,\"showTypeName\":\"¶àÐÐÎı¾Ìâ\",\"typeName\":\"ÊýÖµ\",\"isSlide\":\"0\",\"type\":\"integer\",\"categoryName\":\"ÎÒµÄÌâ¿â\",\"min\":0,\"showType\":\"text\",\"numericType\":\"1\",\"id\":\"569271835015909376\",\"text\":\"ÄêÁä\",\"decimal\":0,\"categoryId\":\"1371773393070960641\"}",
"numericType": "1"
},
"linkId": "566122e3-4fb3-4fcb-8b44-2288f4ed1eea",
"sectionItemRId": "1387326646361763842",
"decimal": 0,
"status": 1
}
],
"linkId": "982cb230-5381-419a-83af-916f66392824",
"sectionId": "584824208362704896",
"text": "·Ö×é1",
"type": "group"
}
select * from jim_dynamic_form where form_name = '调研问卷A'; -- 表单-调研问卷A
select * from jim_form_data_type ; -- 表单-数据类型
select * from jim_form_column where form_id = 1; -- 表单-调研问卷A的定义
select * from jim_form_data where form_id = 1 and data_id = 1 ; -- 表单-调研问卷A的数据记录1
-- 表单数据统计
select
(select data_value from jim_form_data_detail where data_id = t.data_id and column_id = 1) as `姓名`,
(select data_value from jim_form_data_detail where data_id = t.data_id and column_id = 2) as `年龄`,
(select data_value from jim_form_data_detail where data_id = t.data_id and column_id = 3) as `性别`,
(select data_value from jim_form_data_detail where data_id = t.data_id and column_id = 4) as `出生日期`
from jim_form_data t where t.form_id = 1 and t.data_id = 1 ;