| | |
| | | select fn_rec_query(depid,'dep') depName,fn_rec_query(dirid,'dir') dirName,fn_ver(verid) verName,fn_uname(createuser) createName,fn_uname(updateuser) updateName from bd.dlg_agnp limit 5; |
| | | |
| | | select ns,tab from lf.sys_dict a where not exists (select id from lf.sys_dict b where b.ns=a.ns and b.tab=a.tab and b.field='gid') group by ns,tab; -- 查询字典中不存在gid的表 |
| | | ---------------------------------------------------------------------------------------------- |
| | | -- 10进制转62进制 |
| | | WITH RECURSIVE T(N, S) AS ( |
| | | SELECT 3843::NUMERIC(30, 0) N, '' S |
| | | UNION ALL |
| | | SELECT trunc(N / 62)::NUMERIC(30, 0), substr('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', (N % 62)::INT + 1, 1) || S FROM T WHERE N > 0 |
| | | ) |
| | | SELECT S FROM T WHERE N = 0; |
| | | |
| | | -- 62进制转10进制 |
| | | WITH RECURSIVE T(S, N) AS ( |
| | | SELECT 'ZZ' S, 0::NUMERIC N |
| | | UNION ALL |
| | | SELECT SUBSTR(S, 2), (POWER(62, LENGTH(S)::NUMERIC - 1) * (strpos('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', SUBSTR(S, 1, 1)) - 1) + N) FROM T WHERE LENGTH(S) > 0 |
| | | ) |
| | | SELECT N::NUMERIC(30, 0) FROM T WHERE LENGTH(S) < 1; |
| | | ---------------------------------------------------------------------------------------------- -1.测试 |
| | | select id,name from lf.sys_dir where name in ('测量(ESV)','勘察(EGE)','地灾(EGD)','洞库(EGD)') order by name; |
| | | |
| | |
| | | select fn_rec_array(1, 'dep') |
| | | select count(*) from lf.sys_meta where depid = ANY(fn_rec_array(1, 'dep')); |
| | | select count(*) from bd.dlg_25w_lrdl where depid = ANY(fn_rec_array(1, 'dep')); |
| | | ----------------------------------------------------------------------------------------------------- 10.路径分析 |
| | | ----------------------------------------------------------------------------------------------------- 10.10进制转62进制 |
| | | -- drop function fn_10to62(numeric); |
| | | create or replace function fn_10to62(num numeric(30, 0)) |
| | | returns varchar as $$ |
| | | declare |
| | | rs varchar; |
| | | begin |
| | | WITH RECURSIVE T(N, S) AS ( |
| | | SELECT num N, '' S |
| | | UNION ALL |
| | | SELECT trunc(N / 62)::NUMERIC(30, 0), substr('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', (N % 62)::INT + 1, 1) || S FROM T WHERE N > 0 |
| | | ) |
| | | SELECT S INTO rs FROM T WHERE N = 0; |
| | | |
| | | return rs; |
| | | end; |
| | | $$ language plpgsql; |
| | | |
| | | select fn_10to62(3843); |
| | | ----------------------------------------------------------------------------------------------------- 11.62进制转10进制 |
| | | -- drop function fn_62to10(numeric); |
| | | create or replace function fn_62to10(ch varchar) |
| | | returns numeric as $$ |
| | | declare |
| | | rs numeric(30, 0); |
| | | begin |
| | | WITH RECURSIVE T(S, N) AS ( |
| | | SELECT ch S, 0::NUMERIC N |
| | | UNION ALL |
| | | SELECT SUBSTR(S, 2), (POWER(62, LENGTH(S)::NUMERIC - 1) * (strpos('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', SUBSTR(S, 1, 1)) - 1) + N) FROM T WHERE LENGTH(S) > 0 |
| | | ) |
| | | SELECT N INTO rs FROM T WHERE LENGTH(S) < 1; |
| | | |
| | | return rs; |
| | | end; |
| | | $$ language plpgsql; |
| | | |
| | | select fn_62to10('zz'); |
| | | ----------------------------------------------------------------------------------------------------- 12.路径分析 |
| | | -- 删除已存在的函数 |
| | | drop function pgr_fromAtoB(varchar, double precision, double precision, double precision, double precision); |
| | | |
| | |
| | | public final static String MPT = ".mpt"; |
| | | |
| | | /** |
| | | * 3DML文件 |
| | | */ |
| | | public final static String _3DML = ".3dml"; |
| | | |
| | | /** |
| | | * TIF文件 |
| | | */ |
| | | public final static String TIF = ".tif"; |
| | |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.all.SettingData; |
| | | import com.lf.server.entity.all.StaticData; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | |
| | | private final static String UNKNOWN = "unknown"; |
| | | |
| | | private final static String COMMA = ","; |
| | | |
| | | private final static Log log = LogFactory.getLog(WebHelper.class); |
| | | |
| | | /** |
| | | * 获取GUID |
| | |
| | | outputStream.close(); |
| | | fileInputStream.close(); |
| | | } |
| | | |
| | | /** |
| | | * 执行命令 |
| | | * |
| | | * @param cmd 命令 |
| | | */ |
| | | public static void exec(String cmd) { |
| | | try { |
| | | Runtime.getRuntime().exec(cmd); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | } |
| | |
| | | name: prod |
| | | # JDBC 基本配置 ¤tSchema=public |
| | | url: jdbc:postgresql://192.168.20.205:5433/langfang?useAffectedRows=true |
| | | #url: jdbc:postgresql://pipe.cppe.com:5433/langfang?useAffectedRows=true |
| | | #url: jdbc:postgresql://127.0.0.1:5433/langfang?useAffectedRows=true |
| | | username : postgres |
| | | password: Postgres!_14_Lf |
| | | #password: postgres |