数字督察一体化平台
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.
 
 

59 lines
2.1 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.biutag.supervision.mapper.NegativeMapper">
<select id="getSupervisionTrend" resultType="com.biutag.supervision.pojo.vo.EchartsVo">
WITH months AS (
SELECT '01' AS month, '1月' AS monthName UNION ALL
SELECT '02', '2月' UNION ALL
SELECT '03', '3月' UNION ALL
SELECT '04', '4月' UNION ALL
SELECT '05', '5月' UNION ALL
SELECT '06', '6月' UNION ALL
SELECT '07', '7月' UNION ALL
SELECT '08', '8月' UNION ALL
SELECT '09', '9月' UNION ALL
SELECT '10', '10月' UNION ALL
SELECT '11', '11月' UNION ALL
SELECT '12', '12月' )
SELECT m.monthName AS `name`, IFNULL(COUNT(ng.discoveryTime), 0) AS `value`
FROM months m LEFT JOIN negative ng
ON DATE_FORMAT(ng.discoveryTime, '%m') = m.month
AND YEAR(ng.discoveryTime) = #{time}
AND ng.checkStatus != 3
AND ng.problemSourcesCode IN (13, 15)
GROUP BY m.monthName
ORDER BY m.month ASC;
</select>
<select id="getGobalRecentlyTrendByMonth" resultType="com.biutag.supervision.pojo.vo.EchartsVo">
WITH months AS (
SELECT '01' AS month, '1月' AS monthName UNION ALL
SELECT '02', '2月' UNION ALL
SELECT '03', '3月' UNION ALL
SELECT '04', '4月' UNION ALL
SELECT '05', '5月' UNION ALL
SELECT '06', '6月' UNION ALL
SELECT '07', '7月' UNION ALL
SELECT '08', '8月' UNION ALL
SELECT '09', '9月' UNION ALL
SELECT '10', '10月' UNION ALL
SELECT '11', '11月' UNION ALL
SELECT '12', '12月'
)
SELECT
m.monthName AS `name`,
IFNULL(COUNT(ng.discoveryTime), 0) AS `value`
FROM months m
LEFT JOIN
negative ng on DATE_FORMAT(ng.discoveryTime, '%m')=m.month
AND YEAR(ng.discoveryTime)=#{year}
AND checkStatus!=3
GROUP BY
m.monthName
ORDER BY
m.month ASC;
</select>
</mapper>