<?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.tofly.third.mapper.YyCblrMapper">

    <select id="fbsjtj" resultType="integer">
        select
            count(1) num
        from
            yh_bjfl_zb a
        left join
            yh_bjfl_fb b on a.id = b.zb_id
        left join
            yy_cblr c on a.yhbh = c.yhbh and a.cbkh = c.cbkh
        where
            b.zb_id != b.id
        and
            a.isdisabled = '1'
        and
            c.sl > 0
        and
            a.yhbh = #{yhbh}
        and
            a.cbkh = #{cbkh}
        group by
            a.yhbh, a.cbkh
    </select>

</mapper>