<?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.hr.repository.jpa.IpInterfaceRepository">


<!--    <select id="queryByBusinessNo" resultType="com.hr.repository.domain.IpOrderPO">-->
<!--        select * from ip_order where 1=1 and  business_no = :businessNo-->
<!--    </select>-->
    <select id="queryCallbackHistory" resultType="com.hr.vo.CallbackHistoryVO">
        select ord.id,
               ord.callback_url callbackUrl,
               log.request_param requsetParam,
               log.response_result responseParam,
               ord.status callbackStatus,
               ord.add_time addTime,
               ord.update_time updateTime
        from ip_order ord
        left join ip_log log on ord.id = log.oid
        where 1 = 1 and ord.ref_id = :id
    </select>
    <select id="queryPage" resultType="com.hr.vo.IpInterfaceVO">
        select * from ip_interface where 1=1 and interface_name like '%'||:interfaceName||'%' and status in (:statusList) order by id desc
    </select>
    <select id="countEnableInterfaceRef" resultType="java.lang.Integer">
        select count(*) from ip_token_interface where status = 'normal' and iid = :iid
    </select>
    <select id="countEnableAccountRef" resultType="java.lang.Integer">
        select count(*) from ip_token_interface where status = 'normal' and aid = :id
    </select>
</mapper>