<?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.screen.mapper.ZongzhiScreenManageMapper">


    <select id="getWorkDynamics" resultType="com.ruoyi.screen.domain.response.ZongzhiWorkDynamicsResponse">
        SELECT type, name
        FROM `tc_work_dongtai`
        GROUP BY type, name
    </select>
    <select id="getNetworkReport" resultType="com.ruoyi.screen.domain.response.ZongzhiNetworkReportResponse">
        select count(*) as count, ROUND(count(case when state=2 THEN 1 ELSE NULL END ) * 100.0/ sum(count(*)) OVER (), 1 )as handle
        FROM tc_network_report

    </select>
    <select id="getaction" resultType="com.ruoyi.screen.domain.response.ZongzhiActionResponse">
        select count(*) as count, zhuanxiang_time as zhuanxiangTime ,ROUND(count(*) * 100.0/ sum(count(*)) OVER (), 1 ) as pt
        from tc_qinglang_zhuanxiang
        GROUP BY zhuanxiang_type, zhuanxiang_time

    </select>
    <select id="getReportByYear" resultType="com.ruoyi.screen.domain.response.ZongzhiReportByYearResponse">
        SELECT count(*)as count,source,DATE_FORMAT(NOW(), '%Y') as year
        FROM `tc_network_report`
        GROUP BY source
    </select>
    <select id="getActionDynamicst"
            resultType="com.ruoyi.screen.domain.response.ZongzhiActionDynamicstResponse">
        select zhuanxiang_img as zhuanxiangImg
        from tc_qinglang_zhuanxiang
    </select>

</mapper>