<?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="vip.xiaonuo.biz.modular.bizarea.mapper.BizAreaMapper">

    <select id="areaListByUser" resultType="vip.xiaonuo.biz.modular.bizarea.entity.BizArea">
        SELECT
            any_value(a.area_id) id,
	        a.area_name areaName
        FROM
            (
            SELECT
                bv.id,
                bv.video_name,
                bv.video_area,
                bv.serial,
                bv.channel_no,
                ba.area_name,
                ba.id area_id
            FROM
                biz_user_video buv
                LEFT JOIN biz_video bv ON bv.id = buv.video_id
                LEFT JOIN biz_area ba ON ba.id = bv.video_area
                ${ew.customSqlSegment}
            ) a
        GROUP BY
            a.area_name
    </select>
</mapper>
