| | |
| | | select count(1) from pg_stat_activity; |
| | | ----------------------------------------------------------------------------------------------------- a.查询表结构 |
| | | select * from pg_tables; |
| | | select * from pg_class order by relnamespace; |
| | | select relnamespace,relkind,relname from pg_class where relnamespace in (select oid from pg_namespace) and relkind='r' order by 1,2; |
| | | |
| | | |
| | | select c.relname as "表名", cast(obj_description(c.oid) as varchar) as "表名描述", |
| | | a.attnum as "序号", a.attname as "列名", |
| | |
| | | left join pg_description d on d.objoid = a.attrelid and d.objsubid = a.attnum |
| | | left join pg_class c on a.attrelid = c.oid |
| | | left join pg_type t on a.atttypid = t.oid |
| | | where a.attnum >= 0 and c.relname like 'sys_%' and obj_description(c.oid) is not null and relnamespace=20582 |
| | | where a.attnum >= 0 and c.relname like 'sys_%' and obj_description(c.oid) is not null --and relnamespace=20582 |
| | | order by c.relname desc, a.attnum asc; |
| | | ----------------------------------------------------------------------------------------------------- b.GUID生成函数 |
| | | CREATE or REPLACE FUNCTION new_guid() |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询单条") |
| | | @ApiOperation(value = "根据ID查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectOne") |
| | | public ResponseMsg<ArgsEntity> selectOne(int id) { |
| | | @GetMapping(value = "/selectById") |
| | | public ResponseMsg<ArgsEntity> selectById(int id) { |
| | | try { |
| | | ArgsEntity argsEntity = argsService.selectOne(id); |
| | | ArgsEntity argsEntity = argsService.selectById(id); |
| | | |
| | | return success(argsEntity); |
| | | } catch (Exception ex) { |
| | |
| | | public List<ArgsEntity> selectAll(); |
| | | |
| | | /** |
| | | * 查询单条 |
| | | * 根据ID查询 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public ArgsEntity selectOne(int id); |
| | | public ArgsEntity selectById(int id); |
| | | |
| | | /** |
| | | * 添加数据 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ArgsEntity selectOne(int id) { |
| | | return argsMapper.selectOne(id); |
| | | public ArgsEntity selectById(int id) { |
| | | return argsMapper.selectById(id); |
| | | } |
| | | |
| | | @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"> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.lf.server.mapper.sys.ArgsMapper"> |
| | | <!-- 统计行数 --> |
| | | <select id="selectCount" resultType="java.lang.Integer" parameterType="java.lang.String"> |
| | | select count(*) from lf.sys_args |
| | | <where> |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <!-- 分页查询 --> |
| | | <select id="selectByPage" resultType="com.lf.server.entity.sys.ArgsEntity"> |
| | | select * from lf.sys_args |
| | | <where> |
| | |
| | | select * from lf.sys_args order by id; |
| | | </select> |
| | | |
| | | <select id="selectOne" resultType="com.lf.server.entity.sys.ArgsEntity"> |
| | | <select id="selectById" resultType="com.lf.server.entity.sys.ArgsEntity"> |
| | | select * from lf.sys_args where id = #{id} |
| | | </select> |
| | | |