Sfoglia il codice sorgente

统计管理相关接口开发

jichaobo 3 anni fa
parent
commit
51d65658b1
17 ha cambiato i file con 869 aggiunte e 8 eliminazioni
  1. 1 1
      fiveep-controller/src/main/java/com/bizmatics/controller/web/MybatisGeneratorUtils.java
  2. 52 0
      fiveep-controller/src/main/java/com/bizmatics/controller/web/SysLoginLogController.java
  3. 55 0
      fiveep-controller/src/main/java/com/bizmatics/controller/web/SysOperLogController.java
  4. 73 0
      fiveep-model/src/main/java/com/bizmatics/model/SysLoginLog.java
  5. 108 0
      fiveep-model/src/main/java/com/bizmatics/model/SysOperLog.java
  6. 28 0
      fiveep-model/src/main/java/com/bizmatics/model/vo/RtData.java
  7. 78 0
      fiveep-model/src/main/java/com/bizmatics/model/vo/SiteData.java
  8. 79 0
      fiveep-model/src/main/java/com/bizmatics/model/vo/SysLoginLogVo.java
  9. 115 0
      fiveep-model/src/main/java/com/bizmatics/model/vo/SysOperLogVo.java
  10. 36 0
      fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/SysLoginLogMapper.java
  11. 26 7
      fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/system/SysOperLogMapper.java
  12. 70 0
      fiveep-persistence/src/main/resources/mapper/mysql/SysLoginLogMapper.xml
  13. 58 0
      fiveep-persistence/src/main/resources/mapper/mysql/system/SysOperLogMapper.xml
  14. 26 0
      fiveep-service/src/main/java/com/bizmatics/service/SysLoginLogService.java
  15. 38 0
      fiveep-service/src/main/java/com/bizmatics/service/impl/SysLoginLogServiceImpl.java
  16. 12 0
      fiveep-service/src/main/java/com/bizmatics/service/system/ISysOperLogService.java
  17. 14 0
      fiveep-service/src/main/java/com/bizmatics/service/system/impl/SysOperLogServiceImpl.java

+ 1 - 1
fiveep-controller/src/main/java/com/bizmatics/controller/web/MybatisGeneratorUtils.java

