TBArchivesClearingPointMapper.xml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.daju.mix.dao.mapper.TBArchivesClearingPointMapper">
  4. <resultMap type="com.daju.mix.dao.entity.TBArchivesClearingPoint" id="TBArchivesClearingPointMap"/>
  5. <resultMap type="com.daju.mix.dto.IndexWarningsDto" id="IndexWarningsDtoMap"/>
  6. <!-- 随机一条数据-->
  7. <select id="selectRecent" resultMap="TBArchivesClearingPointMap">
  8. select *
  9. from t_b_archives_clearing_point
  10. order by rand()
  11. limit 1
  12. </select>
  13. <select id="selectId" resultType="String">
  14. SELECT id
  15. from t_b_archives_clearing_point
  16. where id = (select max(id) from t_b_archives_clearing_point)
  17. </select>
  18. <resultMap type="com.daju.mix.dto.AllElements" id="AllElements"/>
  19. <select id="allElementsByClearingPoint" resultMap="AllElements">
  20. select tbacp.code id,
  21. cim_longitude longitude,
  22. cim_latitude latitude,
  23. height altitude,
  24. tbca.status warningState,
  25. tbca.content warningMessage,
  26. 2 type,
  27. expected_completion time,
  28. max(tbca.create_date)
  29. from t_b_archives_clearing_point tbacp
  30. left join t_b_car_alarm tbca on tbacp.code = tbca.archive_id
  31. group by tbacp.id;
  32. </select>
  33. </mapper>