显示效果(1对1)
显示效果(1对多)
数据库主表
数据库显示详细数据的子表
mapper配置文件
mapper_{mkey}sql_columns.json
1、mapper_bo-user-share_sql__columns.json
2、关键配置:childTable
{
"columns": {
"fromUser": {
"fieldSort": 9999,
"tableId": 1,
"dataType": "varchar",
"title": "分享用户",
"guidMethod": 0,
"isSearch": false,
"isData": false,
"dimJoin": {
"fromDimField": "",
"joinChar": ","
},
"editPropertie": {
//child 1对多 childobject 1对1 childarray 多对多
"showMethod": "childobject"
},
"pagePropertie": {
"showMethod": "child"
},
"childTable": {
"row": {
"primaryColName": "user_id",
"foreginColName": "user_id"
},
"joinChar": ",",
"isDyh": false
},
"field": "fromUser",
"name": "from_user",
"alias": "from_user",
"isNull": false
},
"firstShare": {
"fieldSort": 9999,
"tableId": 1,
"dataType": "varchar",
"title": "一级分享",
"isSearch": false,
"isData": false,
"dimJoin": {
"fromDimField": "",
"joinChar": ","
},
"editPropertie": {
//child 1对多 childobject 1对1 childarray 多对多
"showMethod": "childobject"
},
"pagePropertie": {
"showMethod": "childobject"
},
"childTable": {
"row": {
"primaryColName": "from_first_share_id",
"foreginColName": "user_id"
},
"joinChar": ",",
"isDyh": false
},
"field": "firstShare",
"name": "first_share",
"alias": "first_share",
"isNull": false
},
"secondShare": {
"fieldSort": 9999,
"tableId": 1,
"dataType": "varchar",
"title": "二级分享",
"isSearch": false,
"isData": false,
"dimJoin": {
"fromDimField": "",
"joinChar": ","
},
"editPropertie": {
//child 1对多 childobject 1对1 childarray 多对多
"showMethod": "childobject"
},
"pagePropertie": {
"showMethod": "childobject"
},
"childTable": {
"row": {
"primaryColName": "from_second_share_id",
"foreginColName": "user_id"
},
"joinChar": ",",
"isDyh": false
},
"field": "secondShare",
"name": "second_share",
"alias": "second_share",
"isNull": false
}
}
}
mapper_{mkey}sql_responsefield.json
1、mapper_bo-user-share_sql__responsefield.json
2、关键配置:fieldChild
{
"responseField": {
"global": {
"dataFromType": "Database",
"show": "user_id",
"auth": true
},
//分享用户链路信息
"track": {
"auth": true,
"show": "null first_share,null second_share,null from_user,from_first_share_id,from_second_share_id,user_id,create_date",
//"where": "and (from_first_share_id=@_userId or from_first_share_id in @_mergeUserId or from_second_share_id=@_userId or from_second_share_id in @_mergeUserId)",
"field": {},
"order": " create_date desc",
"fieldChild": {
"firstShare": {
"moduleKey": "bo-user-push",
"responseField": "show",
//child 1对多/chilobject1对1
"showMethod": "childobject"
},
"secondShare": {
"moduleKey": "bo-user-push",
"responseField": "show",
"showMethod": "childobject"
},
"fromUser": {
"moduleKey": "bo-user-push",
"responseField": "show",
"showMethod": "childobject"
}
}
}
}
}
显示信息的子表配置 mapper_bo-user-push_sql.json
{
"diffTableNo": 0,
"isRESTful": true,
"base": {
"connName": "ConnBo",
"isRearEnd": true,
"isFrontEnd": true
},
"responseField": {
"global": {
"dataFromType": "Database",
"show": "user_id",
"auth": true
},
//基本展示
"show": {
"need": "userId",
"show": "user_id,real_name,nike_name,telephone,head_icon,'00000000000000000' push_name",
"where": " {where_sql} and user_id in @_filterPrimaryIds",
"field": {
//多名字情况,按优先基本有数据展示
"doName": {
"pushName": [
{
"name": "push_name",
"path": "real_name",
"sortId": 1
},
{
"path": "nike_name", //主键别名 使用于 1对1
//"value": "-",
"sortId": 2
},
{
"path": "email",
"sortId": 3
},
{
"path": "telephone",
//"value": "-",
"sortId": 4
},
{
"key": "user_id", //主键别名 使用于 1对1
"value": "-",
"sortId": 5
}
]
}
}
}
},
"tables": [
{
"id": 1,
//对应表名
"name": "bo_user",
"isPrimary": true,
"primaryColumn": [
{
"colName": "user_id",
"alias": "user_id",
"field": "userId"
}
],
"type": "table"
}
],
//统计时候节点可以不要
"selectSql": {
"primaryWhere": "user_id=@userId",
"tableName": "bo_user",
"order": "user_id",
"listField": "*",
"detailField": "*"
},
//字段如果没有特殊处理,节点可以不要
"columns": {
"nikeName": {
"extendAlias": "search_like",
"tableId": 1,
"isData": true,
"field": "nikeName",
"dataType": "varchar",
"title": "昵称",
"remark": "昵称:模糊查询",
"name": "nike_name",
"alias": "nike_name",
"isSearch": true,
"maxLength": 50
},
"createTime": {
//区间查询 start 如果创建时间, 可以使用 "extendAlias": "create_time", 替代
"filter": {
"method": "gt_eq_lt"
},
"searchPropertie": {
"showMethodOut": "kv",
"showMethod": "date",
"format": "yyyy-MM-dd"
},
"editPropertie": {
"showMethodOut": "kv",
"isOnlyAdd": true,
"showMethod": "date",
"defaultValue": "_currentDate", //普通区间查询不用配置
"format": "yyyy-MM-dd HH:mm:ss" //普通区间查询不用配置
},
"pagePropertie": {
"showMethodOut": "kv", // n v kv sn//普通区间查询不用配置
"showMethod": "date", //普通区间查询不用配置
"format": "yyyy-MM-dd HH:mm:ss" //普通区间查询不用配置
},
//区间查询 end
//"extendAlias": "create_time",
"tableId": 1,
"isDate": true,
"isData": true,
"field": "createTime",
"dataType": "datetime",
"title": "创建时间",
"name": "create_time",
"alias": "create_time",
"isSearch": true
},
"telephone": {
"tableId": 1,
"encDesMethod": "qt2db", //qt2db qt db
"field": "telephone",
"dataType": "varchar",
"title": "手机号",
"remark": "手机号",
"name": "telephone",
"alias": "telephone",
"isList": false,
"isDetail": true,
"isEdit": false,
"isAdd": false,
"isData": true,
//加密前截取后缀用于查询
"suffix": {
"field": "telephoneSuffix",
"alias": "telephone_suffix",
"name": "telephone_suffix",
"length": 4
},
"filter": {},
"editPropertie": {
"showMethod": "text"
},
"pagePropertie": {
"showMethod": "text"
},
"maxLength": 100
},
"pushName": {
"extendAlias": "search_like",
"isData": false,
"tableId": 1,
"field": "pushName",
"dataType": "varchar",
"title": "发布名称",
"name": "real_name",
"alias": "push_name",
"editPropertie": { "showMethod": "text" },
"pagePropertie": { "showMethod": "text" },
"isSearch": true,
"filter": {
"method": "like",
//扩展列 模糊查询 如 (telephone like '%'+@realName+'%' or real_name like '%'+@realName+'%')
"columnName": [ "telephone_suffix", "email", "user_name", "nike_name", "pin_yin", "id_card_suffix" ]
},
"maxLength": 200
},
"realName": {
"extendAlias": "search_like",
"isData": true,
"tableId": 1,
"field": "realName",
"dataType": "varchar",
"title": "真实姓名",
"name": "real_name",
"alias": "real_name",
"editPropertie": { "showMethod": "text" },
"pagePropertie": { "showMethod": "text" },
"isSearch": true,
"filter": {
"method": "like",
//扩展列 模糊查询 如 (telephone like '%'+@realName+'%' or real_name like '%'+@realName+'%')
"columnName": [ "telephone" ]
},
"maxLength": 200
},
"headIcon": {
"extendAlias": "image",
"tableId": 1,
"field": "headIcon",
"dataType": "varchar",
"title": "头像",
"remark": "头像,图片路径,返回时候添加上http地址,入库时候去掉http地址",
"name": "head_icon",
"alias": "head_icon",
"isData": true,
"isList": true,
"maxLength": 200
},
"userName": {
"extendAlias": "search_like",
"tableId": 1,
"field": "userName",
"dataType": "varchar",
"title": "登录账号",
"isData": true,
"remark": "登录账号:模糊查询",
"name": "user_name",
"alias": "user_name",
"isSearch": true,
"maxLength": 50,
"filter": {
"method": "like",
//扩展列 模糊查询 如 (telephone like '%'+@realName+'%' or real_name like '%'+@realName+'%')
"columnName": [ "telephone" ]
}
}
}
}
文档更新时间: 2021-12-06 21:26 作者:admin