| | |
| | | select concat(gb, '_', name) from bd.dlg_agnp limit 10; |
| | | select ST_AsText(geom) "geom", a.*, fn_get_fullname(a.depid, 1) depName, fn_get_fullname(a.dirid, 2) dirName, fn_uname(create_user) createName, fn_uname(update_user) updateName from lf.sys_publish a |
| | | |
| | | select * from lf.sys_fme_log order by id desc limit 10; -- 255 > |
| | | select * from lf.sys_meta order by id desc limit 10; -- 1723 > |
| | | -- 删除冗余数据,修复tab_guid值 |
| | | select id,name,path,tab,tab_guid from lf.sys_attach where tab != 'bd.b_borehole' order by id desc limit 200; |
| | | |
| | | select * from lf.sys_fme_log |
| | | where count > 0 and update_time is null and create_time > now()::timestamp + '-1 min' |
| | | select * from bs.s_explorationpoint where parentid='df3ee967-3eb8-4685-b49c-d0ae06918069' |
| | | select * from lf.sys_dir where pid=0 order by id |
| | | select * from lf.sys_fme_log order by id desc limit 15; -- 255 > |
| | | select * from lf.sys_meta order by id desc limit 15; -- 1723 > |
| | | select * from lf.sys_attach where tab != 'bd.b_borehole' order by id desc limit 50; -- 358042 |
| | | select * from lf.sys_meta where tab is not null order by id desc |
| | | |
| | | select * from bs.s_explorationpoint |
| | | select * from lf.sys_attach order by id desc limit 100; -- 358042 |
| | | |
| | | insert into lf.sys_attach (name, guid, path, sizes, create_user, tab, tab_guid) |
| | | select name, guid, path, sizes, create_user, 'bs.s_explorationpoint', '8de99768-1da3-4784-9423-bb026411fa48' |
| | | from lf.sys_meta |
| | | where name = 'PH02T01-CR004-C04#EGE-DW-0105.pdf' and create_time > now()::timestamp + '-10 min' |
| | | order by id desc |
| | | limit 1; |
| | | |
| | | |
| | | |
| | |
| | | @Autowired |
| | | ScheduleService scheduleService; |
| | | |
| | | private static boolean isBusy = false; |
| | | |
| | | private static final Log log = LogFactory.getLog(ScheduleConfig.class); |
| | | |
| | | @Scheduled(fixedRate = 15 * 1000) |
| | |
| | | public void syncAttaches() { |
| | | try { |
| | | List<FmeLogEntity> list = attachService.selectFmeLogs(); |
| | | if (null == list || list.isEmpty()) { |
| | | if (isBusy || null == list || list.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | isBusy = true; |
| | | for (FmeLogEntity entity : list) { |
| | | attachService.updateFmeLog(entity.getId()); |
| | | attachService.syncAttaches(entity); |
| | | attachService.updateFmeLog(entity.getId()); |
| | | } |
| | | isBusy = false; |
| | | } catch (Exception ex) { |
| | | isBusy = false; |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | |
| | | * 获取删除表记录SQL |
| | | */ |
| | | public String getDelTabsSql(List<MetaEntity> metas) { |
| | | List<String> list = getTabDeletes(metas, metas.get(0).getTab()); |
| | | addCascadDeletes(list); |
| | | addAttachDeletes(list); |
| | | |
| | | return StringHelper.join(list, ";"); |
| | | } |
| | | |
| | | private List<String> getTabDeletes(List<MetaEntity> metas, String tab) { |
| | | List<String> list = new ArrayList<>(); |
| | | String tab = metas.get(0).getTab(); |
| | | |
| | | List<String> pids = new ArrayList<>(); |
| | | for (MetaEntity me : metas) { |
| | |
| | | list.add(String.format("delete from %s where parentid in (%s)", tab, StringHelper.join(pids, ","))); |
| | | } |
| | | |
| | | // 关联删除 |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 添加级联删除 |
| | | */ |
| | | private void addCascadDeletes(List<String> list) { |
| | | int i = 0, c = list.size(); |
| | | while (i < c) { |
| | | String str = list.get(i); |
| | |
| | | |
| | | i++; |
| | | } |
| | | } |
| | | |
| | | return StringHelper.join(list, ";"); |
| | | /** |
| | | * 添加附件删除 |
| | | */ |
| | | private void addAttachDeletes(List<String> list) { |
| | | int i = 0, c = list.size(); |
| | | while (i < c) { |
| | | String str = list.get(i); |
| | | String tab = str.substring("delete from ".length(), str.indexOf(" where ")); |
| | | String select = str.replace("delete ", "select eventid "); |
| | | |
| | | list.add(String.format("delete from lf.sys_attach where tab='%s' and tab_guid in (%s)", tab, select)); |
| | | |
| | | i++; |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | datasource: |
| | | name: prod |
| | | # JDBC 基本配置 ¤tSchema=public |
| | | url: jdbc:postgresql://103.85.165.99:5433/langfang?useAffectedRows=true |
| | | #url: jdbc:postgresql://103.85.165.99:5433/langfang?useAffectedRows=true |
| | | #url: jdbc:postgresql://192.168.20.205:5433/langfang?useAffectedRows=true |
| | | #url: jdbc:postgresql://127.0.0.1:5433/langfang?useAffectedRows=true |
| | | url: jdbc:postgresql://127.0.0.1:5433/langfang?useAffectedRows=true |
| | | username : postgres |
| | | password: Postgres!_14_Lf |
| | | #password: postgres |
| | | #password: Postgres!_14_Lf |
| | | password: postgres |
| | | driver-class-name: org.postgresql.Driver |
| | | paltform: POSTGRESQL |
| | | type: com.alibaba.druid.pool.DruidDataSource |