<?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.file.app.zoss.db.mapper.UserKeyMapper">
    <insert id="save" useGeneratedKeys="true" keyProperty="id">
        insert into file_user_key
        (`access_key_id`,`access_key_secret`,`create_by`)
        values
        (#{accessKeyId},#{accessKeySecret},#{createBy})
    </insert>

    <update id="updateByCreateBy">
        update file_user_key
        set access_key_id=#{accessKeyId},access_key_secret=#{accessKeySecret}
        where create_by=#{createBy}
    </update>

    <select id="findByCreateBy" resultType="cn.reghao.tnb.file.app.zoss.model.po.UserKey">
        select *
        from file_user_key
        where create_by=#{createBy}
    </select>
    <select id="findByAccessKeyId" resultType="cn.reghao.tnb.file.app.zoss.model.po.UserKey">
        select *
        from file_user_key
        where access_key_id=#{accessKeyId}
    </select>
</mapper>
