<?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.fateverse.query.mapper.PortalInterfaceMapper">

    <select id="selectById" resultType="cn.fateverse.query.entity.PortalInterface">
        select interface_id, url, content_type, request_method
        from portal_interface
        where interface_id = #{interfaceId}
    </select>

    <insert id="insert" useGeneratedKeys="true" keyColumn="interface_id" keyProperty="interfaceId">
        insert into portal_interface (interface_id, url, content_type, request_method)
        values (#{interfaceId}, #{url}, #{contentType}, #{requestMethod})
    </insert>

    <update id="update">
        update portal_interface
        set content_type   = #{contentType},
            url            = #{url},
            request_method = #{requestMethod}
        where interface_id = #{interfaceId}
    </update>

    <delete id="deleteById">
        delete
        from portal_interface
        where interface_id = #{interfaceId}
    </delete>

</mapper>