<?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.yunzhi.marketing.mapper.TaOrgCityMapper">
    <select id="selectByIdCity"  resultType="string">
        select city_id from ta_org_city where  parentid != 100000 and  org_id = #{orgId}
    </select>

    <select id="selectAdminTdCityList" resultType="com.yunzhi.marketing.entity.TaOrgCity">
                SELECT
                    oc.city_id AS id,
                    oc.`name` AS name,
                    oc.org_id,
                    oc.`status`,
                    oc.parentid,
                LEFT (c.pinyin, 1) AS initial
                FROM
                ta_org_city oc
                LEFT JOIN td_city c ON oc.city_id = c.id
                WHERE
                oc.org_id = #{orgId}
                and  oc.parentid  !=100000
                and  oc.status = 1
                ORDER BY
                c.pinyin
    </select>
    <select id="selectAdminTdAreaCityList" resultType="com.yunzhi.marketing.entity.TaOrgCity">
        SELECT
        id,
        NAME,
        parentid,
        LEFT ( pinyin, 1 ) AS initial
        FROM
        td_city
        WHERE
        parentid = #{cityId}
    </select>
</mapper>
