a-tuoheng-task/src/main/resources/mapper/task/TaskInfoMapper.xml

145 lines
7.6 KiB
XML
Raw Normal View History

2026-03-05 16:14:52 +08:00
<?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.ruoyi.task.mapper.TaskInfoMapper">
<resultMap type="com.ruoyi.task.mapper.entity.TaskInfoEntity" id="TaskInfoResult">
<result property="id" column="id" />
<result property="taskName" column="task_name" />
<result property="taskCategory" column="task_category" />
<result property="taskType" column="task_type" />
<result property="planId" column="plan_id" />
<result property="routeId" column="route_id" />
<result property="uavId" column="uav_id" />
<result property="executeType" column="execute_type" />
<result property="status" column="status" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
2026-03-06 13:46:59 +08:00
<result property="actualStartTime" column="actual_start_time" />
<result property="actualEndTime" column="actual_end_time" />
2026-03-05 16:14:52 +08:00
<result property="description" column="description" />
<result property="createBy" column="create_by" />
<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="selectTaskInfoVo">
select id, task_name, task_category, task_type, plan_id, route_id,
2026-03-06 13:46:59 +08:00
uav_id, execute_type, status, start_time, end_time, actual_start_time, actual_end_time, description,
2026-03-05 16:14:52 +08:00
create_by, create_time, update_by, update_time, remark
from task_info
</sql>
<select id="selectTaskInfoById" parameterType="Long" resultMap="TaskInfoResult">
<include refid="selectTaskInfoVo"/>
where id = #{id}
</select>
<select id="selectTaskInfoList" parameterType="com.ruoyi.task.mapper.entity.TaskInfoEntity" resultMap="TaskInfoResult">
<include refid="selectTaskInfoVo"/>
<where>
<if test="taskName != null and taskName != ''">
and task_name like concat('%', #{taskName}, '%')
</if>
<if test="taskCategory != null and taskCategory != ''">
and task_category = #{taskCategory}
</if>
<if test="taskType != null and taskType != ''">
and task_type = #{taskType}
</if>
<if test="planId != null">
and plan_id = #{planId}
</if>
<if test="routeId != null">
and route_id = #{routeId}
</if>
<if test="uavId != null">
and uav_id = #{uavId}
</if>
<if test="executeType != null and executeType != ''">
and execute_type = #{executeType}
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
</where>
</select>
<insert id="insertTaskInfo" parameterType="com.ruoyi.task.mapper.entity.TaskInfoEntity" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
insert into task_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="taskName != null and taskName != ''">task_name,</if>
<if test="taskCategory != null and taskCategory != ''">task_category,</if>
<if test="taskType != null and taskType != ''">task_type,</if>
<if test="planId != null">plan_id,</if>
<if test="routeId != null">route_id,</if>
<if test="uavId != null">uav_id,</if>
<if test="executeType != null and executeType != ''">execute_type,</if>
<if test="status != null and status != ''">status,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
2026-03-06 13:46:59 +08:00
<if test="actualStartTime != null">actual_start_time,</if>
<if test="actualEndTime != null">actual_end_time,</if>
2026-03-05 16:14:52 +08:00
<if test="description != null and description != ''">description,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="remark != null and remark != ''">remark,</if>
create_time
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskName != null and taskName != ''">#{taskName},</if>
<if test="taskCategory != null and taskCategory != ''">#{taskCategory},</if>
<if test="taskType != null and taskType != ''">#{taskType},</if>
<if test="planId != null">#{planId},</if>
<if test="routeId != null">#{routeId},</if>
<if test="uavId != null">#{uavId},</if>
<if test="executeType != null and executeType != ''">#{executeType},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
2026-03-06 13:46:59 +08:00
<if test="actualStartTime != null">#{actualStartTime},</if>
<if test="actualEndTime != null">#{actualEndTime},</if>
2026-03-05 16:14:52 +08:00
<if test="description != null and description != ''">#{description},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if>
now()
</trim>
</insert>
<update id="updateTaskInfo" parameterType="com.ruoyi.task.mapper.entity.TaskInfoEntity">
update task_info
<trim prefix="SET" suffixOverrides=",">
<if test="taskName != null and taskName != ''">task_name = #{taskName},</if>
<if test="taskCategory != null and taskCategory != ''">task_category = #{taskCategory},</if>
<if test="taskType != null and taskType != ''">task_type = #{taskType},</if>
<if test="planId != null">plan_id = #{planId},</if>
<if test="routeId != null">route_id = #{routeId},</if>
<if test="uavId != null">uav_id = #{uavId},</if>
<if test="executeType != null and executeType != ''">execute_type = #{executeType},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
2026-03-06 13:46:59 +08:00
<if test="actualStartTime != null">actual_start_time = #{actualStartTime},</if>
<if test="actualEndTime != null">actual_end_time = #{actualEndTime},</if>
2026-03-05 16:14:52 +08:00
<if test="description != null and description != ''">description = #{description},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
update_time = now()
</trim>
where id = #{id}
</update>
<delete id="deleteTaskInfoById" parameterType="Long">
delete from task_info where id = #{id}
</delete>
<delete id="deleteTaskInfoByIds" parameterType="Long">
delete from task_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>