<?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.pangu.application.mapper.AppApiMapper">

    <!-- 批量插入应用接口授权 -->
    <insert id="batchInsert">
        INSERT INTO pg_app_api (app_id, api_id, create_time)
        VALUES
        <foreach collection="list" item="item" separator=",">
            (#{item.appId}, #{item.apiId}, #{item.createTime})
        </foreach>
    </insert>

    <!-- 根据应用ID删除授权 -->
    <delete id="deleteByAppId">
        DELETE FROM pg_app_api WHERE app_id = #{appId}
    </delete>

</mapper>
