<?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="org.king.modules.ad.mapper.AdDepartMapper">

    <select id="queryJsDepart" resultType="org.king.modules.ad.entity.AdChargingStatistics">
        select DEPART_NO,DEPART_NAM
        from depart where UPDEPART_NO = 384
    </select>

    <select id="queryDepartAndEcg" resultType="com.alibaba.fastjson.JSONObject">
        select t1.depart_no,t2.ecg_no
        from depart t1 left join base_wharf t2 on t1.DEPART_NO = t2.depart_no
        where t1.UPDEPART_NO = 384
    </select>

    <select id="putEcgDepartDataToRedis" resultType="org.king.modules.ad.entity.DepartEcgComNo">
        select distinct t1.ecg_no, t3.com_no, t2.DEPART_NAM
        from base_wharf t1
                 left join depart t2 on t1.depart_no = t2.DEPART_NO
                 left join ent_company_geom t3 on t1.ecg_no = t3.ecg_no
        where DEPART_NAM is not null
    </select>
</mapper>