<?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.ruoyi.project.system.userLoginInfo.mapper.UserLoginInfoMapper">
|
|
<resultMap type="UserLoginInfo" id="UserLoginInfoResult">
|
<result property="userId" column="user_id" />
|
<result property="loginIp" column="login_ip" />
|
<result property="loginDate" column="login_date" />
|
<result property="createBy" column="create_by" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateTime" column="update_time" />
|
<result property="remark" column="remark" />
|
<result property="token" column="token" />
|
<result property="deviceType" column="device_type" />
|
<result property="deviceId" column="device_id" />
|
<result property="appType" column="app_type" />
|
<result property="loginName" column="login_name" />
|
<result property="companyId" column="company_id" />
|
<result property="companyName" column="company_name" />
|
<result property="userName" column="user_name" />
|
</resultMap>
|
|
<sql id="selectUserLoginInfoVo">
|
select userLoginInfo.user_id, userLoginInfo.login_ip, userLoginInfo.login_date,
|
userLoginInfo.create_by, userLoginInfo.create_time, userLoginInfo.update_by, userLoginInfo.update_time,
|
userLoginInfo.remark,
|
userLoginInfo.token, userLoginInfo.device_type, userLoginInfo.device_id, userLoginInfo.app_type,
|
userInfo.login_name,userInfo.company_id,userInfo.user_name,
|
companyInfo.company_name
|
from sys_user_login_info userLoginInfo
|
left join sys_user userInfo
|
on userLoginInfo.user_id = userInfo.user_id
|
left join sys_company companyInfo
|
on companyInfo.company_id = userInfo.company_id
|
</sql>
|
|
<select id="selectUserLoginInfoList" parameterType="UserLoginInfo" resultMap="UserLoginInfoResult">
|
<include refid="selectUserLoginInfoVo"/>
|
<where>
|
<if test="loginIp != null and loginIp != ''"> and userLoginInfo.login_ip = #{loginIp}</if>
|
<if test="loginDate != null "> and userLoginInfo.login_date = #{loginDate}</if>
|
<if test="token != null and token != ''"> and userLoginInfo.token = #{token}</if>
|
<if test="deviceType != null and deviceType != ''"> and userLoginInfo.device_type = #{deviceType}</if>
|
<if test="deviceId != null and deviceId != ''"> and userLoginInfo.device_id = #{deviceId}</if>
|
<if test="appType != null and appType != ''"> and userLoginInfo.app_type = #{appType}</if>
|
</where>
|
</select>
|
|
<select id="selectUserLoginInfoById" parameterType="Long" resultMap="UserLoginInfoResult">
|
<include refid="selectUserLoginInfoVo"/>
|
where userLoginInfo.user_id = #{userId}
|
</select>
|
|
<insert id="insertUserLoginInfo" parameterType="UserLoginInfo">
|
insert into sys_user_login_info
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="userId != null ">user_id,</if>
|
<if test="loginIp != null and loginIp != ''">login_ip,</if>
|
<if test="loginDate != null ">login_date,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createTime != null ">create_time,</if>
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
<if test="updateTime != null ">update_time,</if>
|
<if test="remark != null and remark != ''">remark,</if>
|
<if test="token != null and token != ''">token,</if>
|
<if test="deviceType != null and deviceType != ''">device_type,</if>
|
<if test="deviceId != null and deviceId != ''">device_id,</if>
|
<if test="appType != null and appType != ''">app_type,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="userId != null ">#{userId},</if>
|
<if test="loginIp != null and loginIp != ''">#{loginIp},</if>
|
<if test="loginDate != null ">#{loginDate},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
<if test="updateTime != null ">#{updateTime},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
<if test="token != null and token != ''">#{token},</if>
|
<if test="deviceType != null and deviceType != ''">#{deviceType},</if>
|
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
|
<if test="appType != null and appType != ''">#{appType},</if>
|
</trim>
|
</insert>
|
|
<update id="updateUserLoginInfo" parameterType="UserLoginInfo">
|
update sys_user_login_info
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
|
<if test="loginDate != null ">login_date = #{loginDate},</if>
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
<if test="token != null and token != ''">token = #{token},</if>
|
<if test="deviceType != null and deviceType != ''">device_type = #{deviceType},</if>
|
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
|
<if test="appType != null and appType != ''">app_type = #{appType},</if>
|
</trim>
|
where user_id = #{userId}
|
</update>
|
|
<delete id="deleteUserLoginInfoById" parameterType="Long">
|
delete from sys_user_login_info where user_id = #{userId}
|
</delete>
|
|
<delete id="deleteUserLoginInfoByIds" parameterType="String">
|
delete from sys_user_login_info where user_id in
|
<foreach item="userId" collection="array" open="(" separator="," close=")">
|
#{userId}
|
</foreach>
|
</delete>
|
|
</mapper>
|