<?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.app.patrolplan.mapper.ArdAppPatrolpointRecordMapper">
|
|
<resultMap type="ArdAppPatrolpointRecord" id="ArdAppPatrolpointRecordResult">
|
<result property="id" column="id" />
|
<result property="remark" column="remark" />
|
<result property="longitude" column="longitude" />
|
<result property="latitude" column="latitude" />
|
<result property="userId" column="user_id" />
|
<result property="recordTime" column="record_time" />
|
<result property="appPatrolpointsId" column="app_patrolpoints_id" />
|
</resultMap>
|
|
<sql id="selectArdAppPatrolpointRecordVo">
|
select id, remark, longitude, latitude, user_id, record_time, app_patrolpoints_id from ard_app_patrolpoint_record
|
</sql>
|
|
<select id="selectArdAppPatrolpointRecordList" parameterType="ArdAppPatrolpointRecord" resultMap="ArdAppPatrolpointRecordResult">
|
<include refid="selectArdAppPatrolpointRecordVo"/>
|
<where>
|
<if test="longitude != null and longitude != ''"> and longitude = #{longitude}</if>
|
<if test="latitude != null and latitude != ''"> and latitude = #{latitude}</if>
|
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
|
<if test="recordTime != null and recordTime != ''"> and record_time = #{recordTime}</if>
|
<if test="appPatrolpointsId != null and appPatrolpointsId != ''"> and app_patrolpoints_id = #{appPatrolpointsId}</if>
|
</where>
|
</select>
|
|
<select id="selectArdAppPatrolpointRecordById" parameterType="String" resultMap="ArdAppPatrolpointRecordResult">
|
<include refid="selectArdAppPatrolpointRecordVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertArdAppPatrolpointRecord" parameterType="ArdAppPatrolpointRecord">
|
insert into ard_app_patrolpoint_record
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="remark != null">remark,</if>
|
<if test="longitude != null">longitude,</if>
|
<if test="latitude != null">latitude,</if>
|
<if test="userId != null">user_id,</if>
|
<if test="recordTime != null">record_time,</if>
|
<if test="appPatrolpointsId != null">app_patrolpoints_id,</if>
|
<if test="planId != null">plan_id,</if>
|
<if test="planName != null">plan_name,</if>
|
<if test="recordImg != null">record_img,</if>
|
<if test="userName != null">user_name,</if>
|
<if test="appPatrolpointsName != null">app_patrolpoints_name,</if>
|
<if test="pointsNum != null">points_num,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},</if>
|
<if test="remark != null">#{remark},</if>
|
<if test="longitude != null">#{longitude},</if>
|
<if test="latitude != null">#{latitude},</if>
|
<if test="userId != null">#{userId},</if>
|
<if test="recordTime != null">#{recordTime},</if>
|
<if test="appPatrolpointsId != null">#{appPatrolpointsId},</if>
|
<if test="planId != null">#{planId},</if>
|
<if test="planName != null">#{planName},</if>
|
<if test="recordImg != null">#{recordImg},</if>
|
<if test="userName != null">#{userName},</if>
|
<if test="appPatrolpointsName != null">#{appPatrolpointsName},</if>
|
<if test="pointsNum != null">#{pointsNum},</if>
|
</trim>
|
</insert>
|
|
<update id="updateArdAppPatrolpointRecord" parameterType="ArdAppPatrolpointRecord">
|
update ard_app_patrolpoint_record
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="remark != null">remark = #{remark},</if>
|
<if test="longitude != null">longitude = #{longitude},</if>
|
<if test="latitude != null">latitude = #{latitude},</if>
|
<if test="userId != null">user_id = #{userId},</if>
|
<if test="recordTime != null">record_time = #{recordTime},</if>
|
<if test="appPatrolpointsId != null">app_patrolpoints_id = #{appPatrolpointsId},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteArdAppPatrolpointRecordById" parameterType="String">
|
delete from ard_app_patrolpoint_record where id = #{id}
|
</delete>
|
|
<delete id="deleteArdAppPatrolpointRecordByIds" parameterType="String">
|
delete from ard_app_patrolpoint_record where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
<select id="es" parameterType="RecordDetailsParam" resultMap="ArdAppPatrolpointRecordResult">
|
SELECT max(points_num) pointsNum,user_id,user_name FROM ard_app_patrolpoint_record
|
WHERE plan_id = #{planId} AND record_time <= #{toDay} GROUP BY user_id,user_name
|
</select>
|
|
<select id="lt" parameterType="RecordDetailsParam" resultMap="ArdAppPatrolpointRecordResult">
|
SELECT max(points_num) pointsNum,user_id,user_name FROM ard_app_patrolpoint_record
|
WHERE plan_id = #{planId} AND record_time like #{toDay} GROUP BY user_id,user_name
|
</select>
|
</mapper>
|