<?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="loginOut">

	<sql id="tableLoginOut">TN_CF_LOGIN_OUT</sql>

	<insert id="insertLoginOut" parameterType="java.util.HashMap">
		INSERT INTO <include refid="tableLoginOut" />
		(TOKEN, USER_ID, LOGIN_TIME, LOGOUT_TIME, USE_IP, REQ_TYPE)
		VALUES
		(#{token}, #{userId}, #{loginTime}, #{logoutTime}, #{useIp}, #{reqType})
	</insert>

	<update id="updateLoginOut" parameterType="java.util.HashMap">
		UPDATE <include refid="tableLoginOut" />
		SET    USER_ID = #{userId},
		       LOGIN_TIME = #{loginTime},
		       LOGOUT_TIME = #{logoutTime},
		       USE_IP = #{useIp},
		       REQ_TYPE = #{reqType}
		WHERE  TOKEN = #{token}
	</update>

</mapper>