<?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.VRsWbSjdzMapper">

    <select id="getSjdzList"  resultType="com.zjrs.ggfw.portal.po.VRsWbSjdz">
        select RS_WB_SJDZ_LSH as rsWbSjdzLsh,yhid,sjrxm,sjrdh,sjdz,yzbm,mrdz,ts_yxbz,
        (select area_name from aa16 where id = tcustProvince) as tcustprovince,sjdz as sjrxxdz,
        (select area_name from aa16 where id = tcustCity) as tcustcity,
        (select area_name from aa16 where id = tcustCounty) as tcustcounty,
        tcustprovince as tcustProvinceCode,tcustcity as tcustCityCode,tcustcounty as tcustCountyCode
        from V_RS_WB_SJDZ where yhid = #{dto.yhid} order by mrdz desc
    </select>

    <select id="getSjdzDetail"  resultType="com.zjrs.ggfw.portal.po.VRsWbSjdz">
        select RS_WB_SJDZ_LSH as rsWbSjdzLsh,yhid,sjrxm,sjrdh,sjdz,yzbm,mrdz,ts_yxbz,
        tcustprovince,
        tcustcity,
        tcustcounty
        from V_RS_WB_SJDZ where RS_WB_SJDZ_LSH = #{rsWbSjdzLsh}
    </select>
</mapper>
