管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-12-23 4eab034694775eecb56cc62ab37fe787a2594411
1
已修改5个文件
109 ■■■■■ 文件已修改
data/db_fn.sql 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/db_tab.sql 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/sys/DownlogController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/sys/DownlogEntity.java 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sys/DownlogMapper.xml 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/db_fn.sql
@@ -353,14 +353,11 @@
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
data/db_tab.sql
@@ -1019,9 +1019,6 @@
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(),
@@ -1030,15 +1027,12 @@
);
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;
----------------------------------------------------------------------------------------------------- 元数据测试表 *
src/main/java/com/lf/server/controller/sys/DownlogController.java
@@ -33,8 +33,8 @@
    @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"),
src/main/java/com/lf/server/entity/sys/DownlogEntity.java
@@ -14,12 +14,6 @@
    private int downid;
    private String name;
    private int type;
    private double sizes;
    private String ip;
    private int createUser;
@@ -30,7 +24,13 @@
    private Timestamp updateTime;
    private String createName;
    private String uname;
    private String name;
    private int type;
    private double sizes;
    public DownlogEntity() {
    }
@@ -51,28 +51,12 @@
        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() {
@@ -115,11 +99,27 @@
        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;
    }
}
src/main/resources/mapper/sys/DownlogMapper.xml
@@ -2,19 +2,41 @@
<!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 &gt;= #{start}
            </if>
            <if test="end != null">
                and a.create_time &lt;= #{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 &gt;= #{start}
            </if>
            <if test="end != null">
                and a.create_time &lt;= #{end}
            </if>
        </where>
        order by id