<?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="cn.reghao.tnb.account.app.db.mapper.LoginAttemptsMapper">
    <insert id="save">
        insert into msg_login_attempts
        (`id`,`deleted`,`create_time`,`update_time`,`login_id`,`user_id`,`login_type`,`user_agent`,`login_ip`,`login_at`,`plat`,`remember_me`)
        values
        (#{id},#{deleted},#{createTime},#{updateTime},#{loginId},#{userId},#{loginType},#{userAgent},#{loginIp},#{loginAt},#{plat},#{rememberMe})
    </insert>

    <select id="findAll" resultType="cn.reghao.tnb.account.app.model.po.LoginAttempts">
        select * from msg_login_attempts
    </select>
    <select id="findByLoginId" resultType="cn.reghao.tnb.account.app.model.po.LoginAttempts">
        select * from msg_login_attempts
        where login_id=#{loginId}
    </select>
    <select id="findByLoginIds" resultType="cn.reghao.tnb.account.app.model.po.LoginAttempts">
        select * from msg_login_attempts
        where login_id in
        <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
            #{id}
        </foreach>
    </select>
</mapper>
