| | |
| | | pg_class c on a.attrelid = c.oid left join pg_type t on a.atttypid = t.oid where a.attnum >= 0 and reltype>0 and |
| | | relnamespace in (29258) group by type; |
| | | |
| | | select count(*) from lf.sys_downlog a inner join lf.sys_user b on a.create_user = b.id inner join lf.sys_download c on a.downid = c.id |
| | | WHERE 1 = 1 and b.uname like '%管理员%' and c.type = ? and a.create_time >= ? and a.create_time <= ? |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | select * from lf.sys_download |
| | | |
| | | |
| | | |
| | |
| | | create table lf.sys_downlog ( |
| | | id serial primary key, |
| | | downid integer default 0, |
| | | name varchar(50), |
| | | type smallint default 1, |
| | | sizes float8 default 0, |
| | | ip varchar(30), |
| | | create_user integer default 1, |
| | | create_time timestamp(6) without time zone default now(), |
| | |
| | | ); |
| | | comment on table lf.sys_downlog is '下载日志表'; |
| | | comment on column lf.sys_downlog.id is '主键id'; |
| | | comment on column lf.sys_downlog.name is '名称'; |
| | | comment on column lf.sys_downlog.type is '类型:1-Shp文件,2-专题图,3-元数据'; |
| | | comment on column lf.sys_downlog.sizes is '文件大小:单位MB'; |
| | | comment on column lf.sys_downlog.ip is 'IP地址'; |
| | | comment on column lf.sys_downlog.create_user is '创建人id'; |
| | | comment on column lf.sys_downlog.create_time is '创建时间'; |
| | | comment on column lf.sys_downlog.update_user is '更新人id'; |
| | | comment on column lf.sys_downlog.update_time is '更新时间'; |
| | | -- insert into lf.sys_downlog(downid,name,type,sizes,ip,create_user) values (1,'test.zip',1,0.001,'192.168.20.39',1); |
| | | -- insert into lf.sys_downlog(downid,ip,create_user) values (100,'192.168.20.39',1); |
| | | |
| | | select * from lf.sys_downlog; |
| | | ----------------------------------------------------------------------------------------------------- 元数据测试表 * |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "分页查询并返回记录数") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "uname", value = "用户名", dataType = "String", paramType = "query", example = "管理员"), |
| | | @ApiImplicitParam(name = "type", value = "类型", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "uname", value = "用户名", dataType = "String", paramType = "query", example = "员"), |
| | | @ApiImplicitParam(name = "type", value = "类型", dataType = "Integer", paramType = "query", example = "3"), |
| | | @ApiImplicitParam(name = "start", value = "开始时间", dataType = "Timestamp", paramType = "query", example = "2022-12-09 09:00:00"), |
| | | @ApiImplicitParam(name = "end", value = "结束时间", dataType = "Timestamp", paramType = "query", example = "2022-12-25 17:00:00"), |
| | | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"), |
| | |
| | | |
| | | private int downid; |
| | | |
| | | private String name; |
| | | |
| | | private int type; |
| | | |
| | | private double sizes; |
| | | |
| | | private String ip; |
| | | |
| | | private int createUser; |
| | |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String createName; |
| | | private String uname; |
| | | |
| | | private String name; |
| | | |
| | | private int type; |
| | | |
| | | private double sizes; |
| | | |
| | | public DownlogEntity() { |
| | | } |
| | |
| | | this.downid = downid; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(int type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public double getSizes() { |
| | | return sizes; |
| | | } |
| | | |
| | | public void setSizes(double sizes) { |
| | | this.sizes = sizes; |
| | | } |
| | | |
| | | public String getIp() { |
| | |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public String getCreateName() { |
| | | return createName; |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setCreateName(String createName) { |
| | | this.createName = createName; |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public double getSizes() { |
| | | return sizes; |
| | | } |
| | | |
| | | public void setSizes(double sizes) { |
| | | this.sizes = sizes; |
| | | } |
| | | |
| | | public String getUname() { |
| | | return uname; |
| | | } |
| | | |
| | | public void setUname(String uname) { |
| | | this.uname = uname; |
| | | } |
| | | } |
| | |
| | | <!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.DownlogMapper"> |
| | | <select id="selectCount" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_downlog |
| | | select count(*) from lf.sys_downlog a inner join lf.sys_user b on a.create_user = b.id |
| | | inner join lf.sys_download c on a.downid = c.id |
| | | <where> |
| | | <if test="name != null"> |
| | | name like #{name} |
| | | 1 = 1 |
| | | <if test="uname != null"> |
| | | and b.uname like #{uname} |
| | | </if> |
| | | <if test="type != null"> |
| | | and c.type = #{type} |
| | | </if> |
| | | <if test="start != null"> |
| | | and a.create_time >= #{start} |
| | | </if> |
| | | <if test="end != null"> |
| | | and a.create_time <= #{end} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectByPage" resultType="com.lf.server.entity.sys.DownlogEntity"> |
| | | select * from lf.sys_downlog |
| | | select a.*,b.uname,c.name,c.type,c.sizes from lf.sys_downlog a inner join lf.sys_user b on a.create_user = b.id |
| | | inner join lf.sys_download c on a.downid = c.id |
| | | <where> |
| | | <if test="name != null"> |
| | | name like #{name} |
| | | 1 = 1 |
| | | <if test="uname != null"> |
| | | and b.uname like #{uname} |
| | | </if> |
| | | <if test="type != null"> |
| | | and c.type = #{type} |
| | | </if> |
| | | <if test="start != null"> |
| | | and a.create_time >= #{start} |
| | | </if> |
| | | <if test="end != null"> |
| | | and a.create_time <= #{end} |
| | | </if> |
| | | </where> |
| | | order by id |