6 changed files with 453 additions and 25 deletions
@ -0,0 +1,76 @@ |
|||
package com.zc.business.mapper; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
import com.ruoyi.system.domain.SysUserPost; |
|||
import com.zc.business.domain.DcSdhsEvent; |
|||
|
|||
/** |
|||
* 高速云事件Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-09-09 |
|||
*/ |
|||
public interface DcSdhsEventMapper |
|||
{ |
|||
/** |
|||
* 查询高速云事件 |
|||
* |
|||
* @param id 高速云事件主键 |
|||
* @return 高速云事件 |
|||
*/ |
|||
public DcSdhsEvent selectDcSdhsEventById(Long id); |
|||
|
|||
/** |
|||
* 查询高速云事件列表 |
|||
* |
|||
* @param dcSdhsEvent 高速云事件 |
|||
* @return 高速云事件集合 |
|||
*/ |
|||
List<DcSdhsEvent> selectDcSdhsEventList(DcSdhsEvent dcSdhsEvent); |
|||
|
|||
/** |
|||
* 新增高速云事件 |
|||
* |
|||
* @param dcSdhsEvent 高速云事件 |
|||
* @return 结果 |
|||
*/ |
|||
int insertDcSdhsEvent(DcSdhsEvent dcSdhsEvent); |
|||
|
|||
/** |
|||
* 修改高速云事件 |
|||
* |
|||
* @param dcSdhsEvent 高速云事件 |
|||
* @return 结果 |
|||
*/ |
|||
int updateDcSdhsEvent(DcSdhsEvent dcSdhsEvent); |
|||
|
|||
/** |
|||
* 删除高速云事件 |
|||
* |
|||
* @param id 高速云事件主键 |
|||
* @return 结果 |
|||
*/ |
|||
int deleteDcSdhsEventById(Long id); |
|||
|
|||
/** |
|||
* 批量删除高速云事件 |
|||
* |
|||
* @param ids 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
int deleteDcSdhsEventByIds(Long[] ids); |
|||
|
|||
List<Date> selectTimeList(); |
|||
|
|||
/** |
|||
* 批量插入 |
|||
* |
|||
* @param |
|||
* @return 结果 |
|||
*/ |
|||
public boolean batchInsert(List<DcSdhsEvent> dcSdhsEventList); |
|||
|
|||
boolean deleteByTimeRange(String startTime, String endTime); |
|||
} |
@ -0,0 +1,140 @@ |
|||
<?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.zc.business.mapper.DcSdhsEventMapper"> |
|||
|
|||
<resultMap type="DcSdhsEvent" id="DcSdhsEventResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="road" column="road" /> |
|||
<result property="dept" column="dept" /> |
|||
<result property="eventType" column="event_type" /> |
|||
<result property="startTime" column="start_time" /> |
|||
<result property="endTime" column="end_time" /> |
|||
<result property="status" column="status" /> |
|||
<result property="source" column="source" /> |
|||
<result property="title" column="title" /> |
|||
<result property="eventSubclass" column="event_subclass" /> |
|||
<result property="carType" column="car_type" /> |
|||
<result property="carNum" column="car_num" /> |
|||
<result property="multiVehicle" column="multi_vehicle" /> |
|||
<result property="direction" column="direction" /> |
|||
<result property="stakeMark" column="stake_mark" /> |
|||
<result property="weather" column="weather" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectDcSdhsEventVo"> |
|||
select id, road, dept, event_type, start_time, end_time, status, source, title, event_subclass, car_type, car_num, multi_vehicle, direction, stake_mark, weather from dc_sdhs_event |
|||
</sql> |
|||
|
|||
<select id="selectDcSdhsEventList" parameterType="DcSdhsEvent" resultMap="DcSdhsEventResult"> |
|||
<include refid="selectDcSdhsEventVo"/> |
|||
<where> |
|||
<if test="road != null and road != ''"> and road = #{road}</if> |
|||
<if test="dept != null and dept != ''"> and dept = #{dept}</if> |
|||
<if test="eventType != null and eventType != ''"> and event_type = #{eventType}</if> |
|||
<if test="startTime != null "> and start_time = #{startTime}</if> |
|||
<if test="endTime != null "> and end_time = #{endTime}</if> |
|||
<if test="status != null and status != ''"> and status = #{status}</if> |
|||
<if test="source != null and source != ''"> and source = #{source}</if> |
|||
<if test="title != null and title != ''"> and title = #{title}</if> |
|||
<if test="eventSubclass != null and eventSubclass != ''"> and event_subclass = #{eventSubclass}</if> |
|||
<if test="carType != null and carType != ''"> and car_type = #{carType}</if> |
|||
<if test="carNum != null "> and car_num = #{carNum}</if> |
|||
<if test="multiVehicle != null and multiVehicle != ''"> and multi_vehicle = #{multiVehicle}</if> |
|||
<if test="direction != null and direction != ''"> and direction = #{direction}</if> |
|||
<if test="stakeMark != null and stakeMark != ''"> and stake_mark = #{stakeMark}</if> |
|||
<if test="weather != null and weather != ''"> and weather = #{weather}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectDcSdhsEventById" parameterType="Long" resultMap="DcSdhsEventResult"> |
|||
<include refid="selectDcSdhsEventVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
<select id="selectTimeList" resultType="java.util.Date"> |
|||
select DISTINCT(start_time) from dc_sdhs_event |
|||
</select> |
|||
|
|||
<insert id="insertDcSdhsEvent" parameterType="DcSdhsEvent" useGeneratedKeys="true" keyProperty="id"> |
|||
insert into dc_sdhs_event |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="road != null">road,</if> |
|||
<if test="dept != null">dept,</if> |
|||
<if test="eventType != null">event_type,</if> |
|||
<if test="startTime != null">start_time,</if> |
|||
<if test="endTime != null">end_time,</if> |
|||
<if test="status != null">status,</if> |
|||
<if test="source != null">source,</if> |
|||
<if test="title != null">title,</if> |
|||
<if test="eventSubclass != null">event_subclass,</if> |
|||
<if test="carType != null">car_type,</if> |
|||
<if test="carNum != null">car_num,</if> |
|||
<if test="multiVehicle != null">multi_vehicle,</if> |
|||
<if test="direction != null">direction,</if> |
|||
<if test="stakeMark != null">stake_mark,</if> |
|||
<if test="weather != null">weather,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="road != null">#{road},</if> |
|||
<if test="dept != null">#{dept},</if> |
|||
<if test="eventType != null">#{eventType},</if> |
|||
<if test="startTime != null">#{startTime},</if> |
|||
<if test="endTime != null">#{endTime},</if> |
|||
<if test="status != null">#{status},</if> |
|||
<if test="source != null">#{source},</if> |
|||
<if test="title != null">#{title},</if> |
|||
<if test="eventSubclass != null">#{eventSubclass},</if> |
|||
<if test="carType != null">#{carType},</if> |
|||
<if test="carNum != null">#{carNum},</if> |
|||
<if test="multiVehicle != null">#{multiVehicle},</if> |
|||
<if test="direction != null">#{direction},</if> |
|||
<if test="stakeMark != null">#{stakeMark},</if> |
|||
<if test="weather != null">#{weather},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<insert id="batchInsert"> |
|||
insert into dc_sdhs_event(road,dept,event_type,start_time,end_time,status,source,title,event_subclass,car_type,car_num,multi_vehicle,direction,stake_mark,weather) values |
|||
<foreach item="item" index="index" collection="list" separator=","> |
|||
(#{item.road},#{item.dept},#{item.eventType},#{item.startTime},#{item.endTime},#{item.status},#{item.source},#{item.title},#{item.eventSubclass},#{item.carType},#{item.carNum},#{item.multiVehicle},#{item.direction},#{item.stakeMark},#{item.weather}) |
|||
</foreach> |
|||
</insert> |
|||
|
|||
<update id="updateDcSdhsEvent" parameterType="DcSdhsEvent"> |
|||
update dc_sdhs_event |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="road != null">road = #{road},</if> |
|||
<if test="dept != null">dept = #{dept},</if> |
|||
<if test="eventType != null">event_type = #{eventType},</if> |
|||
<if test="startTime != null">start_time = #{startTime},</if> |
|||
<if test="endTime != null">end_time = #{endTime},</if> |
|||
<if test="status != null">status = #{status},</if> |
|||
<if test="source != null">source = #{source},</if> |
|||
<if test="title != null">title = #{title},</if> |
|||
<if test="eventSubclass != null">event_subclass = #{eventSubclass},</if> |
|||
<if test="carType != null">car_type = #{carType},</if> |
|||
<if test="carNum != null">car_num = #{carNum},</if> |
|||
<if test="multiVehicle != null">multi_vehicle = #{multiVehicle},</if> |
|||
<if test="direction != null">direction = #{direction},</if> |
|||
<if test="stakeMark != null">stake_mark = #{stakeMark},</if> |
|||
<if test="weather != null">weather = #{weather},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteDcSdhsEventById" parameterType="Long"> |
|||
delete from dc_sdhs_event where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteDcSdhsEventByIds" parameterType="String"> |
|||
delete from dc_sdhs_event where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
<delete id="deleteByTimeRange"> |
|||
delete from dc_sdhs_event |
|||
where start_time >= #{startTime} and start_time <= #{endTime} |
|||
</delete> |
|||
</mapper> |
Loading…
Reference in new issue