1 Star 0 Fork 8

qingfengpark/koa2-typescript

forked from CPC123456/koa2-typescript 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
table.pdman.json 52.84 KB
一键复制 编辑 原始数据 按行查看 历史
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435
{
"modules": [
{
"name": "谷歌插件模块",
"chnname": "谷歌插件模块",
"entities": [
{
"title": "shop",
"fields": [
{
"name": "id",
"type": "TEXT",
"remark": "",
"chnname": "id",
"pk": true,
"notNull": true
},
{
"name": "name",
"type": "TEXT",
"remark": "",
"chnname": "店铺名称"
},
{
"name": "phone",
"type": "TEXT",
"remark": "",
"chnname": "手机号"
},
{
"name": "email",
"type": "TEXT",
"remark": "",
"chnname": "邮箱"
},
{
"name": "description",
"type": "TEXT",
"remark": "",
"chnname": "描述"
},
{
"name": "updateTime",
"type": "DATETIME DEFAULT CURRENT_TIMESTAMP",
"remark": "",
"chnname": "更新时间"
}
],
"indexs": [],
"headers": [
{
"fieldName": "chnname",
"relationNoShow": false
},
{
"fieldName": "name",
"relationNoShow": false
},
{
"fieldName": "type",
"relationNoShow": false
},
{
"fieldName": "dataType",
"relationNoShow": true
},
{
"fieldName": "remark",
"relationNoShow": true
},
{
"fieldName": "pk",
"relationNoShow": false
},
{
"fieldName": "notNull",
"relationNoShow": true
},
{
"fieldName": "autoIncrement",
"relationNoShow": true
},
{
"fieldName": "defaultValue",
"relationNoShow": true
},
{
"fieldName": "relationNoShow",
"relationNoShow": true
},
{
"fieldName": "uiHint",
"relationNoShow": true
}
],
"chnname": "店铺信息表"
},
{
"title": "chromePlugin",
"fields": [
{
"name": "REVISION",
"type": "Integer",
"remark": "",
"chnname": "乐观锁"
},
{
"name": "CREATED_BY",
"type": "IdOrKey",
"remark": "",
"chnname": "创建人"
},
{
"name": "CREATED_TIME",
"type": "DateTime",
"remark": "",
"chnname": "创建时间"
},
{
"name": "UPDATED_BY",
"type": "IdOrKey",
"remark": "",
"chnname": "更新人"
},
{
"name": "UPDATED_TIME",
"type": "DateTime",
"remark": "",
"chnname": "更新时间"
}
]
},
{
"title": "goods",
"fields": [
{
"name": "id",
"type": "TEXT",
"remark": "",
"chnname": "id",
"pk": true,
"notNull": true
},
{
"name": "name",
"type": "TEXT",
"remark": "",
"chnname": "商品名称"
},
{
"name": "shopId",
"type": "TEXT",
"remark": "",
"chnname": "店铺id"
},
{
"name": "description",
"type": "TEXT",
"remark": "",
"chnname": "描述"
},
{
"name": "updateTime",
"type": "DATETIME DEFAULT CURRENT_TIMESTAMP",
"remark": "",
"chnname": "更新时间"
}
],
"indexs": [],
"headers": [
{
"fieldName": "chnname",
"relationNoShow": false
},
{
"fieldName": "name",
"relationNoShow": false
},
{
"fieldName": "type",
"relationNoShow": false
},
{
"fieldName": "dataType",
"relationNoShow": true
},
{
"fieldName": "remark",
"relationNoShow": true
},
{
"fieldName": "pk",
"relationNoShow": false
},
{
"fieldName": "notNull",
"relationNoShow": true
},
{
"fieldName": "autoIncrement",
"relationNoShow": true
},
{
"fieldName": "defaultValue",
"relationNoShow": true
},
{
"fieldName": "relationNoShow",
"relationNoShow": true
},
{
"fieldName": "uiHint",
"relationNoShow": true
}
],
"chnname": "商品信息表"
},
{
"title": "order",
"fields": [
{
"name": "id",
"type": "TEXT",
"remark": "",
"chnname": "订单编号",
"pk": true,
"notNull": true
},
{
"name": "goodsId",
"type": "TEXT",
"remark": "",
"chnname": "商品id"
},
{
"name": "num",
"type": "TEXT",
"remark": "",
"chnname": "订单数量"
},
{
"name": "totalPrice",
"type": "TEXT",
"remark": "",
"chnname": "商品总价"
},
{
"name": "realMoney",
"type": "TEXT",
"remark": "",
"chnname": "实收金额"
},
{
"name": "dealTime",
"type": "TEXT",
"remark": "",
"chnname": "成交时间"
},
{
"name": "description",
"type": "TEXT",
"remark": "",
"chnname": "描述"
},
{
"name": "updateTime",
"type": "DATETIME DEFAULT CURRENT_TIMESTAMP",
"remark": "",
"chnname": "更新时间"
}
],
"indexs": [],
"headers": [
{
"fieldName": "chnname",
"relationNoShow": false
},
{
"fieldName": "name",
"relationNoShow": false
},
{
"fieldName": "type",
"relationNoShow": false
},
{
"fieldName": "dataType",
"relationNoShow": true
},
{
"fieldName": "remark",
"relationNoShow": true
},
{
"fieldName": "pk",
"relationNoShow": false
},
{
"fieldName": "notNull",
"relationNoShow": true
},
{
"fieldName": "autoIncrement",
"relationNoShow": true
},
{
"fieldName": "defaultValue",
"relationNoShow": true
},
{
"fieldName": "relationNoShow",
"relationNoShow": true
},
{
"fieldName": "uiHint",
"relationNoShow": true
}
],
"chnname": "订单信息表"
},
{
"title": "promotionUnit",
"fields": [
{
"name": "id",
"type": "TEXT",
"remark": "",
"chnname": "id",
"pk": true,
"notNull": true
},
{
"name": "shopId",
"type": "TEXT",
"remark": "",
"chnname": "店铺id"
},
{
"name": "planeId",
"type": "TEXT",
"remark": "",
"chnname": "计划id"
},
{
"name": "goodsId",
"type": "TEXT",
"remark": "",
"chnname": "商品id"
},
{
"name": "spend",
"type": "INTEGER",
"remark": "",
"chnname": "花费"
},
{
"name": "sum",
"type": "INTEGER",
"remark": "",
"chnname": "交易额"
},
{
"name": "inOutRatio",
"type": "INTEGER",
"remark": "",
"chnname": "投入产出比"
},
{
"name": "dealNum",
"type": "INTEGER",
"remark": "",
"chnname": "成交笔数"
},
{
"name": "oneCost",
"type": "INTEGER",
"remark": "",
"chnname": "每笔成交花费"
},
{
"name": "oneTurnover",
"type": "INTEGER",
"remark": "",
"chnname": "每笔成交金额"
},
{
"name": "exposureNum",
"type": "INTEGER",
"remark": "",
"chnname": "曝光量"
},
{
"name": "clickNum",
"type": "INTEGER",
"remark": "",
"chnname": "点击量"
},
{
"name": "clickConvRate",
"type": "INTEGER",
"remark": "",
"chnname": "点击转化率"
},
{
"name": "oneClickCost",
"type": "INTEGER",
"remark": "",
"chnname": "平均点击花费"
},
{
"name": "updateTime",
"type": "DATETIME DEFAULT CURRENT_TIMESTAMP",
"remark": "",
"chnname": "更新时间"
}
],
"indexs": [],
"headers": [
{
"fieldName": "chnname",
"relationNoShow": false
},
{
"fieldName": "name",
"relationNoShow": false
},
{
"fieldName": "type",
"relationNoShow": false
},
{
"fieldName": "dataType",
"relationNoShow": true
},
{
"fieldName": "remark",
"relationNoShow": true
},
{
"fieldName": "pk",
"relationNoShow": false
},
{
"fieldName": "notNull",
"relationNoShow": true
},
{
"fieldName": "autoIncrement",
"relationNoShow": true
},
{
"fieldName": "defaultValue",
"relationNoShow": true
},
{
"fieldName": "relationNoShow",
"relationNoShow": true
},
{
"fieldName": "uiHint",
"relationNoShow": true
}
],
"chnname": "推广单元表"
},
{
"title": "promotionPlane",
"fields": [
{
"name": "id",
"type": "TEXT",
"remark": "",
"chnname": "id",
"pk": true,
"notNull": true
},
{
"name": "name",
"type": "TEXT",
"remark": "",
"chnname": "计划名"
},
{
"name": "shopId",
"type": "TEXT",
"remark": "",
"chnname": "店铺id"
},
{
"name": "price",
"type": "INTEGER",
"remark": "",
"chnname": "当前价格"
},
{
"name": "factor",
"type": "INTEGER",
"remark": "",
"chnname": "浮动值"
},
{
"name": "limitUpper",
"type": "INTEGER",
"remark": "",
"chnname": "价格上限"
},
{
"name": "limitLower",
"type": "INTEGER",
"remark": "",
"chnname": "价格下限"
},
{
"name": "priority",
"type": "INTEGER",
"remark": "",
"chnname": "优先级"
},
{
"name": "updateTime",
"type": "DATETIME DEFAULT CURRENT_TIMESTAMP",
"remark": "",
"chnname": "更新时间"
}
],
"indexs": [],
"headers": [
{
"fieldName": "chnname",
"relationNoShow": false
},
{
"fieldName": "name",
"relationNoShow": false
},
{
"fieldName": "type",
"relationNoShow": false
},
{
"fieldName": "dataType",
"relationNoShow": true
},
{
"fieldName": "remark",
"relationNoShow": true
},
{
"fieldName": "pk",
"relationNoShow": false
},
{
"fieldName": "notNull",
"relationNoShow": true
},
{
"fieldName": "autoIncrement",
"relationNoShow": true
},
{
"fieldName": "defaultValue",
"relationNoShow": true
},
{
"fieldName": "relationNoShow",
"relationNoShow": true
},
{
"fieldName": "uiHint",
"relationNoShow": true
}
],
"chnname": "推广计划表"
},
{
"title": "goodsPlane",
"fields": [
{
"name": "goodsId",
"type": "TEXT",
"remark": "",
"chnname": "商品id"
},
{
"name": "planeId",
"type": "TEXT",
"remark": "",
"chnname": "计划id"
}
],
"indexs": [],
"headers": [
{
"fieldName": "chnname",
"relationNoShow": false
},
{
"fieldName": "name",
"relationNoShow": false
},
{
"fieldName": "type",
"relationNoShow": false
},
{
"fieldName": "dataType",
"relationNoShow": true
},
{
"fieldName": "remark",
"relationNoShow": true
},
{
"fieldName": "pk",
"relationNoShow": false
},
{
"fieldName": "notNull",
"relationNoShow": true
},
{
"fieldName": "autoIncrement",
"relationNoShow": true
},
{
"fieldName": "defaultValue",
"relationNoShow": true
},
{
"fieldName": "relationNoShow",
"relationNoShow": true
},
{
"fieldName": "uiHint",
"relationNoShow": true
}
],
"chnname": "商品计划关联表"
}
],
"graphCanvas": {
"nodes": [
{
"shape": "table",
"title": "shop",
"moduleName": false,
"x": 190,
"y": 190,
"id": "859a95c3"
},
{
"shape": "table",
"title": "promotionUnit",
"moduleName": false,
"x": 1220,
"y": 270,
"id": "19a97042"
},
{
"shape": "table",
"title": "order",
"moduleName": false,
"x": 1180,
"y": 600,
"id": "54af0ea2",
"size": [
258.7050687896601,
165.24613895444793
]
},
{
"shape": "table",
"title": "goods",
"moduleName": false,
"x": 640,
"y": 640,
"id": "2fc473cf",
"size": [
179.9284573706168,
125.01970192460959
]
},
{
"shape": "table",
"title": "promotionPlane",
"moduleName": false,
"x": 710,
"y": 310,
"id": "85288b9e"
},
{
"shape": "table",
"title": "goodsPlane",
"moduleName": false,
"x": 240,
"y": 470,
"id": "a5dabea0"
}
],
"edges": [
{
"shape": "erdRelation",
"relation": "0,n:1",
"source": "859a95c3",
"target": "2fc473cf",
"id": "1aab3b3b",
"controlPoints": [
{
"x": 335.5576171875,
"y": 152.25
},
{
"x": 494.4423828125,
"y": 652.5895314387298
}
],
"sourceAnchor": 1,
"targetAnchor": 4
},
{
"shape": "erdRelation",
"relation": "0,n:1",
"source": "2fc473cf",
"target": "54af0ea2",
"id": "9bc80935",
"controlPoints": [
{
"x": 785.5576171875,
"y": 607.4607135463455
},
{
"x": 1024.14746560517,
"y": 564.731629745375
}
],
"sourceAnchor": 1,
"targetAnchor": 2
},
{
"shape": "erdRelation",
"relation": "0,n:1",
"source": "859a95c3",
"target": "19a97042",
"id": "c74241f9",
"controlPoints": [
{
"x": 335.5576171875,
"y": 152.25
},
{
"x": 1064.8916015625,
"y": 162.17424242424244
}
],
"sourceAnchor": 1,
"targetAnchor": 2
},
{
"shape": "erdRelation",
"relation": "0,n:1",
"source": "85288b9e",
"target": "19a97042",
"id": "dd50056d",
"controlPoints": [
{
"x": 855.5576171875,
"y": 242.17857142857144
},
{
"x": 1064.8916015625,
"y": 182.2348484848485
}
],
"sourceAnchor": 1,
"targetAnchor": 4
},
{
"shape": "erdRelation",
"relation": "0,n:1",
"source": "2fc473cf",
"target": "19a97042",
"id": "37fe073e",
"controlPoints": [
{
"x": 785.5576171875,
"y": 607.4607135463455
},
{
"x": 1064.8916015625,
"y": 202.29545454545456
}
],
"sourceAnchor": 1,
"targetAnchor": 6
},
{
"shape": "erdRelation",
"relation": "0,n:1",
"source": "2fc473cf",
"target": "a5dabea0",
"id": "38a732e0",
"controlPoints": [
{
"x": 494.4423828125,
"y": 607.4607135463455
},
{
"x": 332.0283203125,
"y": 472.5357142857143
}
],
"sourceAnchor": 0,
"targetAnchor": 1
},
{
"shape": "erdRelation",
"relation": "0,n:1",
"source": "859a95c3",
"target": "85288b9e",
"id": "9791a3ce",
"controlPoints": [
{
"x": 335.5576171875,
"y": 152.25
},
{
"x": 564.4423828125,
"y": 282.3690476190476
}
],
"sourceAnchor": 1,
"targetAnchor": 4
}
]
},
"associations": [
{
"relation": "0,n:1",
"from": {
"entity": "shop",
"field": "id"
},
"to": {
"entity": "goods",
"field": "shopId"
}
},
{
"relation": "0,n:1",
"from": {
"entity": "goods",
"field": "id"
},
"to": {
"entity": "order",
"field": "goodsId"
}
},
{
"relation": "0,n:1",
"from": {
"entity": "shop",
"field": "id"
},
"to": {
"entity": "promotionUnit",
"field": "shopId"
}
},
{
"relation": "0,n:1",
"from": {
"entity": "promotionPlane",
"field": "id"
},
"to": {
"entity": "promotionUnit",
"field": "planeId"
}
},
{
"relation": "0,n:1",
"from": {
"entity": "goods",
"field": "id"
},
"to": {
"entity": "promotionUnit",
"field": "goodsId"
}
},
{
"relation": "0,n:1",
"from": {
"entity": "goods",
"field": "id"
},
"to": {
"entity": "goodsPlane",
"field": "goodsId"
}
},
{
"relation": "0,n:1",
"from": {
"entity": "shop",
"field": "id"
},
"to": {
"entity": "promotionPlane",
"field": "shopId"
}
}
]
},
{
"name": "接口爬取模块",
"chnname": "接口爬取模块",
"entities": [],
"graphCanvas": {
"edges": []
}
}
],
"dataTypeDomains": {
"datatype": [
{
"name": "默认字串",
"code": "DefaultString",
"apply": {
"JAVA": {
"type": "String"
},
"MYSQL": {
"type": "VARCHAR(32)"
},
"ORACLE": {
"type": "NVARCHAR2(32)"
},
"SQLServer": {
"type": "NVARCHAR(32)"
},
"PostgreSQL": {
"type": "VARCHAR(32)"
}
}
},
{
"name": "标识号",
"code": "IdOrKey",
"apply": {
"JAVA": {
"type": "String"
},
"ORACLE": {
"type": "VARCHAR2(32)"
},
"MYSQL": {
"type": "VARCHAR(32)"
},
"SQLServer": {
"type": "VARCHAR(32)"
},
"PostgreSQL": {
"type": "VARCHAR(32)"
}
}
},
{
"name": "标识号-长",
"code": "LongKey",
"apply": {
"MYSQL": {
"type": "VARCHAR(64)"
},
"ORACLE": {
"type": "VARCHAR2(64)"
},
"JAVA": {
"type": "String"
},
"SQLServer": {
"type": "VARCHAR(64)"
},
"PostgreSQL": {
"type": "VARCHAR(64)"
}
}
},
{
"name": "名称",
"code": "Name",
"apply": {
"JAVA": {
"type": "String"
},
"MYSQL": {
"type": "VARCHAR(128)"
},
"ORACLE": {
"type": "NVARCHAR2(128)"
},
"SQLServer": {
"type": "NVARCHAR(128)"
},
"PostgreSQL": {
"type": "VARCHAR(128)"
}
}
},
{
"name": "备注说明",
"code": "Intro",
"apply": {
"JAVA": {
"type": "String"
},
"MYSQL": {
"type": "VARCHAR(512)"
},
"ORACLE": {
"type": "NVARCHAR2(512)"
},
"SQLServer": {
"type": "NVARCHAR(512)"
},
"PostgreSQL": {
"type": "VARCHAR(512)"
}
}
},
{
"name": "字串-短",
"code": "ShortString",
"apply": {
"JAVA": {
"type": "String"
},
"MYSQL": {
"type": "VARCHAR(128)"
},
"ORACLE": {
"type": "NVARCHAR2(128)"
},
"SQLServer": {
"type": "NVARCHAR(128)"
},
"PostgreSQL": {
"type": "VARCHAR(128)"
}
}
},
{
"name": "字串-中",
"code": "MiddleString",
"apply": {
"JAVA": {
"type": "String"
},
"MYSQL": {
"type": "VARCHAR(1024)"
},
"ORACLE": {
"type": "NVARCHAR2(1024)"
},
"SQLServer": {
"type": "NVARCHAR(1024)"
},
"PostgreSQL": {
"type": "VARCHAR(1024)"
}
}
},
{
"name": "字串-长",
"code": "LongString",
"apply": {
"JAVA": {
"type": "String"
},
"ORACLE": {
"type": "NVARCHAR2(3072)"
},
"MYSQL": {
"type": "VARCHAR(3072)"
},
"SQLServer": {
"type": "NVARCHAR(3072)"
},
"PostgreSQL": {
"type": "VARCHAR(3072)"
}
}
},
{
"name": "大文本",
"code": "LongText",
"apply": {
"JAVA": {
"type": "String"
},
"MYSQL": {
"type": "TEXT"
},
"ORACLE": {
"type": "CLOB"
},
"SQLServer": {
"type": "NTEXT"
},
"PostgreSQL": {
"type": "TEXT"
}
}
},
{
"name": "小数",
"code": "Double",
"apply": {
"JAVA": {
"type": "Double"
},
"MYSQL": {
"type": "DECIMAL(32,10)"
},
"ORACLE": {
"type": "NUMBER(32,10)"
},
"SQLServer": {
"type": "DECIMAL(32,10)"
},
"PostgreSQL": {
"type": "DECIMAL(32,10)"
}
}
},
{
"name": "比例",
"code": "Ratio",
"apply": {
"MYSQL": {
"type": "DECIMAL(4,2)"
},
"JAVA": {
"type": "Double"
},
"ORACLE": {
"type": "NUMBER(4,2)"
},
"SQLServer": {
"type": "DECIMAL(4,2)"
},
"PostgreSQL": {
"type": "DECIMAL(4,2)"
}
}
},
{
"name": "整数",
"code": "Integer",
"apply": {
"JAVA": {
"type": "Integer"
},
"MYSQL": {
"type": "INT"
},
"ORACLE": {
"type": "INT"
},
"SQLServer": {
"type": "INT"
},
"PostgreSQL": {
"type": "INT"
}
}
},
{
"name": "大整数",
"code": "BigInt",
"apply": {
"MYSQL": {
"type": "BIGINT"
},
"JAVA": {
"type": "Long"
},
"ORACLE": {
"type": "NUMBER"
},
"SQLServer": {
"type": "BIGINT"
},
"PostgreSQL": {
"type": "BIGINT"
}
}
},
{
"name": "金额",
"code": "Money",
"apply": {
"JAVA": {
"type": "Double"
},
"MYSQL": {
"type": "DECIMAL(32,8)"
},
"ORACLE": {
"type": "NUMBER(32,8)"
},
"SQLServer": {
"type": "DECIMAL(32,8)"
},
"PostgreSQL": {
"type": "DECIMAL(32,8)"
}
}
},
{
"name": "是否",
"code": "YesNo",
"apply": {
"JAVA": {
"type": "String"
},
"MYSQL": {
"type": "VARCHAR(1)"
},
"ORACLE": {
"type": "VARCHAR2(1)"
},
"SQLServer": {
"type": "VARCHAR(1)"
},
"PostgreSQL": {
"type": "VARCHAR(1)"
}
}
},
{
"name": "数据字典",
"code": "Dict",
"apply": {
"JAVA": {
"type": "String"
},
"MYSQL": {
"type": "VARCHAR(32)"
},
"ORACLE": {
"type": "VARCHAR2(32)"
},
"SQLServer": {
"type": "VARCHAR(32)"
},
"PostgreSQL": {
"type": "VARCHAR(32)"
}
}
},
{
"name": "日期",
"code": "Date",
"apply": {
"JAVA": {
"type": "Date"
},
"MYSQL": {
"type": "DATE"
},
"ORACLE": {
"type": "DATE"
},
"SQLServer": {
"type": "DATE"
},
"PostgreSQL": {
"type": "DATE"
}
}
},
{
"name": "日期时间",
"code": "DateTime",
"apply": {
"JAVA": {
"type": "Date"
},
"MYSQL": {
"type": "DATETIME"
},
"ORACLE": {
"type": "DATE"
},
"SQLServer": {
"type": "DATE"
},
"PostgreSQL": {
"type": "DATE"
}
}
},
{
"name": "单字符",
"code": "Char",
"apply": {
"MYSQL": {
"type": "CHAR(1)"
},
"ORACLE": {
"type": "CHAR(1)"
},
"JAVA": {
"type": "String"
},
"SQLServer": {
"type": "CHAR(1)"
},
"PostgreSQL": {
"type": "CHAR(1)"
}
}
},
{
"name": "sqlite文本",
"code": "TEXT",
"apply": {
"sqlite3": {
"type": "TEXT"
}
}
},
{
"name": "sqlite数字",
"code": "INTEGER",
"apply": {
"sqlite3": {
"type": "INTEGER"
}
}
},
{
"name": "最后更新时间",
"code": "DATETIME DEFAULT CURRENT_TIMESTAMP",
"apply": {
"sqlite3": {
"type": "DATETIME DEFAULT CURRENT_TIMESTAMP"
}
}
}
],
"database": [
{
"code": "MYSQL",
"template": "DROP TABLE {{=it.entity.title}};\n$blankline\nCREATE TABLE {{=it.entity.title}}(\n{{ pkList = [] ; }}\n{{~it.entity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}} {{= field.pk ? 'NOT NULL' : '' }} COMMENT '{{=it.func.join(field.chnname,field.remark,';')}}' {{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}})\n{{?}}\n) COMMENT = '{{=it.func.join(it.entity.chnname,it.entity.remark,';') }}'",
"fileShow": true,
"defaultDatabase": true,
"createTableTemplate": "CREATE TABLE {{=it.entity.title}}(\n{{ pkList = [] ; }}\n{{~it.entity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}} {{= field.notNull ? 'NOT NULL' : '' }} {{= field.autoIncrement ? 'AUTO_INCREMENT' : '' }} {{= field.defaultValue ? it.func.join('DEFAULT',field.defaultValue,' ') : '' }} COMMENT '{{=it.func.join(field.chnname,field.remark,' ')}}' {{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}})\n{{?}}\n) COMMENT = '{{=it.func.join(it.entity.chnname,it.entity.remark,' ') }}'{{=it.separator}}\n$blankline\n",
"deleteTableTemplate": "DROP TABLE {{=it.entity.title}}{{=it.separator}}",
"rebuildTableTemplate": "create table PDMAN_UP_{{=it.oldEntity.title}}\nas select * from {{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n\ndrop table {{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n\nCREATE TABLE {{=it.newEntity.title}}(\n{{ pkList = [] ; }}\n{{~it.newEntity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}} {{= field.notNull ? 'NOT NULL' : '' }} COMMENT '{{=it.func.join(field.chnname,field.remark,';')}}' {{= index < it.newEntity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}})\n{{?}}\n) COMMENT = '{{=it.func.join(it.newEntity.chnname,it.newEntity.remark,';') }}'{{=it.separator}}\n$blankline\n\n{{ sameCols = it.func.intersect(it.newEntity.fields,it.oldEntity.fields) ;}}\ninsert into {{=it.newEntity.title}}(\n{{~sameCols:field:index}}\n {{=field.name}}{{? index<sameCols.length-1}},{{?}}\n{{~}}\n) \nselect \n{{~sameCols:field:index}}\n {{=field.name}}{{? index<sameCols.length-1}},{{?}}\n{{~}}\nfrom PDMAN_UP_{{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n\ndrop table PDMAN_UP_{{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n{{~it.newEntity.indexs:index}}\nALTER TABLE {{=it.newEntity.title}} ADD {{? index.isUnique}}UNIQUE{{??}}INDEX{{?}} {{=index.name}}({{=it.func.join(...index.fields,',')}}){{=it.separator}}\n{{~}}",
"createFieldTemplate": "ALTER TABLE {{=it.entity.title}} ADD COLUMN {{=it.field.name}} {{=it.field.type}} {{? it.field.notNull}}NOT NULL{{?}} {{? it.field.defaultValue}}DEFAULT {{? null==it.field.defaultValue}}NULL{{??}}'{{=it.field.defaultValue}}'{{?}}{{?}} {{? it.field.autoIncrement}}AUTO_INCREMENT{{?}} {{? it.field.pk}}PRIMARY KEY{{?}} {{? it.field.chnname}}COMMENT '{{=it.field.chnname}}'{{?}} {{? it.field.addAfter}}AFTER {{=it.field.addAfter}}{{?}}{{=it.separator}}",
"updateFieldTemplate": "ALTER TABLE {{=it.entity.title}} MODIFY COLUMN {{=it.field.name}} {{=it.field.type}} {{? it.field.notNull}}NOT NULL{{?}} {{? it.field.defaultValue}}DEFAULT {{? null==it.field.defaultValue}}NULL{{??}}'{{=it.field.defaultValue}}'{{?}}{{?}} {{? it.field.autoIncrement}}AUTO_INCREMENT{{?}} {{? it.field.chnname}}COMMENT '{{=it.field.chnname}}'{{?}}{{=it.separator}}",
"deleteFieldTemplate": "ALTER TABLE {{=it.entity.title}} DROP {{=it.field.name}}{{=it.separator}}",
"deleteIndexTemplate": "ALTER TABLE {{=it.entity.title}} DROP INDEX {{=it.index.name}}{{=it.separator}}",
"createIndexTemplate": "ALTER TABLE {{=it.entity.title}} ADD {{? it.index.isUnique}}UNIQUE{{??}}INDEX{{?}} {{=it.index.name}}({{=it.func.join(...it.index.fields,',')}}){{=it.separator}}",
"updateTableComment": "ALTER TABLE {{=it.entity.title}} COMMENT '{{=it.entity.chnname}}'{{=it.separator}}"
},
{
"code": "ORACLE",
"template": "DROP TABLE {{=it.entity.title}}{{=it.separator}}\n$blankline\nCREATE TABLE {{=it.entity.title}}(\n{{ pkList = [] ; }}\n{{~it.entity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}} {{= field.pk ? 'NOT NULL' : '' }} {{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}})\n{{?}}\n){{=it.separator}}\n$blankline\nCOMMENT ON TABLE {{=it.entity.title}} IS '{{=it.func.join(it.entity.chnname,it.entity.remark,';') }}'{{=it.separator}}\n{{~it.entity.fields:field:index}}\nCOMMENT ON COLUMN {{=it.entity.title}}.{{=field.name}} IS '{{=it.func.join(field.chnname,field.remark,';')}}'{{=it.separator}}\n{{~}}",
"createTableTemplate": "CREATE TABLE {{=it.entity.title}}(\n{{ pkList = [] ; }}\n{{~it.entity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}}{{? field.defaultValue}} DEFAULT {{=field.defaultValue}}{{?}}{{= field.notNull ? ' NOT NULL' : '' }}{{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}})\n{{?}}\n){{=it.separator}}\n$blankline\n{{? it.entity.chnname || it.entity.remark}}COMMENT ON TABLE {{=it.entity.title}} IS {{? it.entity.remark}}'{{=it.entity.remark}}'{{??}}'{{=it.entity.chnname}}'{{?}}{{=it.separator}}{{?}}\n{{~it.entity.fields:field:index}}\n{{? field.chnname || field.remark}}COMMENT ON COLUMN {{=it.entity.title}}.{{=field.name}} IS {{? field.remark}}'{{=field.remark}}'{{??}}'{{=field.chnname}}'{{?}}{{=it.separator}}{{?}}\n{{~}}",
"deleteTableTemplate": "DROP TABLE {{=it.entity.title}}{{=it.separator}}\r\n$blankline",
"rebuildTableTemplate": "CREATE TABLE PDMAN_UP_{{=it.oldEntity.title}}\nAS SELECT * FROM {{=it.oldEntity.title}}{{=it.separator}}\n$blankline\nDROP TABLE {{=it.oldEntity.title}}{{=it.separator}}\n$blankline\nCREATE TABLE {{=it.newEntity.title}}(\n{{ pkList = [] ; }}{{~it.newEntity.fields:field:index}}{{? field.pk }}{{ pkList.push(field.name) }}{{?}} {{=field.name}} {{=field.type}}{{? field.defaultValue}} DEFAULT {{=field.defaultValue}}{{?}}{{= field.notNull ? ' NOT NULL' : '' }}{{= index < it.newEntity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}{{? pkList.length >0 }} PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}}){{?}}\n){{=it.separator}}\n$blankline\n{{? it.newEntity.chnname || it.newEntity.remark}}COMMENT ON TABLE {{=it.newEntity.title}} IS {{? it.newEntity.remark}}'{{=it.entity.remark}}'{{??}}'{{=it.newEntity.chnname}}'{{?}};{{?}}{{=it.separator}}\n{{~it.newEntity.fields:field:index}}\n{{? field.chnname || field.remark}}COMMENT ON COLUMN {{=it.newEntity.title}}.{{=field.name}} IS {{? field.remark}}'{{=field.remark}}'{{??}}'{{=field.chnname}}'{{?}};{{?}}{{=it.separator}}\n{{~}}\n{{ sameCols = it.func.intersect(it.newEntity.fields,it.oldEntity.fields) ;}}\n$blankline\nINSERT INTO {{=it.newEntity.title}}(\n{{~sameCols:field:index}} {{=field.name}}{{? index<sameCols.length-1}},{{?}}\n{{~}}) \nSELECT\n{{~sameCols:field:index}} {{=field.name}}{{? index<sameCols.length-1}},{{?}}\n{{~}}FROM PDMAN_UP_{{=it.oldEntity.title}}{{=it.separator}}\n\nDROP TABLE PDMAN_UP_{{=it.oldEntity.title}}{{=it.separator}}\n{{~it.newEntity.indexs:index}}\nCREATE{{? index.isUnique}} UNIQUE{{?}} INDEX {{=index.name}} ON {{=it.newEntity.title}}({{=it.func.join(index.fields,',')}}){{=it.separator}}\n{{~}}",
"createFieldTemplate": "ALTER TABLE {{=it.entity.title}} ADD({{=it.field.name}} {{=it.field.type}}{{? it.field.defaultValue}} DEFAULT {{=it.field.defaultValue}}{{?}}{{? it.field.notNull}} NOT NULL{{?}}){{=it.separator}}\r\n{{? it.field.chnname || it.field.remark}}COMMENT ON COLUMN {{=it.entity.title}}.{{=it.field.name}} IS {{? it.field.remark}}'{{=it.field.remark}}'{{??}}'{{=it.field.chnname}}'{{?}}{{=it.separator}}{{?}}\r\n$blankline",
"updateFieldTemplate": "ALTER TABLE {{=it.entity.title}} MODIFY({{=it.field.name}} {{=it.field.type}}{{? it.field.defaultValue}} DEFAULT {{=it.field.defaultValue}}{{?}}{{? it.field.notNull}} NOT NULL{{?}}){{=it.separator}}\r\n{{? it.field.chnname || it.field.remark}}COMMENT ON COLUMN {{=it.entity.title}}.{{=it.field.name}} IS {{? it.field.remark}}'{{=it.field.remark}}'{{??}}'{{=it.field.chnname}}'{{?}}{{=it.separator}}{{=it.separator}}{{?}}\r\n$blankline",
"deleteFieldTemplate": "ALTER TABLE {{=it.entity.title}} DROP({{=it.field.name}}){{=it.separator}}\r\n$blankline",
"deleteIndexTemplate": "DROP INDEX {{=it.entity.title}}.{{=it.index.name}}{{=it.separator}}\r\n$blankline",
"createIndexTemplate": "CREATE{{? it.index.isUnique}} UNIQUE{{?}} INDEX {{=it.index.name}} ON {{=it.entity.title}}({{=it.func.join(it.index.fields,',')}}){{=it.separator}}\r\n$blankline",
"updateTableComment": "{{? it.entity.chnname || it.entity.remark}}COMMENT ON TABLE {{=it.entity.title}} IS {{? it.entity.remark}}'{{=it.entity.remark}}'{{??}}'{{=it.entity.chnname}}'{{?}}{{=it.separator}}{{?}}\r\n$blankline"
},
{
"code": "SQLServer",
"createTableTemplate": "CREATE TABLE {{=it.entity.title}}(\n{{ pkList = [] ; }}\n{{~it.entity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}} {{= field.notNull ? 'NOT NULL' : '' }} {{= field.autoIncrement ? 'IDENTITY(1,1)' : '' }} {{= field.defaultValue ? it.func.join('DEFAULT',field.defaultValue,' ') : '' }} {{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n CONSTRAINT PK_{{=it.entity.title}} PRIMARY KEY CLUSTERED ({{~pkList:pkName:i}}{{= pkName }} ASC {{= i<pkList.length-1 ? ',' : '' }}{{~}}) ON [PRIMARY] \n{{?}}\n){{=it.separator}}\n\n$blankline\nEXECUTE sp_addextendedproperty N'MS_Description', '{{= it.entity.chnname || it.entity.remark}}', N'user', N'dbo', N'table', N'{{=it.entity.title}}', NULL, NULL{{=it.separator}}\n{{~it.entity.fields:field:index}}\n{{? field.chnname || field.remark}}EXECUTE sp_addextendedproperty N'MS_Description', {{? field.remark}}'{{=field.remark}}'{{??}}'{{=field.chnname}}'{{?}}, N'user', N'dbo', N'table', N'{{=it.entity.title}}', N'column', N'{{=field.name}}'{{=it.separator}}{{?}}\n{{~}}\n",
"deleteTableTemplate": "",
"rebuildTableTemplate": "",
"createFieldTemplate": "",
"updateFieldTemplate": "",
"deleteFieldTemplate": "",
"deleteIndexTemplate": "",
"createIndexTemplate": "",
"updateTableComment": ""
},
{
"code": "PostgreSQL",
"template": "DROP TABLE {{=it.entity.title}};\n$blankline\nCREATE TABLE {{=it.entity.title}}(\n{{ pkList = [] ; }}\n{{~it.entity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}} {{= field.pk ? 'NOT NULL' : '' }} COMMENT '{{=it.func.join(field.chnname,field.remark,';')}}' {{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}})\n{{?}}\n) COMMENT = '{{=it.func.join(it.entity.chnname,it.entity.remark,';') }}'",
"createTableTemplate": "CREATE TABLE {{=it.entity.title}}(\n{{ pkList = [] ; }}\n{{~it.entity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}}{{? field.defaultValue}} DEFAULT {{=field.defaultValue}}{{?}}{{= field.notNull ? ' NOT NULL' : '' }}{{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}})\n{{?}}\n){{=it.separator}}\n$blankline\n{{? it.entity.chnname || it.entity.remark}}COMMENT ON TABLE {{=it.entity.title}} IS {{? it.entity.remark}}'{{=it.entity.remark}}'{{??}}'{{=it.entity.chnname}}'{{?}}{{=it.separator}}{{?}}\n{{~it.entity.fields:field:index}}\n{{? field.chnname || field.remark}}COMMENT ON COLUMN {{=it.entity.title}}.{{=field.name}} IS {{? field.remark}}'{{=field.remark}}'{{??}}'{{=field.chnname}}'{{?}}{{=it.separator}}{{?}}\n{{~}}",
"deleteTableTemplate": "DROP TABLE {{=it.entity.title}}{{=it.separator}}",
"rebuildTableTemplate": "create table PDMAN_UP_{{=it.oldEntity.title}}\nas select * from {{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n\ndrop table {{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n\nCREATE TABLE {{=it.newEntity.title}}(\n{{ pkList = [] ; }}\n{{~it.newEntity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}} {{= field.notNull ? 'NOT NULL' : '' }} COMMENT '{{=it.func.join(field.chnname,field.remark,';')}}' {{= index < it.newEntity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}})\n{{?}}\n) COMMENT = '{{=it.func.join(it.newEntity.chnname,it.newEntity.remark,';') }}'{{=it.separator}}\n$blankline\n\n{{ sameCols = it.func.intersect(it.newEntity.fields,it.oldEntity.fields) ;}}\ninsert into {{=it.newEntity.title}}(\n{{~sameCols:field:index}}\n {{=field.name}}{{? index<sameCols.length-1}},{{?}}\n{{~}}\n) \nselect \n{{~sameCols:field:index}}\n {{=field.name}}{{? index<sameCols.length-1}},{{?}}\n{{~}}\nfrom PDMAN_UP_{{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n\ndrop table PDMAN_UP_{{=it.oldEntity.title}}{{=it.separator}}",
"createFieldTemplate": "ALTER TABLE {{=it.entity.title}} ADD COLUMN {{=it.field.name}} {{=it.field.type}} {{? it.field.notNull}}NOT NULL{{?}} {{? it.field.defaultValue}}DEFAULT {{? null==it.field.defaultValue}}NULL{{??}}'{{=it.field.defaultValue}}'{{?}}{{?}} {{? it.field.autoIncrement}}AUTO_INCREMENT{{?}} {{? it.field.pk}}PRIMARY KEY{{?}} {{? it.field.chnname}}COMMENT '{{=it.field.chnname}}'{{?}} {{? it.field.addAfter}}AFTER {{=it.field.addAfter}}{{?}}{{=it.separator}}",
"updateFieldTemplate": "ALTER TABLE {{=it.entity.title}} MODIFY COLUMN {{=it.field.name}} {{=it.field.type}} {{? it.field.notNull}}NOT NULL{{?}} {{? it.field.defaultValue}}DEFAULT {{? null==it.field.defaultValue}}NULL{{??}}'{{=it.field.defaultValue}}'{{?}}{{?}} {{? it.field.autoIncrement}}AUTO_INCREMENT{{?}} {{? it.field.chnname}}COMMENT '{{=it.field.chnname}}'{{?}}{{=it.separator}}",
"deleteFieldTemplate": "ALTER TABLE {{=it.entity.title}} DROP {{=it.field.name}}{{=it.separator}}",
"deleteIndexTemplate": "ALTER TABLE {{=it.entity.title}} DROP INDEX {{=it.index.name}}{{=it.separator}}",
"createIndexTemplate": "ALTER TABLE {{=it.entity.title}} ADD {{? it.index.isUnique}}UNIQUE{{??}}INDEX{{?}} {{=it.index.name}}({{=it.func.join(...it.index.fields,',')}}){{=it.separator}}",
"updateTableComment": "ALTER TABLE {{=it.entity.title}} COMMENT '{{=it.entity.chnname}}'{{=it.separator}}"
},
{
"code": "JAVA",
"template": "package group.rober.pdman.{{=it.module.name}}.entity;\n$blankline\nimport javax.persistence.*;\nimport java.io.Serializable;\nimport java.util.Date;\n$blankline\n$blankline\n\n/** {{=it.entity.chnname}} */\n@Table(name=\"{{=it.entity.title}}\")\npublic class {{=it.func.camel(it.entity.title,true) }} implements Serializable,Cloneable{\n{{~it.entity.fields:field:index}}\n /** {{=it.func.join(field.chnname,field.remark,';')}} */\n {{? field.pk }}\n @Id\n @GeneratedValue\n {{?}}\n private {{=field.type}} {{=it.func.camel(field.name,false)}} ;\n{{~}}\n$blankline\n{{~it.entity.fields:field:index}}\n /** {{=it.func.join(field.chnname,field.remark,';')}} */\n public {{=field.type}} get{{=it.func.camel(field.name,true)}}(){\n return this.{{=it.func.camel(field.name,false)}};\n }\n /** {{=it.func.join(field.chnname,field.remark,';')}} */\n public void set{{=it.func.camel(field.name,true)}}({{=field.type}} {{= it.func.camel(field.name,false) }}){\n this.{{=it.func.camel(field.name,false)}} = {{= it.func.camel(field.name,false) }};\n }\n{{~}}\n}",
"createTableTemplate": "package group.rober.pdman.{{=it.module.name}}.entity;\n$blankline\nimport javax.persistence.*;\nimport java.io.Serializable;\nimport java.util.Date;\n$blankline\n$blankline\n@Table(name=\"{{=it.entity.title}}\")\npublic class {{=it.func.camel(it.entity.title,true) }} implements Serializable,Cloneable{\n{{~it.entity.fields:field:index}}\n /** {{=it.func.join(field.chnname,field.remark,';')}} */\n {{? field.pk }}\n @Id\n @GeneratedValue\n {{?}}\n private {{=field.type}} {{=it.func.camel(field.name,false)}} ;\n{{~}}\n$blankline\n{{~it.entity.fields:field:index}}\n /** {{=it.func.join(field.chnname,field.remark,';')}} */\n public {{=field.type}} get{{=it.func.camel(field.name,true)}}(){\n return this.{{=it.func.camel(field.name,false)}};\n }\n /** {{=it.func.join(field.chnname,field.remark,';')}} */\n public void set{{=it.func.camel(field.name,true)}}({{=field.type}} {{= it.func.camel(field.name,false) }}){\n this.{{=it.func.camel(field.name,false)}} = {{= it.func.camel(field.name,false) }};\n }\n{{~}}\n}",
"deleteTableTemplate": "",
"rebuildTableTemplate": "",
"createFieldTemplate": "",
"updateFieldTemplate": "",
"deleteFieldTemplate": "",
"deleteIndexTemplate": "",
"createIndexTemplate": "",
"updateTableComment": ""
},
{
"code": "sqlite3",
"createTableTemplate": "{{~it.entity.fields:field:index}}\n \"{{=field.name}}\": \"{{=field.type}} {{= field.notNull ? 'NOT NULL' : '' }}\",//{{=it.func.join(field.chnname,field.remark,' ')}}\n{{~}}",
"deleteTableTemplate": "DROP TABLE {{=it.entity.title}}{{=it.separator}}",
"rebuildTableTemplate": "create table PDMAN_UP_{{=it.oldEntity.title}}\nas select * from {{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n\ndrop table {{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n\nCREATE TABLE {{=it.newEntity.title}}(\n{{ pkList = [] ; }}\n{{~it.newEntity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}} {{= field.notNull ? 'NOT NULL' : '' }} COMMENT '{{=it.func.join(field.chnname,field.remark,';')}}' {{= index < it.newEntity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i<pkList.length-1 ? ',' : '' }}{{~}})\n{{?}}\n) COMMENT = '{{=it.func.join(it.newEntity.chnname,it.newEntity.remark,';') }}'{{=it.separator}}\n$blankline\n\n{{ sameCols = it.func.intersect(it.newEntity.fields,it.oldEntity.fields) ;}}\ninsert into {{=it.newEntity.title}}(\n{{~sameCols:field:index}}\n {{=field.name}}{{? index<sameCols.length-1}},{{?}}\n{{~}}\n) \nselect \n{{~sameCols:field:index}}\n {{=field.name}}{{? index<sameCols.length-1}},{{?}}\n{{~}}\nfrom PDMAN_UP_{{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n\ndrop table PDMAN_UP_{{=it.oldEntity.title}}{{=it.separator}}\n$blankline\n{{~it.newEntity.indexs:index}}\nALTER TABLE {{=it.newEntity.title}} ADD {{? index.isUnique}}UNIQUE{{??}}INDEX{{?}} {{=index.name}}({{=it.func.join(...index.fields,',')}}){{=it.separator}}\n{{~}}",
"createFieldTemplate": "ALTER TABLE {{=it.entity.title}} ADD COLUMN {{=it.field.name}} {{=it.field.type}} {{? it.field.notNull}}NOT NULL{{?}} {{? it.field.defaultValue}}DEFAULT {{? null==it.field.defaultValue}}NULL{{??}}'{{=it.field.defaultValue}}'{{?}}{{?}} {{? it.field.autoIncrement}}AUTO_INCREMENT{{?}} {{? it.field.pk}}PRIMARY KEY{{?}} {{? it.field.chnname}}COMMENT '{{=it.field.chnname}}'{{?}} {{? it.field.addAfter}}AFTER {{=it.field.addAfter}}{{?}}{{=it.separator}}",
"updateFieldTemplate": "ALTER TABLE {{=it.entity.title}} MODIFY COLUMN {{=it.field.name}} {{=it.field.type}} {{? it.field.notNull}}NOT NULL{{?}} {{? it.field.defaultValue}}DEFAULT {{? null==it.field.defaultValue}}NULL{{??}}'{{=it.field.defaultValue}}'{{?}}{{?}} {{? it.field.autoIncrement}}AUTO_INCREMENT{{?}} {{? it.field.chnname}}COMMENT '{{=it.field.chnname}}'{{?}}{{=it.separator}}",
"deleteFieldTemplate": "ALTER TABLE {{=it.entity.title}} DROP {{=it.field.name}}{{=it.separator}}",
"deleteIndexTemplate": "ALTER TABLE {{=it.entity.title}} DROP INDEX {{=it.index.name}}{{=it.separator}}",
"createIndexTemplate": "ALTER TABLE {{=it.entity.title}} ADD {{? it.index.isUnique}}UNIQUE{{??}}INDEX{{?}} {{=it.index.name}}({{=it.func.join(...it.index.fields,',')}}){{=it.separator}}",
"updateTableComment": "ALTER TABLE {{=it.entity.title}} COMMENT '{{=it.entity.chnname}}'{{=it.separator}}"
}
]
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
NodeJS
1
https://gitee.com/qingfengpark/koa2-typescript.git
git@gitee.com:qingfengpark/koa2-typescript.git
qingfengpark
koa2-typescript
koa2-typescript
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385