|
@@ -15,22 +15,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
<result property="remark" column="remark" />
|
|
|
</resultMap>
|
|
|
-
|
|
|
+ <resultMap type="PdmVehicleAlarmHist" id="PdmVehicleAlarmHistResult2">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="vehicleNo" column="vehicle_no" />
|
|
|
+ <result property="vehicleGroup" column="vehicle_group" />
|
|
|
+ <result property="occurDate" column="occur_date" />
|
|
|
+ <result property="alarmCd" column="alarm_cd" />
|
|
|
+ <result property="alarmDesc" column="alarm_desc" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ </resultMap>
|
|
|
<sql id="selectPdmVehicleAlarmHistVo">
|
|
|
- select id, vehicle_no, occur_date, alarm_cd, alarm_desc, create_time, update_by, update_time, remark from pdm_vehicle_alarm_hist
|
|
|
+ select id, vehicle_no, occur_date,event_start_date, alarm_cd, alarm_desc, create_time, update_by, update_time, remark from pdm_vehicle_alarm_hist
|
|
|
</sql>
|
|
|
|
|
|
- <select id="selectPdmVehicleAlarmHistList" parameterType="PdmVehicleAlarmHist" resultMap="PdmVehicleAlarmHistResult">
|
|
|
- <include refid="selectPdmVehicleAlarmHistVo"/>
|
|
|
- <where>
|
|
|
- <if test="vehicleNo != null and vehicleNo != ''"> and vehicle_no = #{vehicleNo}</if>
|
|
|
- <if test="occurDate != null and occurDate != ''"> and occur_date = #{occurDate}</if>
|
|
|
- <if test="startDate != null and startDate != ''"> and occur_date >= #{startDate}</if>
|
|
|
- <if test="endDate != null and endDate != ''"> and occur_date <= #{endDate}</if>
|
|
|
- <if test="alarmCd != null and alarmCd != ''"> and alarm_cd = #{alarmCd}</if>
|
|
|
- <if test="alarmDesc != null and alarmDesc != ''"> and alarm_desc = #{alarmDesc}</if>
|
|
|
+ <select id="selectPdmVehicleAlarmHistList" parameterType="PdmVehicleAlarmHist" resultMap="PdmVehicleAlarmHistResult2">
|
|
|
+ select h.id, h.vehicle_no, a.vehicle_group, h.occur_date,h.event_start_date, h.alarm_cd, h.alarm_desc, h.create_time, h.update_by,h. update_time, h.remark from pdm_vehicle_alarm_hist h
|
|
|
+ left join pdm_vehicle_alarm a on a.vehicle_no=h.vehicle_no
|
|
|
+ <where>
|
|
|
+
|
|
|
+ <if test="vehicleNo != null and vehicleNo != ''"> and h.vehicle_no = #{vehicleNo}</if>
|
|
|
+ <if test="occurDate != null and occurDate != ''"> and h.occur_date = #{occurDate}</if>
|
|
|
+ <if test="vehicleGroup != null and vehicleGroup != ''"> and a.vehicle_group like concat('%', #{vehicleGroup}, '%')</if>
|
|
|
+ <if test="startDate != null and startDate != ''"> and h.occur_date >= #{startDate}</if>
|
|
|
+ <if test="endDate != null and endDate != ''"> and h.occur_date <= #{endDate}</if>
|
|
|
+ <if test="alarmCd != null and alarmCd != ''"> and h.alarm_cd = #{alarmCd}</if>
|
|
|
+ <if test="alarmDesc != null and alarmDesc != ''"> and h.alarm_desc = #{alarmDesc}</if>
|
|
|
</where>
|
|
|
- order by occur_date desc
|
|
|
+ order by h.occur_date desc
|
|
|
</select>
|
|
|
|
|
|
<select id="selectPdmVehicleAlarmHistById" parameterType="Long" resultMap="PdmVehicleAlarmHistResult">
|