| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?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.TBCarScheduleSectionCaseMapper">
- <resultMap id="RoadDtoMap" type="com.daju.mix.dto.RoadSectionDto">
- <result property="id" column="id"/>
- <result property="name" column="name"/>
- <result property="state" column="state"/>
- </resultMap>
- <!-- <select id="selectAll" resultMap="RoadDtoMap" >-->
- <!-- select b.code id,name, max(a.alarm_status) state, a.create_date-->
- <!-- from t_b_archives_road_section b-->
- <!-- left join t_b_car_schedule_arrange_section a on b.id = a.section_id-->
- <!-- where a.date = #{date}-->
- <!-- group by b.id;-->
- <!-- </select>-->
- <!-- <select id="selectById" resultMap="RoadDtoMap" >-->
- <!-- select b.code id,b.name, a.alarm_status state,max(a.create_date) createDate-->
- <!-- from t_b_archives_road_section b-->
- <!-- left join t_b_car_schedule_arrange_section a on b.id = a.section_id-->
- <!-- where b.code = #{code}-->
- <!-- group by b.id;-->
- <!-- </select>-->
- <select id="selectAll" resultMap="RoadDtoMap" >
- select b.code id,name, a.alarm_status state, max(a.create_date) createDate
- from t_b_archives_road_section b
- left join t_b_car_schedule_arrange_section a on b.id = a.section_id
- group by b.id;
- </select>
- <select id="selectById" resultMap="RoadDtoMap" >
- select b.code id,name, a.alarm_status state,max(a.create_date) createDate
- from t_b_car_schedule_arrange_section a
- left join t_b_archives_road_section b on a.section_id = b.id
- where b.code = #{code}
- group by b.id;
- </select>
- </mapper>
|