| | |
| | | ST_PolygonFromText('POLYGON ((115.94927385452 32.3754479115071 0,121.989371092554 32.2766788010181 0,121.850621222894 29.6874200067864 0,115.9727267226 29.7835368627922 0,115.94927385452 32.3754479115071 0))', 4326)) |
| | | |
| | | select a.* from lf.sys_domain a inner join lf.sys_dict b on a.dom_name = b.domain_na |
| | | where b.ns = 'bd' and b.tab = 'dlg_25w_hyda' and b.domain_na is not null; |
| | | where b.ns = 'bd' and b.tab = 'dlg_25w_aanp' and b.domain_na is not null; |
| | | |
| | | select * from lf.sys_dict where ns = 'bd' and tab = 'dlg_25w_hyda' and domain_na is not null; |
| | | select * from lf.sys_dict where ns = 'bd' and tab = 'dlg_25w_aanp' and domain_na is not null; |
| | | select * from lf.sys_domain where dom_name='dlg25gbcode'; |
| | | select * from bd.dlg_25w_aanp; |
| | | |
| | | |
| | | select * from bd.dlg_25w_aanp limit 10; |
| | | |
| | | |
| | | |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询记录数") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "domName", value = "值域表名", dataType = "String", paramType = "query", required = false, example = "") |
| | | @ApiImplicitParam(name = "ns", value = "名称空间", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "dlg_25w_aanp") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(String domName) { |
| | | public ResponseMsg<Integer> selectCount(String ns, String tab) { |
| | | try { |
| | | int count = domainService.selectCount(domName); |
| | | int count = domainService.selectCount(ns, tab); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "分页查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "domName", value = "值域表名", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "ns", value = "名称空间", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "dlg_25w_aanp"), |
| | | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPage") |
| | | public ResponseMsg<List<DomainEntity>> selectByPage(String domName, Integer pageSize, Integer pageIndex) { |
| | | public ResponseMsg<List<DomainEntity>> selectByPage(String ns, String tab, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("每页页数或分页数小于1", null); |
| | | } |
| | | |
| | | List<DomainEntity> rs = domainService.selectByPage(domName, pageSize, pageSize * (pageIndex - 1)); |
| | | List<DomainEntity> rs = domainService.selectByPage(ns, tab, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "分页查询并返回记录数") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "domName", value = "值域表名", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "ns", value = "名称空间", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "dlg_25w_aanp"), |
| | | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageAndCount") |
| | | public ResponseMsg<List<DomainEntity>> selectByPageAndCount(String domName, Integer pageSize, Integer pageIndex) { |
| | | public ResponseMsg<List<DomainEntity>> selectByPageAndCount(String ns, String tab, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("每页页数或分页数小于1", null); |
| | | } |
| | | |
| | | int count = domainService.selectCount(domName); |
| | | int count = domainService.selectCount(ns, tab); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<DomainEntity> rs = domainService.selectByPage(domName, pageSize, pageSize * (pageIndex - 1)); |
| | | List<DomainEntity> rs = domainService.selectByPage(ns, tab, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | |
| | | /** |
| | | * 查询记录数 |
| | | * |
| | | * @param domName 值域表名 |
| | | * @param ns 名称空间 |
| | | * @param tab 表名 |
| | | * @return 记录数 |
| | | */ |
| | | public Integer selectCount(String domName); |
| | | public Integer selectCount(String ns, String tab); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param domName 值域表名 |
| | | * @param ns 名称空间 |
| | | * @param tab 表名 |
| | | * @param limit 记录表 |
| | | * @param offset 偏移量 |
| | | * @return 列表 |
| | | */ |
| | | public List<DomainEntity> selectByPage(String domName, Integer limit, Integer offset); |
| | | public List<DomainEntity> selectByPage(String ns, String tab, Integer limit, Integer offset); |
| | | |
| | | /** |
| | | * 查询所有 |
| | |
| | | DomainMapper domainMapper; |
| | | |
| | | @Override |
| | | public Integer selectCount(String domName) { |
| | | domName = StringHelper.getLikeStr(domName); |
| | | |
| | | return domainMapper.selectCount(domName); |
| | | public Integer selectCount(String ns, String tab) { |
| | | return domainMapper.selectCount(ns, tab); |
| | | } |
| | | |
| | | @Override |
| | | public List<DomainEntity> selectByPage(String domName, Integer limit, Integer offset) { |
| | | domName = StringHelper.getLikeStr(domName); |
| | | |
| | | return domainMapper.selectByPage(domName, limit, offset); |
| | | public List<DomainEntity> selectByPage(String ns, String tab, Integer limit, Integer offset) { |
| | | return domainMapper.selectByPage(ns, tab, limit, offset); |
| | | } |
| | | |
| | | @Override |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.lf.server.mapper.data.DomainMapper"> |
| | | <select id="selectCount" resultType="java.lang.Integer" parameterType="java.lang.String"> |
| | | select count(*) from lf.sys_domain |
| | | <where> |
| | | <if test="domName != null"> |
| | | dom_name like #{domName} |
| | | </if> |
| | | </where> |
| | | <select id="selectCount" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_domain a inner join lf.sys_dict b on a.dom_name = b.domain_na |
| | | where b.ns = #{ns} and b.tab = #{tab} and b.domain_na is not null |
| | | </select> |
| | | |
| | | <select id="selectByPage" resultType="com.lf.server.entity.data.DomainEntity"> |
| | | select * from lf.sys_domain |
| | | <where> |
| | | <if test="domName != null"> |
| | | dom_name like #{domName} |
| | | </if> |
| | | </where> |
| | | order by id |
| | | select a.* from lf.sys_domain a inner join lf.sys_dict b on a.dom_name = b.domain_na |
| | | where b.ns = #{ns} and b.tab = #{tab} and b.domain_na is not null |
| | | order by a.id |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |