<?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.grid.GridInterviewMapper">
  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.grid.GridInterview">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="cid" jdbcType="VARCHAR" property="cid" />
    <result column="wg_code" jdbcType="VARCHAR" property="wgCode" />
    <result column="wg_value" jdbcType="VARCHAR" property="wgValue" />
    <result column="interview_time" jdbcType="VARCHAR" property="interviewTime" />
    <result column="cid_name" jdbcType="VARCHAR" property="cidName" />
    <result column="content" jdbcType="VARCHAR" property="content" />
    <result column="create_id" jdbcType="VARCHAR" property="createId" />
    <result column="create_name" jdbcType="VARCHAR" property="createName" />
    <result column="create_time" jdbcType="VARCHAR" property="createTime" />
    <result column="type" jdbcType="VARCHAR" property="type" />
    <result column="status" jdbcType="VARCHAR" property="status" />
    <result column="task_id" jdbcType="VARCHAR" property="taskId" />
    <result column="longitude" jdbcType="VARCHAR" property="longitude" />
    <result column="latitude" jdbcType="VARCHAR" property="latitude" />
    <result column="address" jdbcType="VARCHAR" property="address" />
  </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, cid, wg_code, wg_value, interview_time, cid_name, content, create_id, create_name,
    create_time, type, status, task_id, longitude, latitude, address
  </sql>
  <select id="selectByExample" parameterType="com.ruoyi.system.domain.grid.GridInterviewExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from grid_interview
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from grid_interview
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from grid_interview
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.ruoyi.system.domain.grid.GridInterviewExample">
    delete from grid_interview
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.ruoyi.system.domain.grid.GridInterview">
    insert into grid_interview (id, cid, wg_code,
      wg_value, interview_time, cid_name,
      content, create_id, create_name,
      create_time, type, status,
      task_id, longitude, latitude,
      address)
    values (#{id,jdbcType=VARCHAR}, #{cid,jdbcType=VARCHAR}, #{wgCode,jdbcType=VARCHAR},
      #{wgValue,jdbcType=VARCHAR}, #{interviewTime,jdbcType=VARCHAR}, #{cidName,jdbcType=VARCHAR},
      #{content,jdbcType=VARCHAR}, #{createId,jdbcType=VARCHAR}, #{createName,jdbcType=VARCHAR},
      #{createTime,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
      #{taskId,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR},
      #{address,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.ruoyi.system.domain.grid.GridInterview" keyProperty="id" useGeneratedKeys="true">
    insert into grid_interview
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="cid != null">
        cid,
      </if>
      <if test="wgCode != null">
        wg_code,
      </if>
      <if test="wgValue != null">
        wg_value,
      </if>
      <if test="interviewTime != null">
        interview_time,
      </if>
      <if test="cidName != null">
        cid_name,
      </if>
      <if test="content != null">
        content,
      </if>
      <if test="createId != null">
        create_id,
      </if>
      <if test="createName != null">
        create_name,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="taskId != null">
        task_id,
      </if>
      <if test="longitude != null">
        longitude,
      </if>
      <if test="latitude != null">
        latitude,
      </if>
      <if test="address != null">
        address,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="cid != null">
        #{cid,jdbcType=VARCHAR},
      </if>
      <if test="wgCode != null">
        #{wgCode,jdbcType=VARCHAR},
      </if>
      <if test="wgValue != null">
        #{wgValue,jdbcType=VARCHAR},
      </if>
      <if test="interviewTime != null">
        #{interviewTime,jdbcType=VARCHAR},
      </if>
      <if test="cidName != null">
        #{cidName,jdbcType=VARCHAR},
      </if>
      <if test="content != null">
        #{content,jdbcType=VARCHAR},
      </if>
      <if test="createId != null">
        #{createId,jdbcType=VARCHAR},
      </if>
      <if test="createName != null">
        #{createName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="taskId != null">
        #{taskId,jdbcType=VARCHAR},
      </if>
      <if test="longitude != null">
        #{longitude,jdbcType=VARCHAR},
      </if>
      <if test="latitude != null">
        #{latitude,jdbcType=VARCHAR},
      </if>
      <if test="address != null">
        #{address,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.ruoyi.system.domain.grid.GridInterviewExample" resultType="java.lang.Long">
    select count(*) from grid_interview
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update grid_interview
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.cid != null">
        cid = #{record.cid,jdbcType=VARCHAR},
      </if>
      <if test="record.wgCode != null">
        wg_code = #{record.wgCode,jdbcType=VARCHAR},
      </if>
      <if test="record.wgValue != null">
        wg_value = #{record.wgValue,jdbcType=VARCHAR},
      </if>
      <if test="record.interviewTime != null">
        interview_time = #{record.interviewTime,jdbcType=VARCHAR},
      </if>
      <if test="record.cidName != null">
        cid_name = #{record.cidName,jdbcType=VARCHAR},
      </if>
      <if test="record.content != null">
        content = #{record.content,jdbcType=VARCHAR},
      </if>
      <if test="record.createId != null">
        create_id = #{record.createId,jdbcType=VARCHAR},
      </if>
      <if test="record.createName != null">
        create_name = #{record.createName,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=VARCHAR},
      </if>
      <if test="record.type != null">
        type = #{record.type,jdbcType=VARCHAR},
      </if>
      <if test="record.status != null">
        status = #{record.status,jdbcType=VARCHAR},
      </if>
      <if test="record.taskId != null">
        task_id = #{record.taskId,jdbcType=VARCHAR},
      </if>
      <if test="record.longitude != null">
        longitude = #{record.longitude,jdbcType=VARCHAR},
      </if>
      <if test="record.latitude != null">
        latitude = #{record.latitude,jdbcType=VARCHAR},
      </if>
      <if test="record.address != null">
        address = #{record.address,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update grid_interview
    set id = #{record.id,jdbcType=VARCHAR},
      cid = #{record.cid,jdbcType=VARCHAR},
      wg_code = #{record.wgCode,jdbcType=VARCHAR},
      wg_value = #{record.wgValue,jdbcType=VARCHAR},
      interview_time = #{record.interviewTime,jdbcType=VARCHAR},
      cid_name = #{record.cidName,jdbcType=VARCHAR},
      content = #{record.content,jdbcType=VARCHAR},
      create_id = #{record.createId,jdbcType=VARCHAR},
      create_name = #{record.createName,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=VARCHAR},
      type = #{record.type,jdbcType=VARCHAR},
      status = #{record.status,jdbcType=VARCHAR},
      task_id = #{record.taskId,jdbcType=VARCHAR},
      longitude = #{record.longitude,jdbcType=VARCHAR},
      latitude = #{record.latitude,jdbcType=VARCHAR},
      address = #{record.address,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.system.domain.grid.GridInterview">
    update grid_interview
    <set>
      <if test="cid != null">
        cid = #{cid,jdbcType=VARCHAR},
      </if>
      <if test="wgCode != null">
        wg_code = #{wgCode,jdbcType=VARCHAR},
      </if>
      <if test="wgValue != null">
        wg_value = #{wgValue,jdbcType=VARCHAR},
      </if>
      <if test="interviewTime != null">
        interview_time = #{interviewTime,jdbcType=VARCHAR},
      </if>
      <if test="cidName != null">
        cid_name = #{cidName,jdbcType=VARCHAR},
      </if>
      <if test="content != null">
        content = #{content,jdbcType=VARCHAR},
      </if>
      <if test="createId != null">
        create_id = #{createId,jdbcType=VARCHAR},
      </if>
      <if test="createName != null">
        create_name = #{createName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=VARCHAR},
      </if>
      <if test="taskId != null">
        task_id = #{taskId,jdbcType=VARCHAR},
      </if>
      <if test="longitude != null">
        longitude = #{longitude,jdbcType=VARCHAR},
      </if>
      <if test="latitude != null">
        latitude = #{latitude,jdbcType=VARCHAR},
      </if>
      <if test="address != null">
        address = #{address,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ruoyi.system.domain.grid.GridInterview">
    update grid_interview
    set cid = #{cid,jdbcType=VARCHAR},
      wg_code = #{wgCode,jdbcType=VARCHAR},
      wg_value = #{wgValue,jdbcType=VARCHAR},
      interview_time = #{interviewTime,jdbcType=VARCHAR},
      cid_name = #{cidName,jdbcType=VARCHAR},
      content = #{content,jdbcType=VARCHAR},
      create_id = #{createId,jdbcType=VARCHAR},
      create_name = #{createName,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=VARCHAR},
      type = #{type,jdbcType=VARCHAR},
      status = #{status,jdbcType=VARCHAR},
      task_id = #{taskId,jdbcType=VARCHAR},
      longitude = #{longitude,jdbcType=VARCHAR},
      latitude = #{latitude,jdbcType=VARCHAR},
      address = #{address,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>
