You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
2.9 KiB
XML
82 lines
2.9 KiB
XML
<?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.glxp.api.dao.monitor.SysLogininforMapper">
|
|
|
|
<resultMap type="com.glxp.api.entity.monitor.SysLogininfor" id="SysLogininforResult">
|
|
<id property="infoId" column="info_id"/>
|
|
<result property="userName" column="user_name"/>
|
|
<result property="status" column="status"/>
|
|
<result property="ipaddr" column="ipaddr"/>
|
|
<result property="loginLocation" column="login_location"/>
|
|
<result property="browser" column="browser"/>
|
|
<result property="os" column="os"/>
|
|
<result property="msg" column="msg"/>
|
|
<result property="loginTime" column="login_time"/>
|
|
</resultMap>
|
|
|
|
<select id="selectLogininforList" parameterType="com.glxp.api.req.monitor.FilterLoginLogRequest"
|
|
resultMap="SysLogininforResult">
|
|
select *
|
|
FROM monitor_login_log
|
|
<where>
|
|
<if test="infoId != null">
|
|
and info_id = #{infoId}
|
|
</if>
|
|
<if test="userName != null and userName != ''">
|
|
AND `user_name` like concat('%', #{userName}, '%')
|
|
</if>
|
|
<if test="status != null and status != ''">
|
|
AND `status` = #{status}
|
|
</if>
|
|
<if test="ipaddr != null">
|
|
AND `ipaddr` = #{ipaddr}
|
|
</if>
|
|
<if test="loginLocation != null">
|
|
AND `login_location` = #{loginLocation}
|
|
</if>
|
|
</where>
|
|
order by login_time desc
|
|
</select>
|
|
|
|
|
|
<select id="selectById" parameterType="java.lang.Long"
|
|
resultMap="SysLogininforResult">
|
|
select *
|
|
FROM monitor_login_log
|
|
WHERE oper_id = #{id}
|
|
</select>
|
|
|
|
<insert id="insert" keyProperty="infoId" useGeneratedKeys="true"
|
|
parameterType="com.glxp.api.entity.monitor.SysLogininfor">
|
|
INSERT INTO monitor_login_log( `user_name`, `status`, ipaddr, `login_location`, browser, `os`, msg
|
|
, login_time)
|
|
values (#{userName},
|
|
#{status}, #{ipaddr},
|
|
#{loginLocation}, #{browser}, #{os}, #{msg}, #{loginTime})
|
|
</insert>
|
|
|
|
<delete id="delete" parameterType="java.lang.Long">
|
|
delete
|
|
from monitor_login_log
|
|
where info_id = #{id}
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteBatchIds" parameterType="java.util.List"
|
|
>
|
|
delete
|
|
from monitor_login_log
|
|
where info_id in
|
|
<foreach item="item" index="index" collection="infoIds" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
<delete id="deleteByDate">
|
|
delete from monitor_login_log where date_format(#{date}, '%Y-%m-%d') >= date_format(login_time, '%Y-%m-%d')
|
|
</delete>
|
|
</mapper>
|