<?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.keao.edu.auth.dal.dao.SysUserLoginLogDao">
	
	<resultMap type="com.keao.edu.auth.api.entity.SysUserLoginLog" id="SysUserLoginLog">
		<result column="id_" property="id"/>
		<result column="user_id_" property="userId" />
		<result column="login_ip_" property="loginIp" />
		<result column="login_time_" property="loginTime" />
		<result column="source_" property="source" />
	</resultMap>
	
	
	<!-- 全查询 -->
	<select id="findAll" resultMap="SysUserLoginLog">
		SELECT * FROM sys_user_login_log
	</select>
	
	<!-- 向数据库增加一条记录 -->
	<insert id="insert" parameterType="com.keao.edu.auth.api.entity.SysUserLoginLog" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
		<!--
		<selectKey resultClass="int" keyProperty="id" > 
		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
		</selectKey>
		-->
		INSERT INTO sys_user_login_log (id_,user_id_,login_ip_,login_time_,source_) VALUES(#{id},#{userId},#{loginIp},#{loginTime},#{source})
	</insert>
	
	
	
	<!-- 分页查询 -->
	<select id="queryPage" resultMap="SysUserLoginLog" parameterType="map">
		SELECT * FROM sys_user_login_log <include refid="global.limit"/>
	</select>
	
	<!-- 查询当前表的总记录数 -->
	<select id="queryCount" resultType="int">
		SELECT COUNT(*) FROM sys_user_login_log
	</select>
</mapper>
