TBCarScheduleSectionCaseMapper.xml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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.TBCarScheduleSectionCaseMapper">
  4. <resultMap id="RoadDtoMap" type="com.daju.mix.dto.RoadSectionDto">
  5. <result property="id" column="id"/>
  6. <result property="name" column="name"/>
  7. <result property="state" column="state"/>
  8. </resultMap>
  9. <!-- <select id="selectAll" resultMap="RoadDtoMap" >-->
  10. <!-- select b.code id,name, max(a.alarm_status) state, a.create_date-->
  11. <!-- from t_b_archives_road_section b-->
  12. <!-- left join t_b_car_schedule_arrange_section a on b.id = a.section_id-->
  13. <!-- where a.date = #{date}-->
  14. <!-- group by b.id;-->
  15. <!-- </select>-->
  16. <!-- <select id="selectById" resultMap="RoadDtoMap" >-->
  17. <!-- select b.code id,b.name, a.alarm_status state,max(a.create_date) createDate-->
  18. <!-- from t_b_archives_road_section b-->
  19. <!-- left join t_b_car_schedule_arrange_section a on b.id = a.section_id-->
  20. <!-- where b.code = #{code}-->
  21. <!-- group by b.id;-->
  22. <!-- </select>-->
  23. <select id="selectAll" resultMap="RoadDtoMap" >
  24. select b.code id,name, a.alarm_status state, max(a.create_date) createDate
  25. from t_b_archives_road_section b
  26. left join t_b_car_schedule_arrange_section a on b.id = a.section_id
  27. group by b.id;
  28. </select>
  29. <select id="selectById" resultMap="RoadDtoMap" >
  30. select b.code id,name, a.alarm_status state,max(a.create_date) createDate
  31. from t_b_car_schedule_arrange_section a
  32. left join t_b_archives_road_section b on a.section_id = b.id
  33. where b.code = #{code}
  34. group by b.id;
  35. </select>
  36. </mapper>