You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
taicangzongzhi-java/ruoyi-system/src/main/resources/mapper/screen/ZongzhiScreenOpinionMapper.xml

57 lines
2.7 KiB

<?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.ZongzhiScreenOpinionMapper">
<select id="getSentimentType" resultType="com.ruoyi.screen.domain.response.ZongzhiSentimentTypeResponse">
select count(*) as count ,sentiment_type as type,publish_time as publishTime
from tc_network_sentiment
where sentiment_type in ("1", "2")
GROUP BY sentiment_type,publish_time
</select>
<select id="getSentimenCount" resultType="com.ruoyi.screen.domain.response.ZongzhiSentimentCountResponse">
select count(*) as count ,sentiment_type as type,ROUND(COUNT(*) * 100.0 / SUM(COUNT(*)) OVER (), 1) AS pt
from tc_network_sentiment
where sentiment_type !='2'
GROUP BY sentiment_type
</select>
<select id="getSentimenClassificationBymediaType"
resultType="com.ruoyi.screen.domain.response.ZongzhiSentimenClassificationResponse">
select media_type as type, ROUND(COUNT(*) * 100.0 / SUM(COUNT(*)) OVER (), 1) AS pt
from tc_network_sentiment
GROUP BY media_type
</select>
<select id="getSentimenClassificationByeventType"
resultType="com.ruoyi.screen.domain.response.ZongzhiSentimenClassificationResponse">
select event_type as type, ROUND(COUNT(*) * 100.0 / SUM(COUNT(*)) OVER (), 1) AS pt
from tc_network_sentiment
GROUP BY event_type
</select>
<select id="getWordCloud" resultType="com.ruoyi.screen.domain.response.ZongzhiSentimenWordCloudResponse">
select yuci_type AS type
from tc_network_sentiment
GROUP BY yuci_type
</select>
<select id="getSentimentReport"
resultType="com.ruoyi.screen.domain.response.ZongzhiSentimentReportResponse">
select a.reminder, b.isturn
from (select count(reminder) as reminder from tc_network_sentiment) a,
(select count(*) as isturn from tc_network_sentiment where isturn = '1') b
</select>
<select id="getSentimentReportbyReportType"
resultType="com.ruoyi.screen.domain.response.ZongzhiReportResponse">
select count(sentiment_report_type) as count, sentiment_report_type as sentimentReportType
from tc_network_sentiment where sentiment_report_type is not null
GROUP BY sentiment_report_type
</select>
<select id="getSentimentDept" resultType="com.ruoyi.screen.domain.response.ZongzhiSentimentDeptResponse">
select dep_name, count(*) as count
from tc_network_sentiment
where isturn ='1'
GROUP BY dep_name
</select>
</mapper>