<?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.ruoyi.demo.mapper.StoreWdDao">
    <resultMap id="heatBo" type="com.ruoyi.demo.entity.bo.HeatMapBo">
        <constructor>
            <arg column="lng" javaType="_double"></arg>
            <arg column="lat" javaType="_double"></arg>
            <arg column="index_score" javaType="_double"></arg>
        </constructor>
    </resultMap>

    <select id="perCapitaConsumpAnalyse" resultType="com.ruoyi.demo.entity.StoreWd">
        select per_capita_consumption from ddt_store_wd where per_capita_consumption is not null and wd_id in (select ${ew.sqlSelect} from ddt_wd_info ${ew.customSqlSegment})
    </select>
    <select id="operateTimeAnalyse" resultType="com.ruoyi.demo.entity.StoreWd">
        select opentime,closetime from ddt_store_wd where opentime != '' and closetime != '' and wd_id in (select ${ew.sqlSelect} from ddt_wd_info ${ew.customSqlSegment})
    </select>

    <select id="category" resultType="com.ruoyi.demo.entity.StoreWd">
        select manage_type_code,count(*) as comment_count from ddt_store_wd where wd_id in (select ${ew.sqlSelect} from ddt_wd_info ${ew.customSqlSegment}) group by manage_type_code
    </select>

    <select id="businessStatusAnalyse" resultType="com.ruoyi.demo.entity.StoreWd">
        select business_status,count(*) as comment_count from ddt_store_wd where wd_id in (select ${ew.sqlSelect} from ddt_wd_info ${ew.customSqlSegment}) group by business_status
    </select>

    <select id="heatMap" resultMap="heatBo">
        select lat,lng,index_score  from ddt_wd_info left join ddt_store_wd on ddt_wd_info.wd_id = ddt_store_wd.wd_id ${ew.customSqlSegment}
    </select>
</mapper>
