<?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.GridPublicOpinionsMapper">
  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.grid.GridPublicOpinions">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="service_time" jdbcType="VARCHAR" property="serviceTime" />
    <result column="service_name" jdbcType="VARCHAR" property="serviceName" />
    <result column="people_id" jdbcType="VARCHAR" property="peopleId" />
    <result column="person_name" jdbcType="VARCHAR" property="personName" />
    <result column="content" jdbcType="VARCHAR" property="content" />
    <result column="wg_code" jdbcType="VARCHAR" property="wgCode" />
    <result column="wg_value" jdbcType="VARCHAR" property="wgValue" />
    <result column="country" jdbcType="VARCHAR" property="country" />
    <result column="create_id" jdbcType="VARCHAR" property="createId" />
    <result column="create_time" jdbcType="VARCHAR" property="createTime" />
    <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, service_time, service_name, people_id, person_name, content, wg_code, wg_value,
    country, create_id, create_time, longitude, latitude, address
  </sql>
  <select id="selectByExample" parameterType="com.ruoyi.system.domain.grid.GridPublicOpinionsExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from grid_public_opinions
    <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_public_opinions
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from grid_public_opinions
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.ruoyi.system.domain.grid.GridPublicOpinionsExample">
    delete from grid_public_opinions
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.ruoyi.system.domain.grid.GridPublicOpinions">
    insert into grid_public_opinions (id, service_time, service_name,
      people_id, person_name, content,
      wg_code, wg_value, country,
      create_id, create_time, longitude,
      latitude, address)
    values (#{id,jdbcType=VARCHAR}, #{serviceTime,jdbcType=VARCHAR}, #{serviceName,jdbcType=VARCHAR},
      #{peopleId,jdbcType=VARCHAR}, #{personName,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR},
      #{wgCode,jdbcType=VARCHAR}, #{wgValue,jdbcType=VARCHAR}, #{country,jdbcType=VARCHAR},
      #{createId,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR},
      #{latitude,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.ruoyi.system.domain.grid.GridPublicOpinions" keyProperty="id" useGeneratedKeys="true">
    insert into grid_public_opinions
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="serviceTime != null">
        service_time,
      </if>
      <if test="serviceName != null">
        service_name,
      </if>
      <if test="peopleId != null">
        people_id,
      </if>
      <if test="personName != null">
        person_name,
      </if>
      <if test="content != null">
        content,
      </if>
      <if test="wgCode != null">
        wg_code,
      </if>
      <if test="wgValue != null">
        wg_value,
      </if>
      <if test="country != null">
        country,
      </if>
      <if test="createId != null">
        create_id,
      </if>
      <if test="createTime != null">
        create_time,
      </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="serviceTime != null">
        #{serviceTime,jdbcType=VARCHAR},
      </if>
      <if test="serviceName != null">
        #{serviceName,jdbcType=VARCHAR},
      </if>
      <if test="peopleId != null">
        #{peopleId,jdbcType=VARCHAR},
      </if>
      <if test="personName != null">
        #{personName,jdbcType=VARCHAR},
      </if>
      <if test="content != null">
        #{content,jdbcType=VARCHAR},
      </if>
      <if test="wgCode != null">
        #{wgCode,jdbcType=VARCHAR},
      </if>
      <if test="wgValue != null">
        #{wgValue,jdbcType=VARCHAR},
      </if>
      <if test="country != null">
        #{country,jdbcType=VARCHAR},
      </if>
      <if test="createId != null">
        #{createId,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,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.GridPublicOpinionsExample" resultType="java.lang.Long">
    select count(*) from grid_public_opinions
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update grid_public_opinions
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.serviceTime != null">
        service_time = #{record.serviceTime,jdbcType=VARCHAR},
      </if>
      <if test="record.serviceName != null">
        service_name = #{record.serviceName,jdbcType=VARCHAR},
      </if>
      <if test="record.peopleId != null">
        people_id = #{record.peopleId,jdbcType=VARCHAR},
      </if>
      <if test="record.personName != null">
        person_name = #{record.personName,jdbcType=VARCHAR},
      </if>
      <if test="record.content != null">
        content = #{record.content,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.country != null">
        country = #{record.country,jdbcType=VARCHAR},
      </if>
      <if test="record.createId != null">
        create_id = #{record.createId,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,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_public_opinions
    set id = #{record.id,jdbcType=VARCHAR},
      service_time = #{record.serviceTime,jdbcType=VARCHAR},
      service_name = #{record.serviceName,jdbcType=VARCHAR},
      people_id = #{record.peopleId,jdbcType=VARCHAR},
      person_name = #{record.personName,jdbcType=VARCHAR},
      content = #{record.content,jdbcType=VARCHAR},
      wg_code = #{record.wgCode,jdbcType=VARCHAR},
      wg_value = #{record.wgValue,jdbcType=VARCHAR},
      country = #{record.country,jdbcType=VARCHAR},
      create_id = #{record.createId,jdbcType=VARCHAR},
      create_time = #{record.createTime,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.GridPublicOpinions">
    update grid_public_opinions
    <set>
      <if test="serviceTime != null">
        service_time = #{serviceTime,jdbcType=VARCHAR},
      </if>
      <if test="serviceName != null">
        service_name = #{serviceName,jdbcType=VARCHAR},
      </if>
      <if test="peopleId != null">
        people_id = #{peopleId,jdbcType=VARCHAR},
      </if>
      <if test="personName != null">
        person_name = #{personName,jdbcType=VARCHAR},
      </if>
      <if test="content != null">
        content = #{content,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="country != null">
        country = #{country,jdbcType=VARCHAR},
      </if>
      <if test="createId != null">
        create_id = #{createId,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,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.GridPublicOpinions">
    update grid_public_opinions
    set service_time = #{serviceTime,jdbcType=VARCHAR},
      service_name = #{serviceName,jdbcType=VARCHAR},
      people_id = #{peopleId,jdbcType=VARCHAR},
      person_name = #{personName,jdbcType=VARCHAR},
      content = #{content,jdbcType=VARCHAR},
      wg_code = #{wgCode,jdbcType=VARCHAR},
      wg_value = #{wgValue,jdbcType=VARCHAR},
      country = #{country,jdbcType=VARCHAR},
      create_id = #{createId,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=VARCHAR},
      longitude = #{longitude,jdbcType=VARCHAR},
      latitude = #{latitude,jdbcType=VARCHAR},
      address = #{address,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>
