FlowEventMapper.xml 15.8 KB
<?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.viontech.fanxing.query.mapper.FlowEventMapper" >
  <resultMap id="BaseResultMapRoot" type="com.viontech.fanxing.commons.model.FlowEvent" >
    <id column="flowEvent_id" property="id" />
    <result column="flowEvent_unid" property="unid" />
    <result column="flowEvent_task_id" property="taskId" />
    <result column="flowEvent_event_type" property="eventType" />
    <result column="flowEvent_event_time" property="eventTime" />
    <result column="flowEvent_device_code" property="deviceCode" />
    <result column="flowEvent_device_name" property="deviceName" />
    <result column="flowEvent_location_code" property="locationCode" />
    <result column="flowEvent_location_name" property="locationName" />
    <result column="flowEvent_pic_name" property="picName" />
    <result column="flowEvent_video_name" property="videoName" />
  </resultMap>
  <resultMap id="BaseResultMap" type="com.viontech.fanxing.commons.model.FlowEvent" extends="BaseResultMapRoot" />
  <resultMap id="ResultMapWithBLOBs" type="com.viontech.fanxing.commons.model.FlowEvent" extends="BaseResultMap" >
    <result column="flowEvent_json_data" property="jsonData" jdbcType="LONGVARCHAR" />
  </resultMap>
  <sql id="Example_Where_Clause" >
    <where >
      <foreach collection="oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List_Root" >
    `flowEvent`.id as flowEvent_id, `flowEvent`.unid as flowEvent_unid, `flowEvent`.task_id as flowEvent_task_id, 
    `flowEvent`.event_type as flowEvent_event_type, `flowEvent`.event_time as flowEvent_event_time, 
    `flowEvent`.device_code as flowEvent_device_code, `flowEvent`.device_name as flowEvent_device_name, 
    `flowEvent`.location_code as flowEvent_location_code, `flowEvent`.location_name as flowEvent_location_name, 
    `flowEvent`.pic_name as flowEvent_pic_name, `flowEvent`.video_name as flowEvent_video_name
  </sql>
  <sql id="Base_Column_List" >
    <if test="!(_parameter.getClass().getSimpleName() == 'FlowEventExample')" >
      <include refid="com.viontech.fanxing.query.mapper.FlowEventMapper.Base_Column_List_Root" />
    </if>
    <if test="_parameter.getClass().getSimpleName() == 'FlowEventExample'" >
      <foreach collection="columnContainerSet" item="columns" separator="," >
        <choose >
          <when test="columns.tableName == 'd_flow_event'.toString()" >
            <if test="columns.valid" >
              ${columns.columnContainerStr}
            </if>
            <if test="!columns.valid" >
              <include refid="com.viontech.fanxing.query.mapper.FlowEventMapper.Base_Column_List_Root" />
            </if>
          </when>
        </choose>
      </foreach>
    </if>
  </sql>
  <sql id="Blob_Column_List" >
    `flowEvent`.json_data as flowEvent_json_data
  </sql>
  <select id="selectByExampleWithBLOBs" resultMap="ResultMapWithBLOBs" parameterType="com.viontech.fanxing.commons.model.FlowEventExample" >
    select
    <if test="distinct" >
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from `d_flow_event` `flowEvent`
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="groupByClause != null" >
      group by ${groupByClause}
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.viontech.fanxing.commons.model.FlowEventExample" >
    select
    <if test="distinct" >
      distinct
    </if>
    <include refid="Base_Column_List" />
    from `d_flow_event` `flowEvent`
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="groupByClause != null" >
      group by ${groupByClause}
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Long" >
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from `d_flow_event` `flowEvent`
    where `flowEvent`.id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    delete  from `d_flow_event` `flowEvent`
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.viontech.fanxing.commons.model.FlowEventExample" >
    delete  from `d_flow_event` `flowEvent`
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.viontech.fanxing.commons.model.FlowEvent" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
    insert into `d_flow_event` (unid, task_id, event_type, 
      event_time, device_code, device_name, 
      location_code, location_name, pic_name, 
      video_name, json_data)
    values (#{unid,jdbcType=VARCHAR}, #{taskId,jdbcType=BIGINT}, #{eventType,jdbcType=VARCHAR}, 
      #{eventTime,jdbcType=TIMESTAMP}, #{deviceCode,jdbcType=VARCHAR}, #{deviceName,jdbcType=VARCHAR}, 
      #{locationCode,jdbcType=VARCHAR}, #{locationName,jdbcType=VARCHAR}, #{picName,jdbcType=VARCHAR}, 
      #{videoName,jdbcType=VARCHAR}, #{jsonData,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.viontech.fanxing.commons.model.FlowEvent" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
    insert into `d_flow_event`
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="unid != null" >
        unid,
      </if>
      <if test="taskId != null" >
        task_id,
      </if>
      <if test="eventType != null" >
        event_type,
      </if>
      <if test="eventTime != null" >
        event_time,
      </if>
      <if test="deviceCode != null" >
        device_code,
      </if>
      <if test="deviceName != null" >
        device_name,
      </if>
      <if test="locationCode != null" >
        location_code,
      </if>
      <if test="locationName != null" >
        location_name,
      </if>
      <if test="picName != null" >
        pic_name,
      </if>
      <if test="videoName != null" >
        video_name,
      </if>
      <if test="jsonData != null" >
        json_data,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="unid != null" >
        #{unid,jdbcType=VARCHAR},
      </if>
      <if test="taskId != null" >
        #{taskId,jdbcType=BIGINT},
      </if>
      <if test="eventType != null" >
        #{eventType,jdbcType=VARCHAR},
      </if>
      <if test="eventTime != null" >
        #{eventTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deviceCode != null" >
        #{deviceCode,jdbcType=VARCHAR},
      </if>
      <if test="deviceName != null" >
        #{deviceName,jdbcType=VARCHAR},
      </if>
      <if test="locationCode != null" >
        #{locationCode,jdbcType=VARCHAR},
      </if>
      <if test="locationName != null" >
        #{locationName,jdbcType=VARCHAR},
      </if>
      <if test="picName != null" >
        #{picName,jdbcType=VARCHAR},
      </if>
      <if test="videoName != null" >
        #{videoName,jdbcType=VARCHAR},
      </if>
      <if test="jsonData != null" >
        #{jsonData,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.viontech.fanxing.commons.model.FlowEventExample" resultType="java.lang.Integer" >
    select count(*) from `d_flow_event` `flowEvent`
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map" >
    update `d_flow_event` `flowEvent`
    <set >
      <if test="record.id != null" >
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.unid != null" >
        unid = #{record.unid,jdbcType=VARCHAR},
      </if>
      <if test="record.taskId != null" >
        task_id = #{record.taskId,jdbcType=BIGINT},
      </if>
      <if test="record.eventType != null" >
        event_type = #{record.eventType,jdbcType=VARCHAR},
      </if>
      <if test="record.eventTime != null" >
        event_time = #{record.eventTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.deviceCode != null" >
        device_code = #{record.deviceCode,jdbcType=VARCHAR},
      </if>
      <if test="record.deviceName != null" >
        device_name = #{record.deviceName,jdbcType=VARCHAR},
      </if>
      <if test="record.locationCode != null" >
        location_code = #{record.locationCode,jdbcType=VARCHAR},
      </if>
      <if test="record.locationName != null" >
        location_name = #{record.locationName,jdbcType=VARCHAR},
      </if>
      <if test="record.picName != null" >
        pic_name = #{record.picName,jdbcType=VARCHAR},
      </if>
      <if test="record.videoName != null" >
        video_name = #{record.videoName,jdbcType=VARCHAR},
      </if>
      <if test="record.jsonData != null" >
        json_data = #{record.jsonData,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map" >
    update `d_flow_event` `flowEvent`
    set `flowEvent`.id = #{record.id,jdbcType=BIGINT},
      `flowEvent`.unid = #{record.unid,jdbcType=VARCHAR},
      `flowEvent`.task_id = #{record.taskId,jdbcType=BIGINT},
      `flowEvent`.event_type = #{record.eventType,jdbcType=VARCHAR},
      `flowEvent`.event_time = #{record.eventTime,jdbcType=TIMESTAMP},
      `flowEvent`.device_code = #{record.deviceCode,jdbcType=VARCHAR},
      `flowEvent`.device_name = #{record.deviceName,jdbcType=VARCHAR},
      `flowEvent`.location_code = #{record.locationCode,jdbcType=VARCHAR},
      `flowEvent`.location_name = #{record.locationName,jdbcType=VARCHAR},
      `flowEvent`.pic_name = #{record.picName,jdbcType=VARCHAR},
      `flowEvent`.video_name = #{record.videoName,jdbcType=VARCHAR},
      `flowEvent`.json_data = #{record.jsonData,jdbcType=LONGVARCHAR}
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map" >
    update `d_flow_event` `flowEvent`
    set id = #{record.id,jdbcType=BIGINT},
      unid = #{record.unid,jdbcType=VARCHAR},
      task_id = #{record.taskId,jdbcType=BIGINT},
      event_type = #{record.eventType,jdbcType=VARCHAR},
      event_time = #{record.eventTime,jdbcType=TIMESTAMP},
      device_code = #{record.deviceCode,jdbcType=VARCHAR},
      device_name = #{record.deviceName,jdbcType=VARCHAR},
      location_code = #{record.locationCode,jdbcType=VARCHAR},
      location_name = #{record.locationName,jdbcType=VARCHAR},
      pic_name = #{record.picName,jdbcType=VARCHAR},
      video_name = #{record.videoName,jdbcType=VARCHAR}
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.viontech.fanxing.commons.model.FlowEvent" >
    update `d_flow_event`
    <set >
      <if test="unid != null" >
        unid = #{unid,jdbcType=VARCHAR},
      </if>
      <if test="taskId != null" >
        task_id = #{taskId,jdbcType=BIGINT},
      </if>
      <if test="eventType != null" >
        event_type = #{eventType,jdbcType=VARCHAR},
      </if>
      <if test="eventTime != null" >
        event_time = #{eventTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deviceCode != null" >
        device_code = #{deviceCode,jdbcType=VARCHAR},
      </if>
      <if test="deviceName != null" >
        device_name = #{deviceName,jdbcType=VARCHAR},
      </if>
      <if test="locationCode != null" >
        location_code = #{locationCode,jdbcType=VARCHAR},
      </if>
      <if test="locationName != null" >
        location_name = #{locationName,jdbcType=VARCHAR},
      </if>
      <if test="picName != null" >
        pic_name = #{picName,jdbcType=VARCHAR},
      </if>
      <if test="videoName != null" >
        video_name = #{videoName,jdbcType=VARCHAR},
      </if>
      <if test="jsonData != null" >
        json_data = #{jsonData,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.viontech.fanxing.commons.model.FlowEvent" >
    update `d_flow_event`
    set unid = #{unid,jdbcType=VARCHAR},
      task_id = #{taskId,jdbcType=BIGINT},
      event_type = #{eventType,jdbcType=VARCHAR},
      event_time = #{eventTime,jdbcType=TIMESTAMP},
      device_code = #{deviceCode,jdbcType=VARCHAR},
      device_name = #{deviceName,jdbcType=VARCHAR},
      location_code = #{locationCode,jdbcType=VARCHAR},
      location_name = #{locationName,jdbcType=VARCHAR},
      pic_name = #{picName,jdbcType=VARCHAR},
      video_name = #{videoName,jdbcType=VARCHAR},
      json_data = #{jsonData,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.viontech.fanxing.commons.model.FlowEvent" >
    update `d_flow_event`
    set unid = #{unid,jdbcType=VARCHAR},
      task_id = #{taskId,jdbcType=BIGINT},
      event_type = #{eventType,jdbcType=VARCHAR},
      event_time = #{eventTime,jdbcType=TIMESTAMP},
      device_code = #{deviceCode,jdbcType=VARCHAR},
      device_name = #{deviceName,jdbcType=VARCHAR},
      location_code = #{locationCode,jdbcType=VARCHAR},
      location_name = #{locationName,jdbcType=VARCHAR},
      pic_name = #{picName,jdbcType=VARCHAR},
      video_name = #{videoName,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>