<?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.rlzysc.entity.JlglMapper">
    
    <select id="getDwzpJlxxList" parameterType="com.zjrs.ggfw.rlzysc.dto.dwzp.DwzpJlListQueryDTO" resultType="HashMap">
        select a.rs_rlzy_jlgl_lsh "rsRlzyJlglLsh",a.rs_rlzy_jlxx_lsh "rsRlzyJlxxLsh",
            a.rs_rlzy_zwxx_lsh "rsRlzyZwxxLsh",a.rs_rlzy_qyxx_lsh "rsRlzyQyxxLsh",b.xm "xm",
            a.zt "zt",b.cjgzsj "cjgzsj",c.zwmc "zwmc",b.ts_xl "xl",e.qwxz "qwxz",b.ts_qzlx "qzlx",
            b.tx_tycc_lsh "txTyccid",b.sp_tycc_lsh "spTyccid",0 "sczt",
            0 "msyqzt",
            b.shjg "shjg",b.txshjg "txshjg",b.spshjg "spshjg"
        from v_rs_rlzy_jlgl a,v_rs_rlzy_jlxx b,v_rs_rlzy_zwxx c,v_rs_rlzy_qzyx_dyb d,v_rs_rlzy_qzyx e
        where a.rs_rlzy_jlxx_lsh=b.rs_rlzy_jlxx_lsh and a.rs_rlzy_zwxx_lsh=c.rs_rlzy_zwxx_lsh
            and b.rs_rlzy_jlxx_lsh=d.rs_rlzy_jlxx_lsh and d.rs_rlzy_qzyx_lsh=e.rs_rlzy_qzyx_lsh
            and a.rs_rlzy_qyxx_lsh = #{dto.rsRlzyQyxxLsh}
        <if test="dto.zt != null and dto.zt != ''">
            and a.zt = #{dto.zt}
        </if>
        <if test="dto.xm != null and dto.xm != ''">
            and b.xm like '%${ dto.xm }%'
        </if>
        <if test="dto.zwmc != null and dto.zwmc != ''">
            and c.zwmc like '%${dto.zwmc}%'
        </if> 
        <if test="dto.qwxzq != null and dto.qwxzq != ''">
            and e.qwxz = #{dto.qwxzq}
        </if>
        order by a.ts_cjsj DESC
    </select>
</mapper>
