<?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.zjrs.ggfw.portal.entity.RsWbBjSubMapper">
    <select id="getYjsYwxx" resultType="com.zjrs.ggfw.portal.po.RsWbBjSub">
        SELECT b.*,'' "ywid", '' "dddwmc",
        (select area_name from aa16 where id = b.tcustProvince) as "tcustProvincename",
        (select area_name from aa16 where id = b.tcustCity) as "tcustCityname",
        (select area_name from aa16 where id = b.tcustCounty) as "tcustCountyname"
        FROM RS_WB_BJ a,RS_WB_BJ_SUB b
        WHERE a.RS_WB_BJ_LSH = b.RS_WB_BJ_LSH
        and b.sbsx = '4408006206' and a.RS_WB_BJ_LSH = #{dto.rsWbBjLsh}
    </select>

    <select id="getSubBjSbsx" resultType="String" parameterType="String">
        select LISTAGG(b.sbsx,',') WITHIN GROUP( ORDER BY b.sbsx) sbsx from rs_wb_bj a,rs_wb_bj_sub b
        where a.rs_wb_bj_lsh = b.rs_wb_bj_lsh
        and b.rs_wb_bj_lsh = #{rsWbBjLsh}
    </select>

    <select id="getSubBjXx" resultType="map" parameterType="com.zjrs.ggfw.portal.dto.HcpDTO">
        select '4408006206' wblshs,
        '01' sllshs
        from rs_wb_bj a,rs_wb_bj_sub b
        where a.rs_wb_bj_lsh = b.rs_wb_bj_lsh
            <if test="dto.sllsh != null and dto.sllsh != ''">
                and a.sllsh = #{dto.sllsh}
            </if>
    </select>
</mapper>
