|
@@ -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>
|