目录
1 增加
2 删除
3 查询
4 更新
"public"."JGSQGW_Geo"为某模式下得表 一般postgrel有这样的设计模式
1 增加
#前端绘制出的数据插入
INSERT INTO "public"."JGSQGW_Geo" ( "geom","gridone","gridonebsm","gridtwo","gridtwobsm","type","bsm" ) VALUES (
ST_GeomFromText('MULTIPOLYGON (((115.77640535603713 28.204126934984522, 115.7834195975232 28.203722724458206,
115.77892572755417 28.19677981424149, 115.77640535603713 28.204126934984522)))', 4490),null,null,null,null,null,null)
#QGis绘制得数据插入
INSERT INTO "public"."JGSQGW_Geo"("geom","gridone","gridonebsm","gridtwo","gridtwobsm","type","bsm")
VALUES (st_multi(st_geomfromwkb($1::bytea,4490)),NULL,NULL,NULL,NULL,NULL,NULL) RETURNING "id"
2 删除
DELETE FROM "public"."JGSQGW_Geo" WHERE id>17
3 查询
SELECT * FROM "public"."JGSQGW_Geo" LIMIT 100
4 更新
UPDATE "public"."JGSQGW_Geo" SET "geom" = ST_GeomFromText('MULTIPOLYGON (((116.79316096688741 28.192370357615896,
115.79606901 28.19830155, 115.79366752 28.18805362, 115.79007718 28.19397412, 116.79316096688741 28.192370357615896)))',
4490),"gridone" = NULL,"gridonebsm" = NULL,"gridtwo" = NULL,"gridtwobsm" = NULL,"type" = NULL,"bsm" = NULL WHERE ("id" = '133')