<?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.sooka.system.mapper.SysIndexMapper">

    <select id="getInterfaceCountAll" resultType="java.lang.Integer">
        select
            count(id) count
        from
            t_u_interfaceinfo
        where
            del_flag = 0
    </select>
    <select id="getInterfaceCountError" resultType="java.lang.Integer">
        select
            count(id) count
        from
            t_u_interfaceinfo
        where
            status = 1
            and del_flag = 0
    </select>

    <select id="callFrequency" resultType="java.lang.Long">
        select
            sum(callsuccnum) count
        from
            t_u_interfaceinfo
            where
            share_type in (
                'share_type_1',
                'share_type_3',
                'share_type_4'
            )
    </select>
    <select id="pushFrequency" resultType="java.lang.Long">
        select
            sum(callsuccnum) count
        from
            t_u_interfaceinfo
        where
            share_type in (
                'share_type_2',
                'share_type_3'
            )
    </select>
    <select id="pullFrequency" resultType="java.lang.Long">
        select
            sum(callsuccnum) count
        from
            t_u_interfaceinfo
        where
            share_type in (
                'share_type_1',
                'share_type_4'
            )
    </select>

    <select id="joinUpDepts" parameterType="com.sooka.system.domain.SysDept" resultType="java.lang.Integer">
        select
            count(d.dept_id)
        from
            sys_dept d
        where
            d.status = 0
        and
            d.del_flag = '0'
        and
            d.parent_id = #{parentId}
        <!-- 数据范围过滤 -->
        ${params.dataScope}
    </select>




</mapper>
