<?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.GridCompanySafeCheckMapper">
  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.grid.GridCompanySafeCheck">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="company_id" jdbcType="VARCHAR" property="companyId" />
    <result column="check_time" jdbcType="VARCHAR" property="checkTime" />
    <result column="clock_longitude" jdbcType="VARCHAR" property="clockLongitude" />
    <result column="clock_latitude" jdbcType="VARCHAR" property="clockLatitude" />
    <result column="check_user_id" jdbcType="VARCHAR" property="checkUserId" />
    <result column="check_user_name" jdbcType="VARCHAR" property="checkUserName" />
    <result column="check_status" jdbcType="VARCHAR" property="checkStatus" />
    <result column="is_valid" jdbcType="VARCHAR" property="isValid" />
    <result column="create_time" jdbcType="VARCHAR" property="createTime" />
    <result column="check_type" jdbcType="VARCHAR" property="checkType" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.ruoyi.system.domain.grid.GridCompanySafeCheck">
    <result column="check_feedback" jdbcType="LONGVARCHAR" property="checkFeedback" />
  </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, company_id, check_time, clock_longitude, clock_latitude, check_user_id, check_user_name, 
    check_status, is_valid, create_time, check_type
  </sql>
  <sql id="Blob_Column_List">
    check_feedback
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="com.ruoyi.system.domain.grid.GridCompanySafeCheckExample" resultMap="ResultMapWithBLOBs">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from grid_company_safe_check
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="com.ruoyi.system.domain.grid.GridCompanySafeCheckExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from grid_company_safe_check
    <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="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from grid_company_safe_check
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from grid_company_safe_check
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.ruoyi.system.domain.grid.GridCompanySafeCheckExample">
    delete from grid_company_safe_check
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.ruoyi.system.domain.grid.GridCompanySafeCheck">
    insert into grid_company_safe_check (id, company_id, check_time, 
      clock_longitude, clock_latitude, check_user_id, 
      check_user_name, check_status,
      is_valid, create_time, check_type, 
      check_feedback)
    values (#{id,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{checkTime,jdbcType=VARCHAR}, 
      #{clockLongitude,jdbcType=VARCHAR}, #{clockLatitude,jdbcType=VARCHAR}, #{checkUserId,jdbcType=VARCHAR}, 
      #{checkUserName,jdbcType=VARCHAR}, #{checkStatus,jdbcType=VARCHAR},
      #{isValid,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR}, #{checkType,jdbcType=VARCHAR}, 
      #{checkFeedback,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.ruoyi.system.domain.grid.GridCompanySafeCheck">
    insert into grid_company_safe_check
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="companyId != null">
        company_id,
      </if>
      <if test="checkTime != null">
        check_time,
      </if>
      <if test="clockLongitude != null">
        clock_longitude,
      </if>
      <if test="clockLatitude != null">
        clock_latitude,
      </if>
      <if test="checkUserId != null">
        check_user_id,
      </if>
      <if test="checkUserName != null">
        check_user_name,
      </if>
      <if test="checkStatus != null">
        check_status,
      </if>
      <if test="isValid != null">
        is_valid,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="checkType != null">
        check_type,
      </if>
      <if test="checkFeedback != null">
        check_feedback,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="companyId != null">
        #{companyId,jdbcType=VARCHAR},
      </if>
      <if test="checkTime != null">
        #{checkTime,jdbcType=VARCHAR},
      </if>
      <if test="clockLongitude != null">
        #{clockLongitude,jdbcType=VARCHAR},
      </if>
      <if test="clockLatitude != null">
        #{clockLatitude,jdbcType=VARCHAR},
      </if>
      <if test="checkUserId != null">
        #{checkUserId,jdbcType=VARCHAR},
      </if>
      <if test="checkUserName != null">
        #{checkUserName,jdbcType=VARCHAR},
      </if>
      <if test="checkStatus != null">
        #{checkStatus,jdbcType=VARCHAR},
      </if>
      <if test="isValid != null">
        #{isValid,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=VARCHAR},
      </if>
      <if test="checkType != null">
        #{checkType,jdbcType=VARCHAR},
      </if>
      <if test="checkFeedback != null">
        #{checkFeedback,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.ruoyi.system.domain.grid.GridCompanySafeCheckExample" resultType="java.lang.Long">
    select count(*) from grid_company_safe_check
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update grid_company_safe_check
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.companyId != null">
        company_id = #{record.companyId,jdbcType=VARCHAR},
      </if>
      <if test="record.checkTime != null">
        check_time = #{record.checkTime,jdbcType=VARCHAR},
      </if>
      <if test="record.clockLongitude != null">
        clock_longitude = #{record.clockLongitude,jdbcType=VARCHAR},
      </if>
      <if test="record.clockLatitude != null">
        clock_latitude = #{record.clockLatitude,jdbcType=VARCHAR},
      </if>
      <if test="record.checkUserId != null">
        check_user_id = #{record.checkUserId,jdbcType=VARCHAR},
      </if>
      <if test="record.checkUserName != null">
        check_user_name = #{record.checkUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.checkStatus != null">
        check_status = #{record.checkStatus,jdbcType=VARCHAR},
      </if>
      <if test="record.isValid != null">
        is_valid = #{record.isValid,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=VARCHAR},
      </if>
      <if test="record.checkType != null">
        check_type = #{record.checkType,jdbcType=VARCHAR},
      </if>
      <if test="record.checkFeedback != null">
        check_feedback = #{record.checkFeedback,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    update grid_company_safe_check
    set id = #{record.id,jdbcType=VARCHAR},
      company_id = #{record.companyId,jdbcType=VARCHAR},
      check_time = #{record.checkTime,jdbcType=VARCHAR},
      clock_longitude = #{record.clockLongitude,jdbcType=VARCHAR},
      clock_latitude = #{record.clockLatitude,jdbcType=VARCHAR},
      check_user_id = #{record.checkUserId,jdbcType=VARCHAR},
      check_user_name = #{record.checkUserName,jdbcType=VARCHAR},
      check_status = #{record.checkStatus,jdbcType=VARCHAR},
      is_valid = #{record.isValid,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=VARCHAR},
      check_type = #{record.checkType,jdbcType=VARCHAR},
      check_feedback = #{record.checkFeedback,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update grid_company_safe_check
    set id = #{record.id,jdbcType=VARCHAR},
      company_id = #{record.companyId,jdbcType=VARCHAR},
      check_time = #{record.checkTime,jdbcType=VARCHAR},
      clock_longitude = #{record.clockLongitude,jdbcType=VARCHAR},
      clock_latitude = #{record.clockLatitude,jdbcType=VARCHAR},
      check_user_id = #{record.checkUserId,jdbcType=VARCHAR},
      check_user_name = #{record.checkUserName,jdbcType=VARCHAR},
      check_status = #{record.checkStatus,jdbcType=VARCHAR},
      is_valid = #{record.isValid,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=VARCHAR},
      check_type = #{record.checkType,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.system.domain.grid.GridCompanySafeCheck">
    update grid_company_safe_check
    <set>
      <if test="companyId != null">
        company_id = #{companyId,jdbcType=VARCHAR},
      </if>
      <if test="checkTime != null">
        check_time = #{checkTime,jdbcType=VARCHAR},
      </if>
      <if test="clockLongitude != null">
        clock_longitude = #{clockLongitude,jdbcType=VARCHAR},
      </if>
      <if test="clockLatitude != null">
        clock_latitude = #{clockLatitude,jdbcType=VARCHAR},
      </if>
      <if test="checkUserId != null">
        check_user_id = #{checkUserId,jdbcType=VARCHAR},
      </if>
      <if test="checkUserName != null">
        check_user_name = #{checkUserName,jdbcType=VARCHAR},
      </if>
      <if test="checkStatus != null">
        check_status = #{checkStatus,jdbcType=VARCHAR},
      </if>
      <if test="isValid != null">
        is_valid = #{isValid,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=VARCHAR},
      </if>
      <if test="checkType != null">
        check_type = #{checkType,jdbcType=VARCHAR},
      </if>
      <if test="checkFeedback != null">
        check_feedback = #{checkFeedback,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.ruoyi.system.domain.grid.GridCompanySafeCheck">
    update grid_company_safe_check
    set company_id = #{companyId,jdbcType=VARCHAR},
      check_time = #{checkTime,jdbcType=VARCHAR},
      clock_longitude = #{clockLongitude,jdbcType=VARCHAR},
      clock_latitude = #{clockLatitude,jdbcType=VARCHAR},
      check_user_id = #{checkUserId,jdbcType=VARCHAR},
      check_user_name = #{checkUserName,jdbcType=VARCHAR},
      check_status = #{checkStatus,jdbcType=VARCHAR},
      is_valid = #{isValid,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=VARCHAR},
      check_type = #{checkType,jdbcType=VARCHAR},
      check_feedback = #{checkFeedback,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ruoyi.system.domain.grid.GridCompanySafeCheck">
    update grid_company_safe_check
    set company_id = #{companyId,jdbcType=VARCHAR},
      check_time = #{checkTime,jdbcType=VARCHAR},
      clock_longitude = #{clockLongitude,jdbcType=VARCHAR},
      clock_latitude = #{clockLatitude,jdbcType=VARCHAR},
      check_user_id = #{checkUserId,jdbcType=VARCHAR},
      check_user_name = #{checkUserName,jdbcType=VARCHAR},
      check_status = #{checkStatus,jdbcType=VARCHAR},
      is_valid = #{isValid,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=VARCHAR},
      check_type = #{checkType,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>