86133 | aaa3f5d | 2025-04-20 21:33:29 +0800 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <!DOCTYPE mapper |
| 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 5 | <mapper namespace="com.ruoyi.tracker.mapper.TrackerTaskLogMapper"> |
| 6 | |
| 7 | <resultMap type="TrackerTaskLog" id="TrackerTaskLogResult"> |
| 8 | <result property="logId" column="log_id" /> |
| 9 | <result property="taskId" column="task_id" /> |
| 10 | <result property="userId" column="user_id" /> |
| 11 | <result property="action" column="action" /> |
| 12 | <result property="description" column="description" /> |
| 13 | <result property="createTime" column="create_time" /> |
| 14 | </resultMap> |
| 15 | |
| 16 | <sql id="selectTrackerTaskLogVo"> |
| 17 | select log_id, task_id, user_id, action, description, create_time from tracker_task_log |
| 18 | </sql> |
| 19 | |
| 20 | <select id="selectTrackerTaskLogList" parameterType="TrackerTaskLog" resultMap="TrackerTaskLogResult"> |
| 21 | <include refid="selectTrackerTaskLogVo"/> |
| 22 | <where> |
| 23 | <if test="taskId != null "> and task_id = #{taskId}</if> |
| 24 | <if test="userId != null "> and user_id = #{userId}</if> |
| 25 | <if test="action != null and action != ''"> and action = #{action}</if> |
| 26 | <if test="description != null and description != ''"> and description = #{description}</if> |
| 27 | </where> |
| 28 | </select> |
| 29 | |
| 30 | <select id="selectTrackerTaskLogByLogId" parameterType="Long" resultMap="TrackerTaskLogResult"> |
| 31 | <include refid="selectTrackerTaskLogVo"/> |
| 32 | where log_id = #{logId} |
| 33 | </select> |
| 34 | |
| 35 | <insert id="insertTrackerTaskLog" parameterType="TrackerTaskLog" useGeneratedKeys="true" keyProperty="logId"> |
| 36 | insert into tracker_task_log |
| 37 | <trim prefix="(" suffix=")" suffixOverrides=","> |
| 38 | <if test="taskId != null">task_id,</if> |
| 39 | <if test="userId != null">user_id,</if> |
| 40 | <if test="action != null and action != ''">action,</if> |
| 41 | <if test="description != null">description,</if> |
| 42 | <if test="createTime != null">create_time,</if> |
| 43 | </trim> |
| 44 | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| 45 | <if test="taskId != null">#{taskId},</if> |
| 46 | <if test="userId != null">#{userId},</if> |
| 47 | <if test="action != null and action != ''">#{action},</if> |
| 48 | <if test="description != null">#{description},</if> |
| 49 | <if test="createTime != null">#{createTime},</if> |
| 50 | </trim> |
| 51 | </insert> |
| 52 | |
| 53 | <update id="updateTrackerTaskLog" parameterType="TrackerTaskLog"> |
| 54 | update tracker_task_log |
| 55 | <trim prefix="SET" suffixOverrides=","> |
| 56 | <if test="taskId != null">task_id = #{taskId},</if> |
| 57 | <if test="userId != null">user_id = #{userId},</if> |
| 58 | <if test="action != null and action != ''">action = #{action},</if> |
| 59 | <if test="description != null">description = #{description},</if> |
| 60 | <if test="createTime != null">create_time = #{createTime},</if> |
| 61 | </trim> |
| 62 | where log_id = #{logId} |
| 63 | </update> |
| 64 | |
| 65 | <delete id="deleteTrackerTaskLogByLogId" parameterType="Long"> |
| 66 | delete from tracker_task_log where log_id = #{logId} |
| 67 | </delete> |
| 68 | |
| 69 | <delete id="deleteTrackerTaskLogByLogIds" parameterType="String"> |
| 70 | delete from tracker_task_log where log_id in |
| 71 | <foreach item="logId" collection="array" open="(" separator="," close=")"> |
| 72 | #{logId} |
| 73 | </foreach> |
| 74 | </delete> |
| 75 | </mapper> |