13 changed files with 112 additions and 47 deletions
@ -1,8 +1,13 @@ |
|||
package com.ccsens.health.persist.dao; |
|||
|
|||
import com.ccsens.health.bean.vo.JourneyVo; |
|||
import com.ccsens.health.persist.mapper.JourneyAbnormalMapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Repository |
|||
public interface JourneyAbnormalDao extends JourneyAbnormalMapper { |
|||
List<JourneyVo.AddAbnormalJourney> selectAbnormalJourney(@Param("carNo") String carNo, @Param("tripMode") int tripMode, @Param("startTime") Long startTime, @Param("endTime") Long endTime); |
|||
} |
|||
|
@ -1,4 +1,4 @@ |
|||
spring: |
|||
profiles: |
|||
active: test |
|||
include: common, util-test |
|||
active: dev |
|||
include: common, util-dev |
@ -0,0 +1,40 @@ |
|||
<?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.ccsens.health.persist.dao.JourneyAbnormalDao"> |
|||
|
|||
<resultMap id="resultMap_journey_abnormal" type="com.ccsens.health.bean.vo.JourneyVo$AddAbnormalJourney"> |
|||
<id column="id" property="id"/> |
|||
<result column="tripMode" property="tripMode"/> |
|||
<result column="carNo" property="carNo"/> |
|||
<result column="startTime" property="startTime"/> |
|||
<result column="endTime" property="endTime"/> |
|||
<result column="description" property="description"/> |
|||
</resultMap> |
|||
|
|||
<select id="selectAbnormalJourney" resultMap="resultMap_journey_abnormal" parameterType="java.util.Map"> |
|||
select |
|||
id as id, |
|||
trip_mode as tripMode, |
|||
car_no as carNo, |
|||
start_time as startTime, |
|||
end_time as endTime, |
|||
description as description |
|||
from |
|||
t_journey_abnormal |
|||
where |
|||
rec_status = 0 |
|||
<if test="carNo == null"> |
|||
and |
|||
car_no = #{carNo} |
|||
</if> |
|||
<if test="tripMode == null"> |
|||
and |
|||
trip_mode = #{tripMode} |
|||
</if> |
|||
and |
|||
start_time <= #{endTime} |
|||
and |
|||
end_time >= #{startTime} |
|||
ORDER By h.time DESC |
|||
</select> |
|||
</mapper> |
Loading…
Reference in new issue