<?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.zwnw.dbgl.entity.XbbmglMapper">
    <select id="getDbrwList" resultType="HashMap" parameterType="com.zjrs.zwnw.dbgl.dto.DbrwglDbrwQueryDTO">
        select a.rs_dbgl_dbrw_lsh as "rsdbgldbrwlsh",
        b.rs_dbgl_dbxm_lsh as "rsdbgldbxmlsh",
        a.dbbh as "dbbh",
        b.xmmc AS "dbxm",
        a.rwlyfl as "rwlyfl",
        a.rwly as "rwly",
        a.wh as "wh",
        a.fwdw as "fwdw",
        a.fwsj as "fwsj",
        a.tbzq as "tbzq",
        a.sctbjzrq as "sctbjzrq",
        f_dbgl_getSysxByRwlsh(a.rs_dbgl_dbrw_lsh) as "sysx",
        a.rwjsrq as "rwjsrq",
        a.yellowyj as "yellowyj",
        a.redyj as "redyj",
        a.pfzt as "pfzt",
        a.pfsj as "pfsj",
        a.pfr as "pfr",
        a.jsr as "jsr",
        a.rwzt as "rwzt",
        a.sdpj as "sdpj",
        a.zlpj as "zlpj",
        a.pjms as "pjms",
        a.pjr as "pjr",
        a.pjjg as "pjjg",
        a.pjsj as "pjsj",
        a.jssj as "jssj",
        a.ts_yxbz as "tsyxbz",
        a.bae001 as "bae001",
        a.bae002 as "bae002",
        a.bae003 as "bae003",
        a.bae004 as "bae004",
        a.bae005 as "bae005",
        a.bae006 as "bae006",
        '' as "qtbm",
        '' as "xbbm"
        from v_rs_dbgl_dbrw a, V_RS_DBGL_DBXM_YX b
        where a.RS_DBGL_DBRW_LSH = b.RS_DBGL_DBRW_LSH
        and a.pfzt = '1'
        <if test="dto.rwzt != null and dto.rwzt != ''">
            and a.rwzt = #{dto.rwzt}
        </if>
        <if test="dto.bae001 != null and dto.bae001 != ''">
            and a.bae001 = #{dto.bae001}
        </if>
        order by a.dbbh desc,b.xmbh asc
    </select>
</mapper>
