| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?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.daju.mix.dao.mapper.TBArchivesSweepPointMapper">
- <resultMap type="com.daju.mix.dto.IndexWarningsDto" id="IndexWarningsDtoMap"/>
- <!-- 获取预警信息列表-->
- <select id="selectWarnings" resultMap="IndexWarningsDtoMap">
- select tbasp.id, tboa.creat_date time, tboa.alarm_content content, tboa.task_state state
- from t_b_archives_sweep_point tbasp
- left join t_b_other_alarm tboa on tbasp.id = tboa.archives_id
- where tbasp.id = #{id}
- </select>
- <resultMap type="com.daju.mix.dto.AllElements" id="AllElements"/>
- <select id="allElementsBySweepPoint" resultMap="AllElements">
- select tbacp.code id,
- cim_longitude longitude,
- cim_latitude latitude,
- height altitude,
- tbca.status warningState,
- tbca.content warningMessage,
- 4 type,
- expected_completion time,
- max(tbca.create_date)
- from t_b_archives_sweep_point tbacp
- left join t_b_car_alarm tbca on tbacp.code = tbca.archive_id
- group by tbacp.id;
- </select>
- <resultMap id="LookOverStatusDto" type="com.daju.mix.dto.LookOverStatusDto"/>
- <select id="lookOverStatusDto" resultMap="LookOverStatusDto">
- select a.name,
- b.status currentStatus,
- Max(b.create_date) lastCleanTime,
- d.description workSchedule,
- count(c.id) totalWarningCount
- from t_b_archives_sweep_point a
- left join t_b_car_schedule_common_section b on a.code = b.archive_id
- left join t_b_car_schedule d on b.schedule_id = d.id
- left join t_b_car_alarm c on a.code = c.archive_id
- where a.code = #{code}
- group by a.id;
- </select>
- <select id="monthStaticsCount" resultType="int">
- select count(id)
- from t_b_proposal
- where type = #{type}
- and date_format(create_date, '%Y-%m') = date_format(now(), '%Y-%m')
- and items = #{items}
- and archives_id = #{id};
- </select>
- </mapper>
|