TpPEqpLogMapper.xml 14.6 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.zteits.park.mapper.TpPEqpLogMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.TpPEqpLog">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="eqp_no" jdbcType="VARCHAR" property="eqpNo" />
    <result column="berth_no" jdbcType="VARCHAR" property="berthNo" />
    <result column="event_type" jdbcType="VARCHAR" property="eventType" />
    <result column="factory_no" jdbcType="VARCHAR" property="factoryNo" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_op" jdbcType="BIGINT" property="createOp" />
    <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
    <result column="modify_op" jdbcType="BIGINT" property="modifyOp" />
    <result column="berth_state" jdbcType="CHAR" property="berthState" />
    <result column="electricity" jdbcType="VARCHAR" property="electricity" />
    <result column="voltag" jdbcType="VARCHAR" property="voltag" />
    <result column="eqp_type" jdbcType="INTEGER" property="eqpType" />
    <result column="eqp_is_online" jdbcType="CHAR" property="eqpIsOnline" />
  </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, pl_no, eqp_no, berth_no, event_type, factory_no, remark, data_state, create_time, 
    create_op, modify_time, modify_op, berth_state, electricity, voltag, eqp_type, eqp_is_online
  </sql>
  <select id="selectByExample" parameterType="com.zteits.park.domain.TpPEqpLogExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from tp_p_eqp_log
    <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.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tp_p_eqp_log
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from tp_p_eqp_log
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.park.domain.TpPEqpLogExample">
    delete from tp_p_eqp_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.park.domain.TpPEqpLog">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into tp_p_eqp_log (pl_no, eqp_no, berth_no, 
      event_type, factory_no, remark, 
      data_state, create_time, create_op, 
      modify_time, modify_op, berth_state, 
      electricity, voltag, eqp_type, 
      eqp_is_online)
    values (#{plNo,jdbcType=VARCHAR}, #{eqpNo,jdbcType=VARCHAR}, #{berthNo,jdbcType=VARCHAR}, 
      #{eventType,jdbcType=VARCHAR}, #{factoryNo,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, 
      #{dataState,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{createOp,jdbcType=BIGINT}, 
      #{modifyTime,jdbcType=TIMESTAMP}, #{modifyOp,jdbcType=BIGINT}, #{berthState,jdbcType=CHAR}, 
      #{electricity,jdbcType=VARCHAR}, #{voltag,jdbcType=VARCHAR}, #{eqpType,jdbcType=INTEGER}, 
      #{eqpIsOnline,jdbcType=CHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.park.domain.TpPEqpLog">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into tp_p_eqp_log
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="plNo != null">
        pl_no,
      </if>
      <if test="eqpNo != null">
        eqp_no,
      </if>
      <if test="berthNo != null">
        berth_no,
      </if>
      <if test="eventType != null">
        event_type,
      </if>
      <if test="factoryNo != null">
        factory_no,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="dataState != null">
        data_state,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="createOp != null">
        create_op,
      </if>
      <if test="modifyTime != null">
        modify_time,
      </if>
      <if test="modifyOp != null">
        modify_op,
      </if>
      <if test="berthState != null">
        berth_state,
      </if>
      <if test="electricity != null">
        electricity,
      </if>
      <if test="voltag != null">
        voltag,
      </if>
      <if test="eqpType != null">
        eqp_type,
      </if>
      <if test="eqpIsOnline != null">
        eqp_is_online,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="plNo != null">
        #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="eqpNo != null">
        #{eqpNo,jdbcType=VARCHAR},
      </if>
      <if test="berthNo != null">
        #{berthNo,jdbcType=VARCHAR},
      </if>
      <if test="eventType != null">
        #{eventType,jdbcType=VARCHAR},
      </if>
      <if test="factoryNo != null">
        #{factoryNo,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="dataState != null">
        #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createOp != null">
        #{createOp,jdbcType=BIGINT},
      </if>
      <if test="modifyTime != null">
        #{modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyOp != null">
        #{modifyOp,jdbcType=BIGINT},
      </if>
      <if test="berthState != null">
        #{berthState,jdbcType=CHAR},
      </if>
      <if test="electricity != null">
        #{electricity,jdbcType=VARCHAR},
      </if>
      <if test="voltag != null">
        #{voltag,jdbcType=VARCHAR},
      </if>
      <if test="eqpType != null">
        #{eqpType,jdbcType=INTEGER},
      </if>
      <if test="eqpIsOnline != null">
        #{eqpIsOnline,jdbcType=CHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.park.domain.TpPEqpLogExample" resultType="java.lang.Long">
    select count(*) from tp_p_eqp_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update tp_p_eqp_log
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.plNo != null">
        pl_no = #{record.plNo,jdbcType=VARCHAR},
      </if>
      <if test="record.eqpNo != null">
        eqp_no = #{record.eqpNo,jdbcType=VARCHAR},
      </if>
      <if test="record.berthNo != null">
        berth_no = #{record.berthNo,jdbcType=VARCHAR},
      </if>
      <if test="record.eventType != null">
        event_type = #{record.eventType,jdbcType=VARCHAR},
      </if>
      <if test="record.factoryNo != null">
        factory_no = #{record.factoryNo,jdbcType=VARCHAR},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
      <if test="record.dataState != null">
        data_state = #{record.dataState,jdbcType=INTEGER},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createOp != null">
        create_op = #{record.createOp,jdbcType=BIGINT},
      </if>
      <if test="record.modifyTime != null">
        modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.modifyOp != null">
        modify_op = #{record.modifyOp,jdbcType=BIGINT},
      </if>
      <if test="record.berthState != null">
        berth_state = #{record.berthState,jdbcType=CHAR},
      </if>
      <if test="record.electricity != null">
        electricity = #{record.electricity,jdbcType=VARCHAR},
      </if>
      <if test="record.voltag != null">
        voltag = #{record.voltag,jdbcType=VARCHAR},
      </if>
      <if test="record.eqpType != null">
        eqp_type = #{record.eqpType,jdbcType=INTEGER},
      </if>
      <if test="record.eqpIsOnline != null">
        eqp_is_online = #{record.eqpIsOnline,jdbcType=CHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update tp_p_eqp_log
    set id = #{record.id,jdbcType=BIGINT},
      pl_no = #{record.plNo,jdbcType=VARCHAR},
      eqp_no = #{record.eqpNo,jdbcType=VARCHAR},
      berth_no = #{record.berthNo,jdbcType=VARCHAR},
      event_type = #{record.eventType,jdbcType=VARCHAR},
      factory_no = #{record.factoryNo,jdbcType=VARCHAR},
      remark = #{record.remark,jdbcType=VARCHAR},
      data_state = #{record.dataState,jdbcType=INTEGER},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      create_op = #{record.createOp,jdbcType=BIGINT},
      modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
      modify_op = #{record.modifyOp,jdbcType=BIGINT},
      berth_state = #{record.berthState,jdbcType=CHAR},
      electricity = #{record.electricity,jdbcType=VARCHAR},
      voltag = #{record.voltag,jdbcType=VARCHAR},
      eqp_type = #{record.eqpType,jdbcType=INTEGER},
      eqp_is_online = #{record.eqpIsOnline,jdbcType=CHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.park.domain.TpPEqpLog">
    update tp_p_eqp_log
    <set>
      <if test="plNo != null">
        pl_no = #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="eqpNo != null">
        eqp_no = #{eqpNo,jdbcType=VARCHAR},
      </if>
      <if test="berthNo != null">
        berth_no = #{berthNo,jdbcType=VARCHAR},
      </if>
      <if test="eventType != null">
        event_type = #{eventType,jdbcType=VARCHAR},
      </if>
      <if test="factoryNo != null">
        factory_no = #{factoryNo,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="dataState != null">
        data_state = #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createOp != null">
        create_op = #{createOp,jdbcType=BIGINT},
      </if>
      <if test="modifyTime != null">
        modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyOp != null">
        modify_op = #{modifyOp,jdbcType=BIGINT},
      </if>
      <if test="berthState != null">
        berth_state = #{berthState,jdbcType=CHAR},
      </if>
      <if test="electricity != null">
        electricity = #{electricity,jdbcType=VARCHAR},
      </if>
      <if test="voltag != null">
        voltag = #{voltag,jdbcType=VARCHAR},
      </if>
      <if test="eqpType != null">
        eqp_type = #{eqpType,jdbcType=INTEGER},
      </if>
      <if test="eqpIsOnline != null">
        eqp_is_online = #{eqpIsOnline,jdbcType=CHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.park.domain.TpPEqpLog">
    update tp_p_eqp_log
    set pl_no = #{plNo,jdbcType=VARCHAR},
      eqp_no = #{eqpNo,jdbcType=VARCHAR},
      berth_no = #{berthNo,jdbcType=VARCHAR},
      event_type = #{eventType,jdbcType=VARCHAR},
      factory_no = #{factoryNo,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR},
      data_state = #{dataState,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_op = #{createOp,jdbcType=BIGINT},
      modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      modify_op = #{modifyOp,jdbcType=BIGINT},
      berth_state = #{berthState,jdbcType=CHAR},
      electricity = #{electricity,jdbcType=VARCHAR},
      voltag = #{voltag,jdbcType=VARCHAR},
      eqp_type = #{eqpType,jdbcType=INTEGER},
      eqp_is_online = #{eqpIsOnline,jdbcType=CHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>