Files
zhwl/zhwl-device/zhwl-device-passflow/target/classes/mapper/passflow/ZdyDevicePassflowGpsLogMapper.xml

213 lines
7.8 KiB
XML
Raw Normal View History

2025-07-01 17:54:58 +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.zhwl.passflow.mapper.ZdyDevicePassflowGpsLogMapper">
<resultMap type="ZdyDevicePassflowGpsLog" id="ZdyDevicePassflowGpsLogResult">
<result property="logId" column="log_id"/>
<result property="sn" column="sn"/>
<result property="type" column="type"/>
<result property="time" column="time"/>
<result property="dataTime" column="data_time"/>
<result property="createdTime" column="created_time"/>
<result property="longitude" column="longitude"/>
<result property="latitude" column="latitude"/>
<result property="no" column="no"/>
<result property="speed" column="speed"/>
<result property="direction" column="direction"/>
<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"/>
<result property="sendInfo" column="send_info"/>
<result property="reqInfo" column="req_info"/>
<result property="deptId" column="dept_id"/>
</resultMap>
<sql id="selectZdyDevicePassflowGpsLogVo">
select gl.log_id,
gl.sn,
gl.type, gl.time,gl.data_time, gl.created_time, gl.longitude, gl.latitude, gl.no, gl.speed, gl.direction,gl.send_info,gl.req_info, gl.create_by, gl.create_time, gl.update_by, gl.update_time, gl.remark,gl.dept_id
from zdy_device_passflow_gps_log gl
</sql>
<select id="selectZdyDevicePassflowGpsLogList" parameterType="ZdyDevicePassflowGpsLog"
resultMap="ZdyDevicePassflowGpsLogResult">
<include refid="selectZdyDevicePassflowGpsLogVo"/>
left join sys_dept d on gl.dept_id = d.dept_id
<where>
<if test="sn != null and sn != ''">
and gl.sn = #{sn}
</if>
<if test="params.beginDataTime != null and params.beginDataTime != '' and params.endDataTime != null and params.endDataTime != ''">
and gl.data_time between #{params.beginDataTime} and #{params.endDataTime}
</if>
${params.dataScope}
</where>
order by gl.create_time desc
</select>
<select id="selectZdyDevicePassflowGpsLogByLogId" parameterType="Long"
resultMap="ZdyDevicePassflowGpsLogResult">
<include refid="selectZdyDevicePassflowGpsLogVo"/>
where gl.log_id = #{logId}
</select>
<insert id="insertZdyDevicePassflowGpsLog" parameterType="ZdyDevicePassflowGpsLog" useGeneratedKeys="true"
keyProperty="logId">
insert into zdy_device_passflow_gps_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="sn != null">sn,
</if>
<if test="type != null">type,
</if>
<if test="time != null">time,
</if>
<if test="dataTime != null">data_time,
</if>
<if test="createdTime != null">created_time,
</if>
<if test="longitude != null">longitude,
</if>
<if test="latitude != null">latitude,
</if>
<if test="no != null">no,
</if>
<if test="speed != null">speed,
</if>
<if test="direction != null">direction,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="remark != null">remark,
</if>
<if test="sendInfo != null">send_info,
</if>
<if test="reqInfo != null">req_info,
</if>
<if test="deptId != null">dept_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sn != null">#{sn},
</if>
<if test="type != null">#{type},
</if>
<if test="time != null">#{time},
</if>
<if test="dataTime != null">#{dataTime},
</if>
<if test="createdTime != null">#{createdTime},
</if>
<if test="longitude != null">#{longitude},
</if>
<if test="latitude != null">#{latitude},
</if>
<if test="no != null">#{no},
</if>
<if test="speed != null">#{speed},
</if>
<if test="direction != null">#{direction},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="remark != null">#{remark},
</if>
<if test="sendInfo != null">#{sendInfo},
</if>
<if test="reqInfo != null">#{reqInfo},
</if>
<if test="deptId != null">#{deptId},
</if>
</trim>
</insert>
<update id="updateZdyDevicePassflowGpsLog" parameterType="ZdyDevicePassflowGpsLog">
update zdy_device_passflow_gps_log
<trim prefix="SET" suffixOverrides=",">
<if test="sn != null">sn =
#{sn},
</if>
<if test="type != null">type =
#{type},
</if>
<if test="time != null">time =
#{time},
</if>
<if test="dataTime != null">data_time =
#{dataTime},
</if>
<if test="createdTime != null">created_time =
#{createdTime},
</if>
<if test="longitude != null">longitude =
#{longitude},
</if>
<if test="latitude != null">latitude =
#{latitude},
</if>
<if test="no != null">no =
#{no},
</if>
<if test="speed != null">speed =
#{speed},
</if>
<if test="direction != null">direction =
#{direction},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="remark != null">remark =
#{remark},
</if>
<if test="sendInfo != null">send_info =
#{sendInfo},
</if>
<if test="reqInfo != null">req_info =
#{reqInfo},
</if>
<if test="deptId != null">dept_id =
#{deptId},
</if>
</trim>
where log_id = #{logId}
</update>
<delete id="deleteZdyDevicePassflowGpsLogByLogId" parameterType="Long">
delete
from zdy_device_passflow_gps_log
where log_id = #{logId}
</delete>
<delete id="deleteZdyDevicePassflowGpsLogByLogIds" parameterType="String">
delete from zdy_device_passflow_gps_log where log_id in
<foreach item="logId" collection="array" open="(" separator="," close=")">
#{logId}
</foreach>
</delete>
</mapper>