<?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.visit.VisitPlanUserExtMapper">
  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.visit.VisitPlanUser">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="plan_id" jdbcType="VARCHAR" property="planId" />
    <result column="plan_user_name" jdbcType="VARCHAR" property="planUserName" />
    <result column="useId" jdbcType="VARCHAR" property="useid" />
    <result column="wg_code" jdbcType="VARCHAR" property="wgCode" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_by" jdbcType="VARCHAR" property="createBy" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
    <result column="is_valid" jdbcType="VARCHAR" property="isValid" />
    <result column="ylzd1" jdbcType="VARCHAR" property="ylzd1" />
    <result column="ylzd2" jdbcType="VARCHAR" property="ylzd2" />
    <result column="ylzd3" jdbcType="VARCHAR" property="ylzd3" />
    <result column="ylzd4" jdbcType="VARCHAR" property="ylzd4" />
    <result column="ylzd5" jdbcType="VARCHAR" property="ylzd5" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    id, plan_id, plan_user_name, useId, wg_code, create_time, create_by, update_time,
    update_by, is_valid, ylzd1, ylzd2, ylzd3, ylzd4, ylzd5
  </sql>
  <insert id="insertForList" parameterType="java.util.List">
    insert into visit_plan_user
    <trim prefix="(" suffix=")" suffixOverrides=",">
      id, plan_id, plan_user_name, useId, wg_code, create_time, create_by, update_time,
      update_by, is_valid, ylzd1, ylzd2, ylzd3, ylzd4, ylzd5
    </trim>
    values
    <foreach collection="list" item="obj" index="index" separator="," >
      ( #{obj.id,jdbcType=VARCHAR},#{obj.planId,jdbcType=VARCHAR}, #{obj.planUserName,jdbcType=VARCHAR}, #{obj.useid,jdbcType=VARCHAR}, #{obj.wgCode,jdbcType=VARCHAR},
        #{obj.createTime,jdbcType=TIMESTAMP},#{obj.createBy,jdbcType=VARCHAR},#{obj.updateTime,jdbcType=TIMESTAMP},#{obj.updateBy,jdbcType=VARCHAR}, #{obj.isValid,jdbcType=VARCHAR},
      #{obj.ylzd1,jdbcType=VARCHAR},#{obj.ylzd2,jdbcType=VARCHAR},#{obj.ylzd3,jdbcType=VARCHAR}, #{obj.ylzd4,jdbcType=VARCHAR},#{obj.ylzd5,jdbcType=VARCHAR}
      )
    </foreach>
  </insert>
</mapper>
