<?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.VisitPlanObjExtMapper">
  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.visit.ext.VisitPlanObjExt">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="plan_id" jdbcType="VARCHAR" property="planId" />
    <result column="obj_id" jdbcType="VARCHAR" property="objId" />
    <result column="obj_name" jdbcType="VARCHAR" property="objName" />
    <result column="obj_type" jdbcType="VARCHAR" property="objType" />
    <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, obj_id, obj_name, obj_type, 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_obj
    <trim prefix="(" suffix=")" suffixOverrides=",">
      id, plan_id, obj_id, obj_name, obj_type, wg_code, create_time, create_by, update_time,
      update_by, is_valid, ylzd1, ylzd2, ylzd3, ylzd4, ylzd5,obj_user_name, obj_number
    </trim>
    values
    <foreach collection="list" item="obj" index="index" separator="," >
      ( #{obj.id,jdbcType=VARCHAR},#{obj.planId,jdbcType=VARCHAR}, #{obj.objId,jdbcType=VARCHAR},#{obj.objName,jdbcType=VARCHAR},#{obj.objType,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},#{obj.objUserName,jdbcType=VARCHAR}, #{obj.objNumber,jdbcType=VARCHAR}
      )
    </foreach>
  </insert>
</mapper>