@@ -70,7 +70,7 @@ public class MybatisGeneratorUtils {
         // strategy.setTablePrefix("t_"); // 表名前缀
         strategy.setEntityLombokModel(true); //使用lombok
         //修改自己想要生成的表
-        strategy.setInclude(new String[]{"sys_tenant_menu"});  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
+        strategy.setInclude(new String[]{"sys_oper_log"});  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
         mpg.setStrategy(strategy);
 
         // 关闭默认 xml 生成,调整生成 至 根目录

+ 52 - 0
fiveep-controller/src/main/java/com/bizmatics/controller/web/SysLoginLogController.java

@@ -0,0 +1,52 @@
+package com.bizmatics.controller.web;
+
+
+import com.bizmatics.common.core.bean.ApiResult;
+import com.bizmatics.common.core.bean.CommonPage;
+import com.bizmatics.model.vo.SysLoginLogVo;
+import com.bizmatics.service.SysLoginLogService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 统计管理-用户登录记录
+ *
+ * @author ya
+ * @since 2022-06-02
+ */
+@RestController
+@RequestMapping("/sysLoginLog")
+public class SysLoginLogController {
+
+    @Autowired
+    private SysLoginLogService sysLoginLogService;
+
+    /**
+     * 统计管理-用户登录记录-列表查询
+     *
+     * @param ipaddr    登录地址
+     * @param userName  账号
+     * @param nickName  用户名称
+     * @param status    登录状态(0成功 1失败)
+     * @param startTime 开始时间 2021-01-01 15:15:15
+     * @param endTime   结束时间 2021-01-01 15:15:15
+     * @param page      当前页
+     * @param size      条数
+     * @return
+     */
+    @GetMapping("/getLoginLogList")
+    public ApiResult<CommonPage<SysLoginLogVo>> getLoginLogList(@RequestParam(value = "ipaddr", required = false) String ipaddr,
+                                                                @RequestParam(value = "userName", required = false) String userName,
+                                                                @RequestParam(value = "nickName", required = false) String nickName,
+                                                                @RequestParam(value = "status", required = false, defaultValue = "2") Integer status,
+                                                                @RequestParam(value = "startTime", required = false) String startTime,
+                                                                @RequestParam(value = "endTime", required = false) String endTime,
+                                                                @RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
+                                                                @RequestParam(value = "size", required = false, defaultValue = "10") Integer size) {
+        return ApiResult.success(sysLoginLogService.getLoginLogList(ipaddr, userName, nickName, status, startTime, endTime, page, size));
+    }
+}
+

+ 55 - 0
fiveep-controller/src/main/java/com/bizmatics/controller/web/SysOperLogController.java

@@ -0,0 +1,55 @@
+package com.bizmatics.controller.web;
+
+
+import com.bizmatics.common.core.bean.ApiResult;
+import com.bizmatics.common.core.bean.CommonPage;
+import com.bizmatics.model.vo.SysOperLogVo;
+import com.bizmatics.service.system.ISysOperLogService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 统计管理-用户操作日志
+ *
+ * @author ya
+ * @since 2022-06-02
+ */
+@RestController
+@RequestMapping("/sysOperLog")
+public class SysOperLogController {
+
+    @Autowired
+    private ISysOperLogService sysOperLogService;
+
+    /**
+     * 统计管理-用户操作日志-列表查询
+     *
+     * @param title        系统模块
+     * @param operName     操作账号
+     * @param businessType 操作类别 (0其它 1新增 2修改 3删除)
+     * @param status       操作状态(0正常 1异常)
+     * @param startTime    开始时间 2021-01-01 15:15:15
+     * @param endTime      结束时间 2021-01-01 15:15:15
+     * @param page         当前页
+     * @param size         条数
+     * @param operId           记录id 详情使用
+     * @return
+     */
+    @GetMapping("/getOperLogList")
+    public ApiResult<CommonPage<SysOperLogVo>> getOperLogList(@RequestParam(value = "title", required = false) String title,
+                                                              @RequestParam(value = "operName", required = false) String operName,
+                                                              @RequestParam(value = "businessType", required = false) Integer businessType,
+                                                              @RequestParam(value = "status", required = false, defaultValue = "2") Integer status,
+                                                              @RequestParam(value = "startTime", required = false) String startTime,
+                                                              @RequestParam(value = "endTime", required = false) String endTime,
+                                                              @RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
+                                                              @RequestParam(value = "size", required = false, defaultValue = "10") Integer size,
+                                                              @RequestParam(value = "operId", required = false, defaultValue = "0") Integer operId) {
+        return ApiResult.success(sysOperLogService.getOperLogList(title, operName, status, businessType, operId, startTime, endTime, page, size));
+    }
+
+}
+

+ 73 - 0
fiveep-model/src/main/java/com/bizmatics/model/SysLoginLog.java

@@ -0,0 +1,73 @@
+package com.bizmatics.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 系统访问记录
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-02
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class SysLoginLog implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 访问ID
+     */
+    @TableId(value = "info_id", type = IdType.AUTO)
+    private Long infoId;
+
+    /**
+     * 用户账号
+     */
+    private String userName;
+
+    /**
+     * 登录IP地址
+     */
+    private String ipaddr;
+
+    /**
+     * 登录地点
+     */
+    private String loginLocation;
+
+    /**
+     * 浏览器类型
+     */
+    private String browser;
+
+    /**
+     * 操作系统
+     */
+    private String os;
+
+    /**
+     * 登录状态(0成功 1失败)
+     */
+    private String status;
+
+    /**
+     * 提示消息
+     */
+    private String msg;
+
+    /**
+     * 访问时间
+     */
+    private LocalDateTime loginTime;
+
+
+}

+ 108 - 0
fiveep-model/src/main/java/com/bizmatics/model/SysOperLog.java

@@ -0,0 +1,108 @@
+package com.bizmatics.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 操作日志记录
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-02
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class SysOperLog implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 日志主键
+     */
+    @TableId(value = "oper_id", type = IdType.AUTO)
+    private Long operId;
+
+    /**
+     * 模块标题
+     */
+    private String title;
+
+    /**
+     * 业务类型(0其它 1新增 2修改 3删除)
+     */
+    private Integer businessType;
+
+    /**
+     * 方法名称
+     */
+    private String method;
+
+    /**
+     * 请求方式
+     */
+    private String requestMethod;
+
+    /**
+     * 操作类别(0其它 1后台用户 2手机端用户)
+     */
+    private Integer operatorType;
+
+    /**
+     * 操作人员
+     */
+    private String operName;
+
+    /**
+     * 部门名称
+     */
+    private String deptName;
+
+    /**
+     * 请求URL
+     */
+    private String operUrl;
+
+    /**
+     * 主机地址
+     */
+    private String operIp;
+
+    /**
+     * 操作地点
+     */
+    private String operLocation;
+
+    /**
+     * 请求参数
+     */
+    private String operParam;
+
+    /**
+     * 返回参数
+     */
+    private String jsonResult;
+
+    /**
+     * 操作状态(0正常 1异常)
+     */
+    private Integer status;
+
+    /**
+     * 错误消息
+     */
+    private String errorMsg;
+
+    /**
+     * 操作时间
+     */
+    private LocalDateTime operTime;
+
+
+}

