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

    <resultMap id="yyCblrMap" type="com.tofly.znb.entity.YyCblr">
        <id property="xycb" column="XYCB"/>
        <result property="yhbh" column="YHBH"/>
        <result property="cbkh" column="CBKH"/>
        <result property="cbkid" column="CBKID"/>
        <result property="ssgs" column="SSGS"/>
        <result property="sscbpq" column="SSCBPQ"/>
        <result property="sscbb" column="SSCBB"/>
        <result property="cwrq" column="CWRQ"/>
        <result property="scds" column="SCDS"/>
        <result property="bcds" column="BCDS"/>
        <result property="jjl" column="JJL"/>
        <result property="cbrybm" column="CBRYBM"/>
        <result property="cbryxm" column="CBRYXM"/>
        <result property="cbrq" column="CBRQ"/>
        <result property="lrrybm" column="LRRYBM"/>
        <result property="lrryxm" column="LRRYXM"/>
        <result property="lrrq" column="LRRQ"/>
        <result property="photo" column="PHOTO"/>
        <result property="cbbz" column="CBBZ"/>
        <result property="shbz" column="SHBZ"/>
        <result property="jsbz" column="JSBZ"/>
        <result property="cbcs" column="CBCS"/>
        <result property="cbxh" column="CBXH"/>
        <result property="bz" column="BZ"/>
        <result property="cblx" column="CBLX"/>
        <result property="cbfs" column="CBFS"/>
        <result property="jfzt" column="JFZT"/>
        <result property="sl" column="SL"/>
        <result property="jbzd" column="JBZD"/>
        <result property="xbqd" column="XBQD"/>
        <result property="jbbh" column="JBBH"/>
        <result property="cbly" column="CBLY"/>
        <result property="x" column="X"/>
        <result property="y" column="Y"/>
        <result property="shry" column="SHRY"/>
        <result property="shsj" column="SHSJ"/>
        <result property="shsm" column="SHSM"/>
        <result property="ssregion" column="SSREGION"/>
        <result property="shryxm" column="SHRYXM"/>
        <result property="nbzxds" column="NBZXDS"/>
        <result property="nbzxcbrq" column="NBZXCBRQ"/>
        <result property="jssl" column="JSSL"/>
        <result property="sbzt" column="SBZT"/>
    </resultMap>

    <select id="getCblrByYcb" resultType="com.tofly.znb.entity.Dto.YycblrDto">
        select a.*, b.sbbh bjbh, b.sbsccj
        from yy_cblr a
                 inner join yh_cbkxx b on a.cbkid = b.cbkid
        where b.sblb in (select code from bm_sblb where ISYCSTATE = 1)
          and b.jfzt = '1'
          and b.sbsccj = '6'
    </select>

</mapper>
