1、页面效果图(原型图)
组装出的sql举例:
SELECT id,name,age FROM tab1 WHERE (id <= 5 AND (name = 张三 OR age > 20)) AS filterate1;
2、封装结构
2.1 所需的数据结构
(id=1, typeName=过滤组件, type=filterate, caption=过滤组件测试, describe=测试过滤组件, content={
"configRules": {
"condition": "AND",
"rules": [{
"fieldName": "id",
"fieldType": "number",
"operator": "<=",
"value": "5"
}, {
"condition": "OR",
"rules": [{
"fieldName": "name",
"fieldType": "string",
"operator": "=",
"value": "张三"
}, {
"fieldName": "sex",
"fieldType": "string",
"operator": "IS NOT NULL",
"value": "男"
}]
}]
},
"fieldInfo": ["id", "name","sex"]
}, publicColumn=null, assemblyAlias=filterate1, loadAlias=null)
- 描述:
- id:组件id,唯一标识
- typeName:组件名称
- type:组件类型
- caption:组件标题
- describe:组件描述
- content:组件内容
- configRules:组件规则信息
- rules:数据规则
- fieldName:字段名称
- fieldType:字段类型
- operator:运算符(=、>、<........)
- value:字段参与运算的值
- condition:数据关系
- rules:数据规则
- fieldInfo:字段之间的关系
- configRules:组件规则信息
- assemblyAlias:组件别名
3、开始编码
3.1 封装sql
/**
* 封装过滤组件sql
*content = {"configRules": {&#