+ 28 - 0
fiveep-model/src/main/java/com/bizmatics/model/vo/RtData.java

@@ -0,0 +1,28 @@
+package com.bizmatics.model.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ya
+ * @since 2021-07-07
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class RtData implements Serializable {
+
+    private String textValue;
+
+}

+ 78 - 0
fiveep-model/src/main/java/com/bizmatics/model/vo/SiteData.java

@@ -0,0 +1,78 @@
+package com.bizmatics.model.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author ya
+ * @since 2021-07-07
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class SiteData implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 站点表ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 站点名称
+     */
+    private String siteName;
+
+    /**
+     * 站点位置
+     */
+    private String siteAddress;
+
+    /**
+     * 手机号码1
+     */
+    private String phone;
+
+    /**
+     * 手机号码2
+     */
+    private String sparePhone;
+
+    /**
+     * 装机容量
+     */
+    private String installedCapacity;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 供电类型:1\\单路、2\\双路
+     */
+    private Integer powerSupplyType;
+
+    /**
+     * 电压等级(单位:V)
+     */
+    private String voltageLevel;
+
+    /**
+     * 投运时间
+     */
+    private Date operationTime;
+
+}

+ 79 - 0
fiveep-model/src/main/java/com/bizmatics/model/vo/SysLoginLogVo.java

@@ -0,0 +1,79 @@
+package com.bizmatics.model.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * <p>
+ * 系统访问记录
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-02
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class SysLoginLogVo implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 访问ID
+     */
+    @TableId(value = "info_id", type = IdType.AUTO)
+    private Long infoId;
+
+    /**
+     * 用户账号
+     */
+    private String userName;
+
+    /**
+     * 登录IP地址
+     */
+    private String ipaddr;
+
+    /**
+     * 登录地点
+     */
+    private String loginLocation;
+
+    /**
+     * 浏览器类型
+     */
+    private String browser;
+
+    /**
+     * 操作系统
+     */
+    private String os;
+
+    /**
+     * 登录状态(0成功 1失败)
+     */
+    private String status;
+
+    /**
+     * 提示消息
+     */
+    private String msg;
+
+    /**
+     * 访问时间
+     */
+    private LocalDateTime loginTime;
+
+    /**
+     * 用户名称
+     */
+    private String nickName;
+
+
+}

+ 115 - 0
fiveep-model/src/main/java/com/bizmatics/model/vo/SysOperLogVo.java

@@ -0,0 +1,115 @@
+package com.bizmatics.model.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * <p>
+ * 操作日志记录
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-02
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class SysOperLogVo implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 日志主键
+     */
+    @TableId(value = "oper_id", type = IdType.AUTO)
+    private Long operId;
+
+    /**
+     * 模块标题
+     */
+    private String title;
+
+    /**
+     * 业务类型(0其它 1新增 2修改 3删除)
+     */
+    private Integer businessType;
+
+    /**
+     * 方法名称
+     */
+    private String method;
+
+    /**
+     * 请求方式
+     */
+    private String requestMethod;
+
+    /**
+     * 操作类别(0其它 1后台用户 2手机端用户)
+     */
+    private Integer operatorType;
+
+    /**
+     * 操作人员
+     */
+    private String operName;
+
+    /**
+     * 部门名称
+     */
+    private String deptName;
+
+    /**
+     * 请求URL
+     */
+    private String operUrl;
+
+    /**
+     * 主机地址
+     */
+    private String operIp;
+
+    /**
+     * 操作地点
+     */
+    private String operLocation;
+
+    /**
+     * 请求参数
+     */
+    private String operParam;
+
+    /**
+     * 返回参数
+     */
+    private String jsonResult;
+
+    /**
+     * 操作状态(0正常 1异常)
+     */
+    private Integer status;
+
+    /**
+     * 错误消息
+     */
+    private String errorMsg;
+
+    /**
+     * 操作时间
+     */
+    private LocalDateTime operTime;
+
+
+    /**
+     * 操作人员
+     */
+    private String nickName;
+
+
+}

