| <?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.ArdAppPatroluserMapper"> | 
|      | 
|     <resultMap type="ArdAppPatroluser" id="ArdAppPatroluserResult"> | 
|         <result property="id"    column="id"    /> | 
|         <result property="patrolplanId"    column="patrolplan_id"    /> | 
|         <result property="appUserId"    column="app_user_id"    /> | 
|     </resultMap> | 
|   | 
|     <sql id="selectArdAppPatroluserVo"> | 
|         select id, patrolplan_id, app_user_id from ard_app_patroluser | 
|     </sql> | 
|   | 
|     <select id="selectArdAppPatroluserList" parameterType="ArdAppPatroluser" resultMap="ArdAppPatroluserResult"> | 
|         <include refid="selectArdAppPatroluserVo"/> | 
|         <where>   | 
|             <if test="patrolplanId != null  and patrolplanId != ''"> and patrolplan_id = #{patrolplanId}</if> | 
|             <if test="appUserId != null  and appUserId != ''"> and app_user_id = #{appUserId}</if> | 
|         </where> | 
|     </select> | 
|      | 
|     <select id="selectArdAppPatroluserById" parameterType="String" resultMap="ArdAppPatroluserResult"> | 
|         <include refid="selectArdAppPatroluserVo"/> | 
|         where id = #{id} | 
|     </select> | 
|          | 
|     <insert id="insertArdAppPatroluser" parameterType="ArdAppPatroluser"> | 
|         insert into ard_app_patroluser | 
|         <trim prefix="(" suffix=")" suffixOverrides=","> | 
|             <if test="id != null">id,</if> | 
|             <if test="patrolplanId != null">patrolplan_id,</if> | 
|             <if test="appUserId != null">app_user_id,</if> | 
|          </trim> | 
|         <trim prefix="values (" suffix=")" suffixOverrides=","> | 
|             <if test="id != null">#{id},</if> | 
|             <if test="patrolplanId != null">#{patrolplanId},</if> | 
|             <if test="appUserId != null">#{appUserId},</if> | 
|          </trim> | 
|     </insert> | 
|   | 
|     <update id="updateArdAppPatroluser" parameterType="ArdAppPatroluser"> | 
|         update ard_app_patroluser | 
|         <trim prefix="SET" suffixOverrides=","> | 
|             <if test="patrolplanId != null">patrolplan_id = #{patrolplanId},</if> | 
|             <if test="appUserId != null">app_user_id = #{appUserId},</if> | 
|         </trim> | 
|         where id = #{id} | 
|     </update> | 
|   | 
|     <delete id="deleteArdAppPatroluserById" parameterType="String"> | 
|         delete from ard_app_patroluser where id = #{id} | 
|     </delete> | 
|   | 
|     <delete id="deleteArdAppPatroluserByIds" parameterType="String"> | 
|         delete from ard_app_patroluser where id in  | 
|         <foreach item="id" collection="array" open="(" separator="," close=")"> | 
|             #{id} | 
|         </foreach> | 
|     </delete> | 
|   | 
|     <insert id="insertArdAppPatroluserList" parameterType="ArdAppPatroluser"> | 
|         insert into ard_app_patroluser (id,patrolplan_id,app_user_id) values | 
|         <foreach collection="ardAppPatroluserList" separator="," item="ardAppPatroluser"> | 
|             (#{ardAppPatroluser.id},#{ardAppPatroluser.patrolplanId},#{ardAppPatroluser.appUserId}) | 
|         </foreach> | 
|     </insert> | 
|     <delete id="deleteArdAppPatroluserByPlanId" parameterType="String"> | 
|         delete from ard_app_patroluser aap where aap.patrolplan_id = #{id} | 
|     </delete> | 
| </mapper> |