TBArchivesSweepPointMapper.xml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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.TBArchivesSweepPointMapper">
  4. <resultMap type="com.daju.mix.dto.IndexWarningsDto" id="IndexWarningsDtoMap"/>
  5. <!-- 获取预警信息列表-->
  6. <select id="selectWarnings" resultMap="IndexWarningsDtoMap">
  7. select tbasp.id, tboa.creat_date time, tboa.alarm_content content, tboa.task_state state
  8. from t_b_archives_sweep_point tbasp
  9. left join t_b_other_alarm tboa on tbasp.id = tboa.archives_id
  10. where tbasp.id = #{id}
  11. </select>
  12. <resultMap type="com.daju.mix.dto.AllElements" id="AllElements"/>
  13. <select id="allElementsBySweepPoint" resultMap="AllElements">
  14. select tbacp.code id,
  15. cim_longitude longitude,
  16. cim_latitude latitude,
  17. height altitude,
  18. tbca.status warningState,
  19. tbca.content warningMessage,
  20. 4 type,
  21. expected_completion time,
  22. max(tbca.create_date)
  23. from t_b_archives_sweep_point tbacp
  24. left join t_b_car_alarm tbca on tbacp.code = tbca.archive_id
  25. group by tbacp.id;
  26. </select>
  27. <resultMap id="LookOverStatusDto" type="com.daju.mix.dto.LookOverStatusDto"/>
  28. <select id="lookOverStatusDto" resultMap="LookOverStatusDto">
  29. select a.name,
  30. b.status currentStatus,
  31. Max(b.create_date) lastCleanTime,
  32. d.description workSchedule,
  33. count(c.id) totalWarningCount
  34. from t_b_archives_sweep_point a
  35. left join t_b_car_schedule_common_section b on a.code = b.archive_id
  36. left join t_b_car_schedule d on b.schedule_id = d.id
  37. left join t_b_car_alarm c on a.code = c.archive_id
  38. where a.code = #{code}
  39. group by a.id;
  40. </select>
  41. <select id="monthStaticsCount" resultType="int">
  42. select count(id)
  43. from t_b_proposal
  44. where type = #{type}
  45. and date_format(create_date, '%Y-%m') = date_format(now(), '%Y-%m')
  46. and items = #{items}
  47. and archives_id = #{id};
  48. </select>
  49. </mapper>