<?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.VRsRlzyQyxxMapper">
    <select id="getDwjbxxList" parameterType="com.zjrs.zwnw.rlzysc.dto.DwxxQueryDTO" resultType="HashMap">
        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",
        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.aab078,
        a.logo_dz as logodz,a.sp_dz as spdz
        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.gsmc != null and dto.gsmc != ''">
            and (aaab004 like '%${ dto.gsmc }%' or caab004 like '%${ dto.gsmc }%')
        </if>
        <if test="dto.frxm != null and dto.frxm != ''">
            and (aaab013 like '%${ dto.frxm }%' or caab013 like '%${ dto.frxm }%')
        </if>
        <if test="dto.userregioncode != '440800'">
            and aab078 = #{dto.userregioncode}
        </if>

    </select>

    <select id="getJbxxglDwjbxx" parameterType="String" resultType="HashMap">
        select
        c.ztid as "ztid",
        c.aab004 as "aab004",<!--公司名称-->
        c.aab998 as "aab998", <!--法人和其他组织统一社会信用代码-->
        f_jbxxgl_getAllAreaName(c.aab078) as "aab078",<!--登记注册行政区划代码-->
        c.bze001 as "bze001", <!--登记地址-->
        c.aab019 as "aab019", <!--单位类型-->
        c.aab020 as "aab020", <!--经济类型-->
        c.aab021 as "aab021", <!--隶属关系-->
        c.aab022 as "aab022", <!--行业代码-->
        c.aae005 as "aae005", <!--联系电话-->
        c.aae004 as "aae004", <!--联系人-->
        c.aae006 as "aae006", <!--联系地址，单位地址-->
        c.aae007 as "aae007", <!--邮政编码-->
        c.aae159 as "aae159", <!--联系电子邮箱-->
        c.aab013 as "aab013", <!--法定代表人姓名-->
        c.aac058 as "aac058", <!--法定代表人身份证件类型-->
        c.aab014 as "aab014", <!--法定代表人公民身份号码-->
        c.baa120 as "baa120" <!--有效状态-->
        from rs_ggfw_user b, v_ab01 c
        where b.ztid = c.ztid
        and b.userid = #{userid}
    </select>

    <select id="getQyxx" parameterType="map" resultType="HashMap">
        select
        c.yyzz             as "yyzz",<!-- 营业执照-->
        c.gsbq             as "gsbq",<!-- 公司标签-->
        c.gsgm             as "gsgm",<!-- 公司规模-->
        c.gswz             as "gswz",<!-- 公司网站-->
        c.zpdq             as "zpdq",<!-- 招聘地区-->
        c.clrq             as "clrq",<!-- 成立日期-->
        c.dzyx             as "dzyx",<!-- 联系电子邮箱-->
        c.yzbm             as "yzbm",<!-- 邮政编码-->
        c.dtbz             as "dtbz",<!-- 地图标注-->
        c.czhm             as "czhm",<!-- 传真号码-->
        c.gsjs             as "gsjs",<!-- 公司介绍-->
        c.gsfl             as "gsfl",<!-- 公司福利-->
        c.gsxz             as "gsxz",<!-- 公司性质-->
        c.zczb             as "zczb",<!-- 注册资本-->
        c.sjhm             as "sjhm",<!-- 手机号码-->
        c.qyxx_shzt     as "qyxxshzt",<!-- 企业信息审核状态-->
        c.qyxx_shyj as "qyxxshyj",
        c.sftjsh        as "sftjsh",<!-- 是否提交审核-->
        c.qyxx_shzt as "qyxxshzt",
        c.rs_rlzy_qyxx_lsh as "rsrlzyqyxxlsh",<!-- 主键-->
        c.logo_dz as "logodz",
        c.logo_shzt as "logoshzt",
        c.sftjtxsh as "sftjtxsh",
        c.logo_shyj as "logoshyj",
        c.sp_dz as "spdz",
        c.sp_shzt as "spshzt",
        c.sftjspsh as "sftjspsh",
        c.sp_shyj as "spshyj",
        c.hrmc as "hrmc",
        c.hrxb as "hrxb",
        c.hrzjhm as "hrzjhm",
        c.hrlxfs as "hrlxfs"
        from v_rs_rlzy_qyxx c
        where c.rs_yhlsh = #{map.userid}
    </select>

    <select id="queryJbxx" parameterType="String" resultType="com.zjrs.zwnw.jbxxgl.dto.DwxxDTO">
        select
        c.aab004,
        c.aab998,
        c.aae006,
        c.bze001,
        c.aab078,
        c.aab019,
        c.aab020,
        c.aab021,
        c.aab022,
        c.aae004,
        c.aae005,
        c.baa120,
        c.aab013,
        c.aac058,
        c.aab014
        from v_rs_rlzy_qyxx c
        where c.rs_rlzy_qyxx_lsh = #{rsrlzyqyxxlsh}
    </select>

    <select id="getQyxxAndJbxx" parameterType="map" resultType="HashMap">
        select
        c.yyzz             as "yyzz",<!-- 营业执照-->
        c.gsbq             as "gsbq",<!-- 公司标签-->
        c.gsgm             as "gsgm",<!-- 公司规模-->
        c.gswz             as "gswz",<!-- 公司网站-->
        c.zpdq             as "zpdq",<!-- 招聘地区-->
        c.clrq             as "clrq",<!-- 成立日期-->
        c.dzyx             as "dzyx",<!-- 联系电子邮箱-->
        c.yzbm             as "yzbm",<!-- 邮政编码-->
        c.dtbz             as "dtbz",<!-- 地图标注-->
        c.czhm             as "czhm",<!-- 传真号码-->
        c.gsjs             as "gsjs",<!-- 公司介绍-->
        c.gsfl             as "gsfl",<!-- 公司福利-->
        c.gsxz             as "gsxz",<!-- 公司性质-->
        c.zczb             as "zczb",<!-- 注册资本-->
        c.sjhm             as "sjhm",<!-- 手机号码-->
        c.qyxx_shzt       as "qyxxshzt",<!-- 企业信息审核状态-->
        c.sftjsh        as "sftjsh",<!-- 是否提交审核-->
        c.sftjtxsh as "sftjtxsh",<!-- 是否提交头像审核-->
        c.sftjspsh as "sftjspsh",<!-- 是否提交视频审核-->
        c.rs_rlzy_qyxx_lsh as "rsrlzyqyxxlsh",<!-- 主键-->
        c.qyxx_shyj as "qyxxshyj",
        c.aab004 as "aab004",
        c.aab998 as "aab998",
        c.aae006 as "aae006",
        c.bze001 as "bze001",
        f_jbxxgl_getAllAreaName(c.aab078) as "aab078",
        c.aab019 as "aab019",
        c.aab020 as "aab020",
        c.aab021 as "aab021",
        c.aab022 as "aab022",
        c.aae004 as "aae004",
        c.aae005 as "aae005",
        c.baa120 as "baa120",
        c.aab013 as "aab013",
        c.aac058 as "aac058",
        c.aab014 as "aab014",
        c.hrmc as "hrmc",
        c.hrxb as "hrxb",
        c.hrzjhm as "hrzjhm",
        c.hrlxfs as "hrlxfs",
        c.logo_dz as "logodz",
        c.sp_dz as "spdz"
        from v_rs_rlzy_qyxx c
        where c.rs_yhlsh = #{map.userid}
    </select>

    <select id="getQyxxByQyid" parameterType="map" resultType="HashMap">
        select
        c.yyzz             as "yyzz",<!-- 营业执照-->
        c.gsbq             as "gsbq",<!-- 公司标签-->
        c.gsgm             as "gsgm",<!-- 公司规模-->
        c.gswz             as "gswz",<!-- 公司网站-->
        c.zpdq             as "zpdq",<!-- 招聘地区-->
        c.clrq             as "clrq",<!-- 成立日期-->
        c.dzyx             as "dzyx",<!-- 联系电子邮箱-->
        c.yzbm             as "yzbm",<!-- 邮政编码-->
        c.dtbz             as "dtbz",<!-- 地图标注-->
        c.czhm             as "czhm",<!-- 传真号码-->
        c.gsjs             as "gsjs",<!-- 公司介绍-->
        c.gsfl             as "gsfl",<!-- 公司福利-->
        c.gsxz             as "gsxz",<!-- 公司性质-->
        c.zczb             as "zczb",<!-- 注册资本-->
        c.sjhm             as "sjhm",<!-- 手机号码-->
        c.qyxx_shzt     as "qyxxshzt",<!-- 企业信息审核状态-->
        c.qyxx_shyj as "qyxxshyj",
        c.sftjsh        as "sftjsh",<!-- 是否提交审核-->
        c.qyxx_shzt as "qyxxshzt",
        c.rs_rlzy_qyxx_lsh as "rsrlzyqyxxlsh",<!-- 主键-->
        c.logo_dz as "logodz",
        c.logo_shzt as "logoshzt",
        c.sftjtxsh as "sftjtxsh",
        c.logo_shyj as "logoshyj",
        c.sp_dz as "spdz",
        c.sp_shzt as "spshzt",
        c.sftjspsh as "sftjspsh",
        c.sp_shyj as "spshyj",
        d.ztid  as "ztid",
        c.rs_yhlsh as "rsyhlsh"
        from v_rs_rlzy_qyxx c,v_tyrz_user_dwjbxx d
        where c.rs_rlzy_qyxx_lsh = #{map.rsrlzyqyxxlsh}
        and c.rs_yhlsh = d.useridcode(+)
    </select>

</mapper>
