| | |
| | | where pipename is not null and not ST_IsEmpty(geom) |
| | | order by pipename, segname; |
| | | |
| | | select workname from bs.s_survey_information;; |
| | | select * from bs.s_surveyworksite; |
| | | select * from bs.s_survey_information; |
| | | update bs.s_survey_information set workname='汉江穿越' where gid=1; |
| | | select * from bs.s_explorationpoint where upper(exppointid) like '%XK0%'; |
| | | |
| | | |
| | | |
| | | select * from lf.sys_user where uid='FME'; |
| | | select * from lf.sys_token where token='c36e4f94-dfde-401e-9967-2c4a449f1300'; |
| | | update lf.sys_token set type=1,create_user=61,duration=5256000,create_time='2023-03-03 19:00:00',expire='2033-03-03 19:00:00' |
| | | where token='c36e4f94-dfde-401e-9967-2c4a449f1300'; |
| | | |
| | | |
| | | |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询所有表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "点") |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "点"), |
| | | @ApiImplicitParam(name = "hasGeom", value = "含有Geom字段", dataType = "Boolean", paramType = "query", example = "false") |
| | | }) |
| | | @GetMapping(value = "/selectTabs") |
| | | public ResponseMsg<List<TabEntity>> selectTabs(String name) { |
| | | public ResponseMsg<List<TabEntity>> selectTabs(String name, Boolean hasGeom) { |
| | | try { |
| | | List<TabEntity> list = dictService.selectDictTab(name); |
| | | List<TabEntity> list = dictService.selectDictTab(name, null == hasGeom || !hasGeom ? "gid" : "geom"); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | |
| | | @ApiImplicitParam(name = "depcode", value = "单位编码", dataType = "String", paramType = "query", example = "00"), |
| | | @ApiImplicitParam(name = "dirs", value = "目录编码", dataType = "String", paramType = "query", example = "00,01"), |
| | | @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "dlg_"), |
| | | @ApiImplicitParam(name = "hasGeom", value = "含有Geom字段", dataType = "Boolean", paramType = "query", example = "false"), |
| | | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | public ResponseMsg<Object> selectTabsByPage(String depcode, String dirs, String tab, Integer pageSize, Integer pageIndex) { |
| | | public ResponseMsg<Object> selectTabsByPage(String depcode, String dirs, String tab, Boolean hasGeom, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("每页页数或分页数小于1", null); |
| | |
| | | filters += String.format(" and (%s)", dirs); |
| | | } |
| | | |
| | | int count = baseQueryService.selectTabsForCount(tab); |
| | | String field = null == hasGeom || !hasGeom ? "gid" : "geom"; |
| | | int count = baseQueryService.selectTabsForCount(tab, field); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<TabEntity> rs = baseQueryService.selectTabsByPage(tab, filters, pageSize, pageSize * (pageIndex - 1)); |
| | | List<TabEntity> rs = baseQueryService.selectTabsByPage(tab, field, filters, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询字典表结构") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "点") |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "点"), |
| | | @ApiImplicitParam(name = "hasGeom", value = "含有Geom字段", dataType = "Boolean", paramType = "query", example = "false") |
| | | }) |
| | | @GetMapping(value = "/selectDictTab") |
| | | public ResponseMsg<List<TabEntity>> selectDictTab(String name) { |
| | | public ResponseMsg<List<TabEntity>> selectDictTab(String name, Boolean hasGeom) { |
| | | try { |
| | | List<TabEntity> list = dictService.selectDictTab(name); |
| | | List<TabEntity> list = dictService.selectDictTab(name, null == hasGeom || !hasGeom ? "gid" : "geom"); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询值域表集合") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "b_") |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "b_"), |
| | | @ApiImplicitParam(name = "hasGeom", value = "含有Geom字段", dataType = "Boolean", paramType = "query", example = "false") |
| | | }) |
| | | @GetMapping(value = "/selectDomainTabs") |
| | | public ResponseMsg<List<TabEntity>> selectDomainTabs(String name) { |
| | | public ResponseMsg<List<TabEntity>> selectDomainTabs(String name, Boolean hasGeom) { |
| | | try { |
| | | List<TabEntity> list = dictService.selectDictTab(name); |
| | | List<TabEntity> list = dictService.selectDictTab(name, null == hasGeom || !hasGeom ? "gid" : "geom"); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询所有表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "点") |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "点"), |
| | | @ApiImplicitParam(name = "hasGeom", value = "含有Geom字段", dataType = "Boolean", paramType = "query", example = "false") |
| | | }) |
| | | @GetMapping(value = "/selectTabs") |
| | | public ResponseMsg<List<TabEntity>> selectTabs(String name) { |
| | | public ResponseMsg<List<TabEntity>> selectTabs(String name, Boolean hasGeom) { |
| | | try { |
| | | List<TabEntity> list = dictService.selectDictTab(name); |
| | | List<TabEntity> list = dictService.selectDictTab(name, null == hasGeom || !hasGeom ? "gid" : "geom"); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | |
| | | /** |
| | | * 根据表名查询记录数 |
| | | * |
| | | * @param tab 表名 |
| | | * @param tab 表名 |
| | | * @param field 字段 |
| | | * @return |
| | | */ |
| | | public Integer selectTabsForCount(String tab); |
| | | public Integer selectTabsForCount(String tab, String field); |
| | | |
| | | /** |
| | | * 根据表名分页查询 |
| | | * |
| | | * @param tab 表名 |
| | | * @param field 字段 |
| | | * @param filters 过滤条件 |
| | | * @param limit 记录数 |
| | | * @param offset 偏移量 |
| | | * @return |
| | | */ |
| | | public List<TabEntity> selectTabsByPage(String tab, String filters, Integer limit, Integer offset); |
| | | public List<TabEntity> selectTabsByPage(String tab, String field, String filters, Integer limit, Integer offset); |
| | | |
| | | /** |
| | | * 查询字段信息 |
| | |
| | | * 查询字典表结构 |
| | | * |
| | | * @param name |
| | | * @param field |
| | | * @return |
| | | */ |
| | | public List<TabEntity> selectDictTab(String name); |
| | | public List<TabEntity> selectDictTab(String name, String field); |
| | | |
| | | /** |
| | | * 插入一条 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectTabsForCount(String tab) { |
| | | public Integer selectTabsForCount(String tab, String field) { |
| | | tab = StringHelper.getLikeStr(tab); |
| | | |
| | | return baseQueryMapper.selectTabsForCount(tab); |
| | | return baseQueryMapper.selectTabsForCount(tab, field); |
| | | } |
| | | |
| | | @Override |
| | | public List<TabEntity> selectTabsByPage(String tab, String filters, Integer limit, Integer offset) { |
| | | public List<TabEntity> selectTabsByPage(String tab, String field, String filters, Integer limit, Integer offset) { |
| | | tab = StringHelper.getLikeStr(tab); |
| | | |
| | | return baseQueryMapper.selectTabsByPage(tab, filters, limit, offset); |
| | | return baseQueryMapper.selectTabsByPage(tab, field, filters, limit, offset); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<TabEntity> selectDictTab(String name) { |
| | | public List<TabEntity> selectDictTab(String name, String field) { |
| | | name = StringHelper.getLikeStr(name); |
| | | |
| | | return dictMapper.selectDictTab(name); |
| | | return dictMapper.selectDictTab(name, field); |
| | | } |
| | | |
| | | @Override |
| | |
| | | </select> |
| | | |
| | | <select id="selectTabsForCount" resultType="java.lang.Integer"> |
| | | select count(distinct tab) from lf.sys_dict |
| | | select count(*) from lf.sys_dict |
| | | <where> |
| | | field = #{field} and status = 0 |
| | | <if test="tab != null"> |
| | | tab like #{tab} or tab_desc like #{tab} |
| | | and tab like #{tab} or tab_desc like #{tab} |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | select ns, tab, tab_desc, fn_get_entity(tab) entity, tableType, bak, fn_tab_count(a.ns, a.tab, #{filters}) "rows" |
| | | from lf.sys_dict a |
| | | <where> |
| | | field = 'gid' and status = 0 |
| | | field = #{field} and status = 0 |
| | | <if test="tab != null"> |
| | | and (tab like #{tab} or tab_desc like #{tab}) |
| | | </if> |
| | |
| | | select ns, tab, tab_desc, fn_get_entity(tab) entity, tableType, bak |
| | | from lf.sys_dict |
| | | <where> |
| | | field = 'gid' and status = 0 |
| | | field = #{field} and status = 0 |
| | | <if test="name != null"> |
| | | and (tab like #{name} or tab_desc like #{name}) |
| | | </if> |