zhwl/zhwl-device/zhwl-device-handheld/target/classes/mapper/device/ZdyDeviceHandheldOperaLogMapper.xml
2025-07-01 17:54:58 +08:00

135 lines
5.0 KiB
XML

<?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.zhwl.device.handheld.mapper.ZdyDeviceHandheldOperaLogMapper">
<resultMap type="ZdyDeviceHandheldOperaLog" id="ZdyDeviceHandheldOperaLogResult">
<result property="id" column="id"/>
<result property="deviceId" column="device_id"/>
<result property="operaType" column="opera_type"/>
<result property="createTime" column="create_time"/>
<result property="cmdJobKey" column="cmd_job_key"/>
<result property="createBy" column="create_by"/>
<result property="operaParam" column="opera_param"/>
<result property="jobEndTime" column="job_end_time"/>
</resultMap>
<sql id="selectZdyDeviceHandheldOperaLogVo">
select id,
device_id,
opera_type,
create_time,
cmd_job_key,
create_by,
opera_param,
job_end_time
from zdy_device_handheld_opera_log
</sql>
<select id="selectZdyDeviceHandheldOperaLogList" parameterType="ZdyDeviceHandheldOperaLog"
resultMap="ZdyDeviceHandheldOperaLogResult">
<include refid="selectZdyDeviceHandheldOperaLogVo"/>
<where>
<if test="deviceId != null ">
and device_id = #{deviceId}
</if>
<if test="operaType != null and operaType != ''">
and opera_type = #{operaType}
</if>
<if test="cmdJobKey != null and cmdJobKey != ''">
and cmd_job_key = #{cmdJobKey}
</if>
<if test="operaParam != null and operaParam != ''">
and opera_param = #{operaParam}
</if>
<if test="jobEndTime != null ">
and job_end_time = #{jobEndTime}
</if>
</where>
</select>
<select id="selectZdyDeviceHandheldOperaLogById" parameterType="Long"
resultMap="ZdyDeviceHandheldOperaLogResult">
<include refid="selectZdyDeviceHandheldOperaLogVo"/>
where id = #{id}
</select>
<insert id="insertZdyDeviceHandheldOperaLog" parameterType="ZdyDeviceHandheldOperaLog" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_device_handheld_opera_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deviceId != null">device_id,
</if>
<if test="operaType != null and operaType != ''">opera_type,
</if>
<if test="createTime != null">create_time,
</if>
<if test="cmdJobKey != null">cmd_job_key,
</if>
<if test="createBy != null">create_by,
</if>
<if test="operaParam != null">opera_param,
</if>
<if test="jobEndTime != null">job_end_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceId != null">#{deviceId},
</if>
<if test="operaType != null and operaType != ''">#{operaType},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="cmdJobKey != null">#{cmdJobKey},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="operaParam != null">#{operaParam},
</if>
<if test="jobEndTime != null">#{jobEndTime},
</if>
</trim>
</insert>
<update id="updateZdyDeviceHandheldOperaLog" parameterType="ZdyDeviceHandheldOperaLog">
update zdy_device_handheld_opera_log
<trim prefix="SET" suffixOverrides=",">
<if test="deviceId != null">device_id =
#{deviceId},
</if>
<if test="operaType != null and operaType != ''">opera_type =
#{operaType},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="cmdJobKey != null">cmd_job_key =
#{cmdJobKey},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="operaParam != null">opera_param =
#{operaParam},
</if>
<if test="jobEndTime != null">job_end_time =
#{jobEndTime},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyDeviceHandheldOperaLogById" parameterType="Long">
delete
from zdy_device_handheld_opera_log
where id = #{id}
</delete>
<delete id="deleteZdyDeviceHandheldOperaLogByIds" parameterType="String">
delete from zdy_device_handheld_opera_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>