<?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.message.app.db.mapper.EmailAccountMapper">
    <insert id="save">
        insert into message_email_account
        (`smtp`,`username`,`password`,`personal`)
        values
        (#{smtp},#{username},#{password},#{personal})
    </insert>

    <delete id="deleteById">
        delete from message_email_account
        where id=#{id}
    </delete>

    <select id="findAll" resultType="cn.reghao.tnb.message.app.model.po.EmailAccount">
        select *
        from message_email_account
    </select>
    <select id="findByUsername" resultType="cn.reghao.tnb.message.app.model.po.EmailAccount">
        select *
        from message_email_account
        where username=#{username}
    </select>
</mapper>