+ 36 - 0
fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/SysLoginLogMapper.java

@@ -0,0 +1,36 @@
+package com.bizmatics.persistence.mapper;
+
+import com.bizmatics.common.mvc.base.CrudMapper;
+import com.bizmatics.model.SysLoginLog;
+import com.bizmatics.model.vo.SysLoginLogVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 系统访问记录 Mapper 接口
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-02
+ */
+public interface SysLoginLogMapper extends CrudMapper<SysLoginLog> {
+
+    List<SysLoginLogVo> getLoginLogList(@Param("ipaddr") String ipaddr,
+                                        @Param("userName") String userName,
+                                        @Param("nickName") String nickName,
+                                        @Param("status") Integer status,
+                                        @Param("startTime") String startTime,
+                                        @Param("endTime") String endTime,
+                                        @Param("current") Integer current,
+                                        @Param("size") Integer size);
+
+    Integer getLoginLogCount(@Param("ipaddr") String ipaddr,
+                             @Param("userName") String userName,
+                             @Param("nickName") String nickName,
+                             @Param("status") Integer status,
+                             @Param("startTime") String startTime,
+                             @Param("endTime") String endTime);
+
+}

+ 26 - 7
fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/system/SysOperLogMapper.java

@@ -1,6 +1,8 @@
 package com.bizmatics.persistence.mapper.system;
 
 import com.bizmatics.model.system.SysOperLog;
+import com.bizmatics.model.vo.SysOperLogVo;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
@@ -8,22 +10,21 @@ import java.util.List;
 
 /**
  * 操作日志 数据层
- * 
+ *
  * @author yq
  */
 @Repository
