| New file |
| | |
| | | <?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.system.mapper.SysTaskLogMapper"> |
| | | |
| | | <resultMap type="SysTaskLog" id="SysTaskLogResult"> |
| | | <result property="logId" column="log_id" /> |
| | | <result property="taskId" column="task_id" /> |
| | | <result property="operationType" column="operation_type" /> |
| | | <result property="operationDesc" column="operation_desc" /> |
| | | <result property="oldValue" column="old_value" /> |
| | | <result property="newValue" column="new_value" /> |
| | | <result property="operatorId" column="operator_id" /> |
| | | <result property="operatorName" column="operator_name" /> |
| | | <result property="operationTime" column="operation_time" /> |
| | | <result property="ipAddress" column="ip_address" /> |
| | | <result property="latitude" column="latitude" /> |
| | | <result property="longitude" column="longitude" /> |
| | | <result property="locationAddress" column="location_address" /> |
| | | <result property="locationProvince" column="location_province" /> |
| | | <result property="locationCity" column="location_city" /> |
| | | <result property="locationDistrict" column="location_district" /> |
| | | <result property="gpsAccuracy" column="gps_accuracy" /> |
| | | <result property="altitude" column="altitude" /> |
| | | <result property="speed" column="speed" /> |
| | | <result property="heading" column="heading" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectSysTaskLogVo"> |
| | | select log_id, task_id, operation_type, operation_desc, old_value, new_value, |
| | | operator_id, operator_name, operation_time, ip_address, |
| | | latitude, longitude, location_address, location_province, |
| | | location_city, location_district, gps_accuracy, altitude, speed, heading |
| | | from sys_task_log |
| | | </sql> |
| | | |
| | | <select id="selectSysTaskLogList" parameterType="SysTaskLog" resultMap="SysTaskLogResult"> |
| | | <include refid="selectSysTaskLogVo"/> |
| | | <where> |
| | | <if test="taskId != null "> and task_id = #{taskId}</if> |
| | | <if test="operationType != null and operationType != ''"> and operation_type = #{operationType}</if> |
| | | <if test="operatorId != null "> and operator_id = #{operatorId}</if> |
| | | <if test="operatorName != null and operatorName != ''"> and operator_name like concat('%', #{operatorName}, '%')</if> |
| | | </where> |
| | | order by operation_time desc |
| | | </select> |
| | | |
| | | <select id="selectSysTaskLogByLogId" parameterType="Long" resultMap="SysTaskLogResult"> |
| | | <include refid="selectSysTaskLogVo"/> |
| | | where log_id = #{logId} |
| | | </select> |
| | | |
| | | <select id="selectSysTaskLogByTaskId" parameterType="Long" resultMap="SysTaskLogResult"> |
| | | <include refid="selectSysTaskLogVo"/> |
| | | where task_id = #{taskId} |
| | | order by operation_time desc |
| | | </select> |
| | | |
| | | <insert id="insertSysTaskLog" parameterType="SysTaskLog" useGeneratedKeys="true" keyProperty="logId"> |
| | | insert into sys_task_log |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="taskId != null">task_id,</if> |
| | | <if test="operationType != null and operationType != ''">operation_type,</if> |
| | | <if test="operationDesc != null">operation_desc,</if> |
| | | <if test="oldValue != null">old_value,</if> |
| | | <if test="newValue != null">new_value,</if> |
| | | <if test="operatorId != null">operator_id,</if> |
| | | <if test="operatorName != null and operatorName != ''">operator_name,</if> |
| | | <if test="operationTime != null">operation_time,</if> |
| | | <if test="ipAddress != null">ip_address,</if> |
| | | <if test="latitude != null">latitude,</if> |
| | | <if test="longitude != null">longitude,</if> |
| | | <if test="locationAddress != null">location_address,</if> |
| | | <if test="locationProvince != null">location_province,</if> |
| | | <if test="locationCity != null">location_city,</if> |
| | | <if test="locationDistrict != null">location_district,</if> |
| | | <if test="gpsAccuracy != null">gps_accuracy,</if> |
| | | <if test="altitude != null">altitude,</if> |
| | | <if test="speed != null">speed,</if> |
| | | <if test="heading != null">heading,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="taskId != null">#{taskId},</if> |
| | | <if test="operationType != null and operationType != ''">#{operationType},</if> |
| | | <if test="operationDesc != null">#{operationDesc},</if> |
| | | <if test="oldValue != null">#{oldValue},</if> |
| | | <if test="newValue != null">#{newValue},</if> |
| | | <if test="operatorId != null">#{operatorId},</if> |
| | | <if test="operatorName != null and operatorName != ''">#{operatorName},</if> |
| | | <if test="operationTime != null">#{operationTime},</if> |
| | | <if test="ipAddress != null">#{ipAddress},</if> |
| | | <if test="latitude != null">#{latitude},</if> |
| | | <if test="longitude != null">#{longitude},</if> |
| | | <if test="locationAddress != null">#{locationAddress},</if> |
| | | <if test="locationProvince != null">#{locationProvince},</if> |
| | | <if test="locationCity != null">#{locationCity},</if> |
| | | <if test="locationDistrict != null">#{locationDistrict},</if> |
| | | <if test="gpsAccuracy != null">#{gpsAccuracy},</if> |
| | | <if test="altitude != null">#{altitude},</if> |
| | | <if test="speed != null">#{speed},</if> |
| | | <if test="heading != null">#{heading},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateSysTaskLog" parameterType="SysTaskLog"> |
| | | update sys_task_log |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="taskId != null">task_id = #{taskId},</if> |
| | | <if test="operationType != null and operationType != ''">operation_type = #{operationType},</if> |
| | | <if test="operationDesc != null">operation_desc = #{operationDesc},</if> |
| | | <if test="oldValue != null">old_value = #{oldValue},</if> |
| | | <if test="newValue != null">new_value = #{newValue},</if> |
| | | <if test="operatorId != null">operator_id = #{operatorId},</if> |
| | | <if test="operatorName != null and operatorName != ''">operator_name = #{operatorName},</if> |
| | | <if test="operationTime != null">operation_time = #{operationTime},</if> |
| | | <if test="ipAddress != null">ip_address = #{ipAddress},</if> |
| | | </trim> |
| | | where log_id = #{logId} |
| | | </update> |
| | | |
| | | <delete id="deleteSysTaskLogByLogId" parameterType="Long"> |
| | | delete from sys_task_log where log_id = #{logId} |
| | | </delete> |
| | | |
| | | <delete id="deleteSysTaskLogByLogIds" parameterType="String"> |
| | | delete from sys_task_log where log_id in |
| | | <foreach item="logId" collection="array" open="(" separator="," close=")"> |
| | | #{logId} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <delete id="deleteSysTaskLogByTaskId" parameterType="Long"> |
| | | delete from sys_task_log where task_id = #{taskId} |
| | | </delete> |
| | | </mapper> |