| <?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.ArdAppPatrolpointMapper"> | 
|      | 
|     <resultMap type="ArdAppPatrolpoint" id="ArdAppPatrolpointResult"> | 
|         <result property="id"    column="id"    /> | 
|         <result property="patrolplanId"    column="patrolplan_id"    /> | 
|         <result property="alarmpointsId"    column="alarmpoints_id"    /> | 
|         <result property="type"    column="type"    /> | 
|     </resultMap> | 
|   | 
|     <sql id="selectArdAppPatrolpointVo"> | 
|         select id, patrolplan_id, alarmpoints_id, type from ard_app_patrolpoint | 
|     </sql> | 
|   | 
|     <select id="selectArdAppPatrolpointList" parameterType="ArdAppPatrolpoint" resultMap="ArdAppPatrolpointResult"> | 
|         <include refid="selectArdAppPatrolpointVo"/> | 
|         <where>   | 
|             <if test="patrolplanId != null  and patrolplanId != ''"> and patrolplan_id = #{patrolplanId}</if> | 
|             <if test="alarmpointsId != null  and alarmpointsId != ''"> and alarmpoints_id = #{alarmpointsId}</if> | 
|             <if test="type != null  and type != ''"> and type = #{type}</if> | 
|         </where> | 
|     </select> | 
|      | 
|     <select id="selectArdAppPatrolpointById" parameterType="String" resultMap="ArdAppPatrolpointResult"> | 
|         <include refid="selectArdAppPatrolpointVo"/> | 
|         where id = #{id} | 
|     </select> | 
|          | 
|     <insert id="insertArdAppPatrolpoint" parameterType="ArdAppPatrolpoint"> | 
|         insert into ard_app_patrolpoint | 
|         <trim prefix="(" suffix=")" suffixOverrides=","> | 
|             <if test="id != null">id,</if> | 
|             <if test="patrolplanId != null">patrolplan_id,</if> | 
|             <if test="alarmpointsId != null">alarmpoints_id,</if> | 
|             <if test="type != null">type,</if> | 
|          </trim> | 
|         <trim prefix="values (" suffix=")" suffixOverrides=","> | 
|             <if test="id != null">#{id},</if> | 
|             <if test="patrolplanId != null">#{patrolplanId},</if> | 
|             <if test="alarmpointsId != null">#{alarmpointsId},</if> | 
|             <if test="type != null">#{type},</if> | 
|          </trim> | 
|     </insert> | 
|   | 
|     <update id="updateArdAppPatrolpoint" parameterType="ArdAppPatrolpoint"> | 
|         update ard_app_patrolpoint | 
|         <trim prefix="SET" suffixOverrides=","> | 
|             <if test="patrolplanId != null">patrolplan_id = #{patrolplanId},</if> | 
|             <if test="alarmpointsId != null">alarmpoints_id = #{alarmpointsId},</if> | 
|             <if test="type != null">type = #{type},</if> | 
|         </trim> | 
|         where id = #{id} | 
|     </update> | 
|   | 
|     <delete id="deleteArdAppPatrolpointById" parameterType="String"> | 
|         delete from ard_app_patrolpoint where patrolplan_id = #{id} | 
|     </delete> | 
|   | 
|     <delete id="deleteArdAppPatrolpointByIds" parameterType="String"> | 
|         delete from ard_app_patrolpoint where id in  | 
|         <foreach item="id" collection="array" open="(" separator="," close=")"> | 
|             #{id} | 
|         </foreach> | 
|     </delete> | 
|   | 
|     <insert id="insertArdAppPatrolpointList" parameterType="ArdAppPatrolpoint"> | 
|         insert into ard_app_patrolpoint (id,patrolplan_id,alarmpoints_id,type) values | 
|         <foreach collection="ardAppPatrolpointList" separator="," item="ardAppPatrolpoint"> | 
|             (#{ardAppPatrolpoint.id},#{ardAppPatrolpoint.patrolplanId}, | 
|             #{ardAppPatrolpoint.alarmpointsId},#{ardAppPatrolpoint.type}) | 
|         </foreach> | 
|     </insert> | 
|     <delete id="deleteArdAppPatrolpointByPlanId" parameterType="String"> | 
|         delete from ard_app_patrolpoint aap where aap.patrolplan_id = #{id} | 
|     </delete> | 
| </mapper> |