<?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.rlzysc.entity.QylrMapper">
    <select id="getQyxxlrList" resultType="java.util.Map">
        select
        decode(qyxx_shzt,'1',caab004,aaab004) as "gsmc",
        decode(qyxx_shzt,'1',caab998,aaab998) as "tyshxydm",
        decode(qyxx_shzt,'1',caab013,aaab013) as "frxm",
        sjhm as "sjhm",
        qyxx_shsj as "qyxxshsj",
        qyxxshr as "qyxxshr",
        qyxx_shzt as "qyxxshzt",
        logo_shzt as "logoshzt",
        sp_shzt as "spshzt",
        qyxx_shyj as "qyxxshyj",
        rs_rlzy_qyxx_lsh as "rsrlzyqyxxlsh",
        rs_yhlsh as "rsyhlsh",
        f_jbxxgl_getAllAreaNameLine(aab078) as "xjzdxzqh"
        from (select
        c.aab004 caab004,
        c.aab998 caab998,
        c.aab013 caab013,
        a.aab004 aaab004,
        a.aab998 aaab998,
        a.aab013 aaab013,
        a.sjhm,
        a.qyxx_shsj,
        (select user_name from v_rs_sy_org_area where user_id = a.qyxx_shr) qyxxshr,
        a.qyxx_shzt,
        a.logo_shzt,
        a.sp_shzt,
        a.qyxx_shyj,
        a.rs_rlzy_qyxx_lsh,
        a.rs_yhlsh,
        a.hrmc,
        a.hrxb,
        a.hrzjhm,
        a.hrlxfs,
        a.ts_xgsj,
        a.aab078
        from v_rs_rlzy_qyxx a,v_tyrz_user_dwjbxx c
        where a.RS_YHLSH = c.useridcode(+)
<!--        and (a.sftjsh = '1' or a.sftjtxsh = '1' or a.sftjspsh = '1')-->
        ) where 1=1
        <if test="dto.dwmc != null and dto.dwmc != ''">
            and aaab004 like '%${ dto.dwmc }%'
        </if>
        <if test="dto.tyshxydm != null and dto.tyshxydm != ''">
            and aaab998 = #{dto.tyshxydm}
        </if>
        order by ts_xgsj desc
    </select>
    <select id="getQyxxShtgList" resultType="java.util.Map">
        select
        decode(qyxx_shzt,'1',caab004,aaab004) as "gsmc",
        decode(qyxx_shzt,'1',caab998,aaab998) as "tyshxydm",
        decode(qyxx_shzt,'1',caab013,aaab013) as "frxm",
        sjhm as "sjhm",
        qyxx_shsj as "qyxxshsj",
        qyxxshr as "qyxxshr",
        qyxx_shzt as "qyxxshzt",
        logo_shzt as "logoshzt",
        sp_shzt as "spshzt",
        qyxx_shyj as "qyxxshyj",
        rs_rlzy_qyxx_lsh as "rsrlzyqyxxlsh",
        rs_yhlsh as "rsyhlsh",
        aab078 as "aab078"
        from (select
        c.aab004 caab004,
        c.aab998 caab998,
        c.aab013 caab013,
        a.aab004 aaab004,
        a.aab998 aaab998,
        a.aab013 aaab013,
        a.sjhm,
        a.aab078,
        a.qyxx_shsj,
        (select user_name from v_rs_sy_org_area where user_id = a.qyxx_shr) qyxxshr,
        a.qyxx_shzt,
        a.logo_shzt,
        a.sp_shzt,
        a.qyxx_shyj,
        a.rs_rlzy_qyxx_lsh,
        a.rs_yhlsh,
        a.hrmc,
        a.hrxb,
        a.hrzjhm,
        a.hrlxfs,
        a.ts_xgsj
        from v_rs_rlzy_qyxx a,v_tyrz_user_dwjbxx c
        where a.RS_YHLSH = c.useridcode(+)
        ) where 1=1
        <if test="dto.dwmc != null and dto.dwmc != ''">
            and aaab004 like '%${ dto.dwmc }%'
        </if>
        order by qyxx_shsj desc
    </select>

</mapper>
