|
@@ -0,0 +1,96 @@
|
|
|
+<?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.OpeningDoorRecordMapper">
|
|
|
+
|
|
|
+ <resultMap type="OpeningDoorRecord" id="OpeningDoorRecordResult">
|
|
|
+ <result property="recordId" column="record_id" />
|
|
|
+ <result property="entranceGuardName" column="entrance_guard_name" />
|
|
|
+ <result property="controlsTime" column="controls_time" />
|
|
|
+ <result property="type" column="type" />
|
|
|
+ <result property="pictureUrl" column="picture_url" />
|
|
|
+ <result property="createDept" column="create_dept" />
|
|
|
+ <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" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectOpeningDoorRecordVo">
|
|
|
+ select record_id, entrance_guard_name, controls_time, type, picture_url, create_dept, create_by, create_time, update_by, update_time, remark from opening_door_record
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectOpeningDoorRecordList" parameterType="OpeningDoorRecord" resultMap="OpeningDoorRecordResult">
|
|
|
+ <include refid="selectOpeningDoorRecordVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="entranceGuardName != null and entranceGuardName != ''"> and entrance_guard_name like concat('%', #{entranceGuardName}, '%')</if>
|
|
|
+ <if test="controlsTime != null and controlsTime != ''"> and controls_time = #{controlsTime}</if>
|
|
|
+ <if test="type != null and type != ''"> and type = #{type}</if>
|
|
|
+ <if test="pictureUrl != null and pictureUrl != ''"> and picture_url = #{pictureUrl}</if>
|
|
|
+ <if test="createDept != null "> and create_dept = #{createDept}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectOpeningDoorRecordByRecordId" parameterType="Long" resultMap="OpeningDoorRecordResult">
|
|
|
+ <include refid="selectOpeningDoorRecordVo"/>
|
|
|
+ where record_id = #{recordId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertOpeningDoorRecord" parameterType="OpeningDoorRecord" useGeneratedKeys="true" keyProperty="recordId">
|
|
|
+ insert into opening_door_record
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="entranceGuardName != null">entrance_guard_name,</if>
|
|
|
+ <if test="controlsTime != null">controls_time,</if>
|
|
|
+ <if test="type != null">type,</if>
|
|
|
+ <if test="pictureUrl != null">picture_url,</if>
|
|
|
+ <if test="createDept != null">create_dept,</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>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="entranceGuardName != null">#{entranceGuardName},</if>
|
|
|
+ <if test="controlsTime != null">#{controlsTime},</if>
|
|
|
+ <if test="type != null">#{type},</if>
|
|
|
+ <if test="pictureUrl != null">#{pictureUrl},</if>
|
|
|
+ <if test="createDept != null">#{createDept},</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>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateOpeningDoorRecord" parameterType="OpeningDoorRecord">
|
|
|
+ update opening_door_record
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="entranceGuardName != null">entrance_guard_name = #{entranceGuardName},</if>
|
|
|
+ <if test="controlsTime != null">controls_time = #{controlsTime},</if>
|
|
|
+ <if test="type != null">type = #{type},</if>
|
|
|
+ <if test="pictureUrl != null">picture_url = #{pictureUrl},</if>
|
|
|
+ <if test="createDept != null">create_dept = #{createDept},</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>
|
|
|
+ </trim>
|
|
|
+ where record_id = #{recordId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteOpeningDoorRecordByRecordId" parameterType="Long">
|
|
|
+ delete from opening_door_record where record_id = #{recordId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteOpeningDoorRecordByRecordIds" parameterType="String">
|
|
|
+ delete from opening_door_record where record_id in
|
|
|
+ <foreach item="recordId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{recordId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|