From a77cd2572fae653df15a202bdcd692a8e9c44a04 Mon Sep 17 00:00:00 2001 From: zhanghua <314079846@qq.com> Date: 星期四, 05 九月 2024 21:43:19 +0800 Subject: [PATCH] 11 --- ycl-platform/src/main/resources/mapper/allot/EfficiencyMapper.xml | 44 ++++++++++++++++++++++++++++++++++++++------ 1 files changed, 38 insertions(+), 6 deletions(-) diff --git a/ycl-platform/src/main/resources/mapper/allot/EfficiencyMapper.xml b/ycl-platform/src/main/resources/mapper/allot/EfficiencyMapper.xml index 48840d7..f84b45c 100644 --- a/ycl-platform/src/main/resources/mapper/allot/EfficiencyMapper.xml +++ b/ycl-platform/src/main/resources/mapper/allot/EfficiencyMapper.xml @@ -1,21 +1,53 @@ <?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.ycl.mapper.allot.EfficiencyMapper"> +<resultMap id="AIIotStatisticsVO" type="com.ycl.vo.cockpit.aiIot.AIIotStatisticsVO"> + <result property="type" column="type"/> + <collection property="records" javaType="list" + ofType="com.ycl.vo.cockpit.aiIot.AIIotStatisticsRecordVO"> + <result column="month" property="month"/> + <result column="count" property="count"/> + </collection> +</resultMap> <select id="list" resultType="com.ycl.dto.allot.EfficiencyDto"> SELECT - t4.NAME NAME, - COUNT(1) NUMBER + t3.NAME NAME, + COUNT( 1 ) NUMBER, + sum( CASE WHEN ubc.state = 3 THEN 1 ELSE 0 END ) errorNumber FROM `ums_base_case` AS ubc JOIN ums_violations AS uv ON ubc.id = uv.id - LEFT JOIN ums_data_dictionary AS t3 ON uv.category_id = t3.id - LEFT JOIN ums_data_dictionary AS t4 ON uv.type_id = t4.id + LEFT JOIN ums_data_dictionary AS t3 ON uv.grade_id = t3.id LEFT JOIN ums_sccg_region t5 ON ubc.street_id = t5.id WHERE ubc.category = 1 - AND t4.`name` IS NOT NULL + AND t3.`name` IS NOT NULL GROUP BY - t4.id + t3.id </select> + <select id="aiMonthList" resultMap="AIIotStatisticsVO"> + SELECT + t3.NAME type, + DATE_FORMAT(alarm_time,'%Y-%m') month, + COUNT(1) count + FROM + `ums_base_case` AS ubc + JOIN ums_violations AS uv ON ubc.id = uv.id + LEFT JOIN ums_data_dictionary AS t3 ON uv.grade_id = t3.id + LEFT JOIN ums_sccg_region t5 ON ubc.street_id = t5.id + WHERE + ubc.category = 1 + AND t3.`name` IS NOT NULL + <if test="beginTime!=null"> + and ubc.alarm_time BETWEEN #{beginTime} and #{endTime} + </if> + GROUP BY + t3.id,DATE_FORMAT(alarm_time,'%Y-%m') + ORDER BY DATE_FORMAT(alarm_time,'%Y-%m') desc ,COUNT(1) desc + </select> + <select id="getSmokeCustomer" resultType="java.lang.Long"> + select count(1) total from ums_ods_customer + </select> + </mapper> -- Gitblit v1.8.0