|
@@ -1,108 +1,111 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.usky.system.mapper.SysLogininforMapper">
|
|
|
|
|
|
- <resultMap type="com.usky.system.domain.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="msg" column="msg" />
|
|
|
- <result property="accessTime" column="access_time" />
|
|
|
- <result property="deptId" column="dept_id" />
|
|
|
- <result property="tenantId" column="tenant_id" />
|
|
|
- <result property="createBy" column="create_by" />
|
|
|
- </resultMap>
|
|
|
+ <resultMap type="com.usky.system.domain.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="msg" column="msg"/>
|
|
|
+ <result property="accessTime" column="access_time"/>
|
|
|
+ <result property="deptId" column="dept_id"/>
|
|
|
+ <result property="tenantId" column="tenant_id"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ </resultMap>
|
|
|
|
|
|
- <insert id="insertLogininfor" parameterType="com.usky.system.domain.SysLogininfor"
|
|
|
- useGeneratedKeys="true" keyProperty="infoId">
|
|
|
- insert into sys_logininfor
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="userName != null"> user_name, </if>
|
|
|
- <if test="status != null"> status, </if>
|
|
|
- <if test="ipaddr != null"> ipaddr, </if>
|
|
|
- <if test="msg != null"> msg, </if>
|
|
|
- <if test="accessTime != null"> access_time, </if>
|
|
|
- <if test="deptId != null"> dept_id, </if>
|
|
|
- <if test="tenantId != null"> tenant_id, </if>
|
|
|
- <if test="createBy != null"> create_by, </if>
|
|
|
- </trim>
|
|
|
- values
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="userName != null"> #{userName},</if>
|
|
|
- <if test="status != null"> #{status},</if>
|
|
|
- <if test="ipaddr != null"> #{ipaddr},</if>
|
|
|
- <if test="msg != null"> #{msg},</if>
|
|
|
- <if test="accessTime != null"> #{accessTime},</if>
|
|
|
- <if test="deptId != null"> #{deptId},</if>
|
|
|
- <if test="tenantId != null"> #{tenantId},</if>
|
|
|
- <if test="createBy != null"> #{createBy},</if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
+ <insert id="insertLogininfor" parameterType="com.usky.system.domain.SysLogininfor"
|
|
|
+ useGeneratedKeys="true" keyProperty="infoId">
|
|
|
+ insert into sys_logininfor
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userName != null">user_name,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="ipaddr != null">ipaddr,</if>
|
|
|
+ <if test="msg != null">msg,</if>
|
|
|
+ <if test="accessTime != null">access_time,</if>
|
|
|
+ <if test="deptId != null">dept_id,</if>
|
|
|
+ <if test="tenantId != null">tenant_id,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ </trim>
|
|
|
+ values
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userName != null">#{userName},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="ipaddr != null">#{ipaddr},</if>
|
|
|
+ <if test="msg != null">#{msg},</if>
|
|
|
+ <if test="accessTime != null">#{accessTime},</if>
|
|
|
+ <if test="deptId != null">#{deptId},</if>
|
|
|
+ <if test="tenantId != null">#{tenantId},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
|
|
|
- <select id="selectLogininforList" parameterType="com.usky.system.domain.SysLogininfor" resultMap="SysLogininforResult">
|
|
|
- select info_id, user_name, ipaddr, status, msg, access_time, tenant_id from sys_logininfor d
|
|
|
- <where>
|
|
|
- <if test="ipaddr != null and ipaddr != ''">
|
|
|
- AND ipaddr like concat('%', #{ipaddr}, '%')
|
|
|
- </if>
|
|
|
- <if test="status != null and status != ''">
|
|
|
- AND status = #{status}
|
|
|
- </if>
|
|
|
- <if test="userName != null and userName != ''">
|
|
|
- AND user_name like concat('%', #{userName}, '%')
|
|
|
- </if>
|
|
|
- <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
|
|
- and date_format(access_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
|
|
- </if>
|
|
|
- <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
|
|
- and date_format(access_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
|
|
- </if>
|
|
|
- <if test="1 == 1">
|
|
|
- and tenant_id = #{tenantId}
|
|
|
- </if>
|
|
|
- <!-- 数据范围过滤 -->
|
|
|
- ${params.dataScope}
|
|
|
- </where>
|
|
|
- order by info_id desc
|
|
|
- </select>
|
|
|
+ <select id="selectLogininforList" parameterType="com.usky.system.domain.SysLogininfor"
|
|
|
+ resultMap="SysLogininforResult">
|
|
|
+ select info_id, user_name, ipaddr, status, msg, access_time, tenant_id, dept_id from sys_logininfor d
|
|
|
+ <where>
|
|
|
+ <if test="ipaddr != null and ipaddr != ''">
|
|
|
+ AND ipaddr like concat('%', #{ipaddr}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ AND status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="userName != null and userName != ''">
|
|
|
+ AND user_name like concat('%', #{userName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
|
|
+ and date_format(access_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
|
|
+ </if>
|
|
|
+ <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
|
|
+ and date_format(access_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
|
|
+ </if>
|
|
|
+ <if test="1 == 1">
|
|
|
+ and tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
+ <!-- 数据范围过滤 -->
|
|
|
+ ${params.dataScope}
|
|
|
+ </where>
|
|
|
+ order by info_id desc
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="selectLogininforListExport" parameterType="com.usky.system.domain.SysLogininfor" resultType="com.usky.system.service.vo.SysLoginExportVO">
|
|
|
- select info_id, ipaddr, user_name, (case status when '0' then '成功' else '失败' end) as status, msg, access_time from sys_logininfor d
|
|
|
- <where>
|
|
|
- <if test="ipaddr != null and ipaddr != ''">
|
|
|
- AND ipaddr like concat('%', #{ipaddr}, '%')
|
|
|
- </if>
|
|
|
- <if test="status != null and status != ''">
|
|
|
- AND status = #{status}
|
|
|
- </if>
|
|
|
- <if test="userName != null and userName != ''">
|
|
|
- AND user_name like concat('%', #{userName}, '%')
|
|
|
- </if>
|
|
|
- <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
|
|
- and date_format(access_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
|
|
- </if>
|
|
|
- <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
|
|
- and date_format(access_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
|
|
- </if>
|
|
|
- <if test="1 == 1">
|
|
|
- and tenant_id = #{tenantId}
|
|
|
- </if>
|
|
|
- ${params.dataScope}
|
|
|
- </where>
|
|
|
- order by info_id desc
|
|
|
- </select>
|
|
|
+ <select id="selectLogininforListExport" parameterType="com.usky.system.domain.SysLogininfor"
|
|
|
+ resultType="com.usky.system.service.vo.SysLoginExportVO">
|
|
|
+ select info_id, ipaddr, user_name, (case status when '0' then '成功' else '失败' end) as status, msg, access_time
|
|
|
+ from sys_logininfor d
|
|
|
+ <where>
|
|
|
+ <if test="ipaddr != null and ipaddr != ''">
|
|
|
+ AND ipaddr like concat('%', #{ipaddr}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ AND status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="userName != null and userName != ''">
|
|
|
+ AND user_name like concat('%', #{userName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
|
|
+ and date_format(access_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
|
|
+ </if>
|
|
|
+ <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
|
|
+ and date_format(access_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
|
|
+ </if>
|
|
|
+ <if test="1 == 1">
|
|
|
+ and tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
+ ${params.dataScope}
|
|
|
+ </where>
|
|
|
+ order by info_id desc
|
|
|
+ </select>
|
|
|
|
|
|
- <delete id="deleteLogininforByIds" parameterType="Long">
|
|
|
- delete from sys_logininfor where info_id in
|
|
|
- <foreach collection="array" item="infoId" open="(" separator="," close=")">
|
|
|
- #{infoId}
|
|
|
- </foreach>
|
|
|
- </delete>
|
|
|
+ <delete id="deleteLogininforByIds" parameterType="Long">
|
|
|
+ delete from sys_logininfor where info_id in
|
|
|
+ <foreach collection="array" item="infoId" open="(" separator="," close=")">
|
|
|
+ #{infoId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
|
|
|
- <update id="cleanLogininfor">
|
|
|
+ <update id="cleanLogininfor">
|
|
|
truncate table sys_logininfor
|
|
|
</update>
|
|
|
|