-public interface SysOperLogMapper
-{
+public interface SysOperLogMapper {
     /**
      * 新增操作日志
-     * 
+     *
      * @param operLog 操作日志对象
      */
     public void insertOperlog(SysOperLog operLog);
 
     /**
      * 查询系统操作日志集合
-     * 
+     *
      * @param operLog 操作日志对象
      * @return 操作日志集合
      */
@@ -31,7 +32,7 @@ public interface SysOperLogMapper
 
     /**
      * 批量删除系统操作日志
-     * 
+     *
      * @param operIds 需要删除的操作日志ID
      * @return 结果
      */
@@ -39,7 +40,7 @@ public interface SysOperLogMapper
 
     /**
      * 查询操作日志详细
-     * 
+     *
      * @param operId 操作ID
      * @return 操作日志对象
      */
@@ -49,4 +50,22 @@ public interface SysOperLogMapper
      * 清空操作日志
      */
     public void cleanOperLog();
+
+    List<SysOperLogVo> getOperLogList(@Param("title") String title,
+                                      @Param("operName") String operName,
+                                      @Param("status") Integer status,
+                                      @Param("businessType") Integer businessType,
+                                      @Param("operId") Integer operId,
+                                      @Param("startTime") String startTime,
+                                      @Param("endTime") String endTime,
+                                      @Param("current") Integer current,
+                                      @Param("size") Integer size);
+
+    Integer getOperLogCount(@Param("title") String title,
+                            @Param("operName") String operName,
+                            @Param("status") Integer status,
+                            @Param("businessType") Integer businessType,
+                            @Param("operId") Integer operId,
+                            @Param("startTime") String startTime,
+                            @Param("endTime") String endTime);
 }

+ 70 - 0
fiveep-persistence/src/main/resources/mapper/mysql/SysLoginLogMapper.xml

@@ -0,0 +1,70 @@
+<?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.bizmatics.persistence.mapper.SysLoginLogMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.bizmatics.model.SysLoginLog">
+        <id column="info_id" property="infoId" />
+        <result column="user_name" property="userName" />
+        <result column="ipaddr" property="ipaddr" />
+        <result column="login_location" property="loginLocation" />
+        <result column="browser" property="browser" />
+        <result column="os" property="os" />
+        <result column="status" property="status" />
+        <result column="msg" property="msg" />
+        <result column="login_time" property="loginTime" />
+    </resultMap>
+
+    <select id="getLoginLogList" resultType="com.bizmatics.model.vo.SysLoginLogVo">
+        SELECT
+        a.*,b.nick_name
+        FROM
+        sys_login_log as a left join sys_user as b on a.user_name=b.user_name
+        <where>
+            <if test="ipaddr != null and ipaddr != ''">
+                and a.ipaddr LIKE CONCAT(CONCAT('%', #{ipaddr}), '%')
+            </if>
+            <if test="userName != null and userName != ''">
+                and a.user_name LIKE CONCAT(CONCAT('%', #{userName}), '%')
+            </if>
+            <if test="nickName != null and nickName != ''">
+                and b.nick_name LIKE CONCAT(CONCAT('%', #{nickName}), '%')
+            </if>
+            <if test="status != null and status != 2">
+                and a.status = #{status}
+            </if>
+            <if test="endTime != null and startTime != null and endTime != '' and startTime != ''">
+                and a.login_time BETWEEN #{startTime} and #{endTime}
+            </if>
+        </where>
+        order by a.info_id desc
+        <if test="current != null and size != null and size != 0">
+            limit #{current},#{size}
+        </if>
+    </select>
+
+    <select id="getLoginLogCount" resultType="java.lang.Integer">
+        SELECT
+        count(1)
+        FROM
+        sys_login_log as a left join sys_user as b on a.user_name=b.user_name
+        <where>
+            <if test="ipaddr != null and ipaddr != ''">
+                and a.ipaddr LIKE CONCAT(CONCAT('%', #{ipaddr}), '%')
+            </if>
+            <if test="userName != null and userName != ''">
+                and a.user_name LIKE CONCAT(CONCAT('%', #{userName}), '%')
+            </if>
+            <if test="nickName != null and nickName != ''">
+                and b.nick_name LIKE CONCAT(CONCAT('%', #{nickName}), '%')
+            </if>
+            <if test="status != null and status != 2">
+                and a.status = #{status}
+            </if>
+            <if test="endTime != null and startTime != null and endTime != '' and startTime != ''">
+                and a.login_time BETWEEN #{startTime} and #{endTime}
+            </if>
+        </where>
+    </select>
+
+</mapper>

+ 58 - 0
fiveep-persistence/src/main/resources/mapper/mysql/system/SysOperLogMapper.xml

@@ -80,4 +80,62 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         truncate table sys_oper_log
     </update>
 
+	<select id="getOperLogList" resultType="com.bizmatics.model.vo.SysOperLogVo">
+		SELECT
+		a.*,b.nick_name
+		FROM
+		sys_oper_log as a left join sys_user as b on a.oper_name=b.user_name
+		<where>
+			<if test="title != null and title != ''">
+				and a.title LIKE CONCAT(CONCAT('%', #{title}), '%')
+			</if>
+			<if test="operName != null and operName != ''">
+				and a.oper_name LIKE CONCAT(CONCAT('%', #{operName}), '%')
+			</if>
+			<if test="status != null and status != 2">
+				and a.status = #{status}
+			</if>
+			<if test="businessType != null">
+				and a.business_type = #{businessType}
+			</if>
+			<if test="operId != null and operId != 0">
+				and a.oper_id = #{operId}
+			</if>
+			<if test="endTime != null and startTime != null and endTime != '' and startTime != ''">
+				and a.oper_time BETWEEN #{startTime} and #{endTime}
+			</if>
+		</where>
+		order by a.oper_id desc
+		<if test="current != null and size != null and size != 0">
+			limit #{current},#{size}
+		</if>
+	</select>
+
+	<select id="getOperLogCount" resultType="java.lang.Integer">
+		SELECT
+		count(1)
+		FROM
+		sys_oper_log as a left join sys_user as b on a.oper_name=b.user_name
+		<where>
+			<if test="title != null and title != ''">
+				and a.title LIKE CONCAT(CONCAT('%', #{title}), '%')
+			</if>
+			<if test="operName != null and operName != ''">
+				and a.oper_name LIKE CONCAT(CONCAT('%', #{operName}), '%')
+			</if>
+			<if test="status != null and status != 2">
+				and a.status = #{status}
+			</if>
+			<if test="businessType != null">
+				and a.business_type = #{businessType}
+			</if>
+			<if test="operId != null and operId != 0">
+				and a.oper_id = #{operId}
+			</if>
+			<if test="endTime != null and startTime != null and endTime != '' and startTime != ''">
+				and a.oper_time BETWEEN #{startTime} and #{endTime}
+			</if>
+		</where>
+	</select>
+
 </mapper> 

+ 26 - 0
fiveep-service/src/main/java/com/bizmatics/service/SysLoginLogService.java

@@ -0,0 +1,26 @@
+package com.bizmatics.service;
+
+import com.bizmatics.common.core.bean.CommonPage;
+import com.bizmatics.model.SysLoginLog;
+import com.bizmatics.common.mvc.base.CrudService;
+import com.bizmatics.model.vo.SysLoginLogVo;
+
+/**
+ * <p>
+ * 系统访问记录 服务类
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-02
+ */
+public interface SysLoginLogService extends CrudService<SysLoginLog> {
+    CommonPage<SysLoginLogVo> getLoginLogList(String ipaddr,
+                                              String userName,
+                                              String nickName,
+                                              Integer status,
+                                              String startTime,
+                                              String endTime,
+                                              Integer page,
+                                              Integer size);
+
+}

+ 38 - 0
fiveep-service/src/main/java/com/bizmatics/service/impl/SysLoginLogServiceImpl.java

@@ -0,0 +1,38 @@
+package com.bizmatics.service.impl;
+
+import com.bizmatics.common.core.bean.CommonPage;
+import com.bizmatics.model.SysLoginLog;
+import com.bizmatics.model.vo.SysLoginLogVo;
+import com.bizmatics.model.vo.SysTenantOneVo;
+import com.bizmatics.model.vo.SysTenantTwoVo;
+import com.bizmatics.persistence.mapper.SysLoginLogMapper;
+import com.bizmatics.service.SysLoginLogService;
+import com.bizmatics.common.mvc.base.AbstractCrudService;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 系统访问记录 服务实现类
+ * </p>
+ *
+ * @author ya
+ * @since 2022-06-02
+ */
+@Service
+public class SysLoginLogServiceImpl extends AbstractCrudService<SysLoginLogMapper, SysLoginLog> implements SysLoginLogService {
+
+    @Override
+    public CommonPage<SysLoginLogVo> getLoginLogList(String ipaddr, String userName, String nickName, Integer status, String startTime, String endTime, Integer page, Integer size) {
+        Integer total = baseMapper.getLoginLogCount(ipaddr,userName,nickName, status,startTime,endTime);
+        Integer current = null;
+        if (page != null && size > 0) {
+            current = (page - 1) * size;
+        }
+        List<SysLoginLogVo> list = baseMapper.getLoginLogList(ipaddr,userName,nickName, status,startTime,endTime,current,size);
+        return new CommonPage<>(list, total, size, page);
+    }
+
+}

+ 12 - 0
fiveep-service/src/main/java/com/bizmatics/service/system/ISysOperLogService.java

@@ -1,6 +1,8 @@
 package com.bizmatics.service.system;
 
+import com.bizmatics.common.core.bean.CommonPage;
 import com.bizmatics.model.system.SysOperLog;
+import com.bizmatics.model.vo.SysOperLogVo;
 
 import java.util.List;
 
@@ -46,4 +48,14 @@ public interface ISysOperLogService
      * 清空操作日志
      */
     public void cleanOperLog();
+
+    CommonPage<SysOperLogVo> getOperLogList(String title,
+                                            String operName,
+                                            Integer status,
+                                            Integer businessType,
+                                            Integer operId,
+                                            String startTime,
+                                            String endTime,
+                                            Integer page,
+                                            Integer size);
 }

+ 14 - 0
fiveep-service/src/main/java/com/bizmatics/service/system/impl/SysOperLogServiceImpl.java

@@ -1,6 +1,8 @@
 package com.bizmatics.service.system.impl;
 
+import com.bizmatics.common.core.bean.CommonPage;
 import com.bizmatics.model.system.SysOperLog;
+import com.bizmatics.model.vo.SysOperLogVo;
 import com.bizmatics.persistence.mapper.system.SysOperLogMapper;
 import com.bizmatics.service.system.ISysOperLogService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -74,4 +76,16 @@ public class SysOperLogServiceImpl implements ISysOperLogService
     {
         operLogMapper.cleanOperLog();
     }
+
+
+    @Override
+    public CommonPage<SysOperLogVo> getOperLogList(String title, String operName, Integer status, Integer businessType, Integer operId, String startTime, String endTime, Integer page, Integer size) {
+        Integer total = operLogMapper.getOperLogCount(title, operName, status, businessType, operId, startTime, endTime);
+        Integer current = null;
+        if (page != null && size > 0) {
+            current = (page - 1) * size;
+        }
+        List<SysOperLogVo> list = operLogMapper.getOperLogList(title, operName, status, businessType, operId, startTime, endTime, current, size);
+        return new CommonPage<>(list, total, size, page);
+    }
 }