| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?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.TBArchivesToiletsMapper">
- <resultMap type="com.daju.mix.dao.entity.TBArchivesToilets" id="BaseTBArchivesToiletsMap"/>
- <resultMap type="com.daju.mix.dto.IndexWarningsDto" id="IndexWarningsDtoMap"/>
- <select id="selectArchivesToiletsId" resultType="java.lang.String">
- SELECT id
- from t_b_archives_toilets
- where id = (select max(id) from t_b_archives_toilets)
- </select>
- <!-- 随机一条数据-->
- <select id="selectRecent" resultMap="BaseTBArchivesToiletsMap">
- select *
- from t_b_archives_toilets
- order by rand()
- limit 1
- </select>
- <resultMap type="com.daju.mix.dto.AllElements" id="AllElements"/>
- <select id="allElementsByToilets" resultMap="AllElements">
- select tbar.code id,
- cim_longitude longitude,
- cim_latitude latitude,
- height altitude,
- tbca.status warningState,
- tbca.content warningMessage,
- 9 type,
- expected_completion time,
- max(tbca.create_date)
- from t_b_archives_toilets tbar
- left join t_b_car_alarm tbca on tbar.code = tbca.archive_id
- group by tbar.id
- </select>
- <!-- 获取预警信息列表-->
- <select id="selectWarnings" resultMap="IndexWarningsDtoMap">
- select tbat.id, tbca.create_date time, tbca.content content, tbca.status state
- from t_b_archives_toilets tbat
- left join t_b_car_alarm tbca on tbat.id = tbca.archive_id
- where tbat.id = #{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_toilets 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>
- </mapper>
|