<?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.xhpc.activity.mapper.XhpcWorkOrderPushMessageMapper">
  <resultMap id="BaseResultMap" type="com.xhpc.activity.domain.XhpcWorkOrderPushMessageDomain">
    <id column="order_push_id" jdbcType="BIGINT" property="orderPushId" />
    <result column="target" jdbcType="VARCHAR" property="target" />
    <result column="type" jdbcType="SMALLINT" property="type" />
    <result column="content" jdbcType="VARCHAR" property="content" />
    <result column="status" jdbcType="SMALLINT" property="status" />
    <result column="fail_msg" jdbcType="VARCHAR" property="failMsg" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_by" jdbcType="VARCHAR" property="createBy" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
  </resultMap>
  <sql id="Base_Column_List">
    order_push_id, target, `type`, content, `status`, fail_msg, remark, create_time, 
    create_by, update_time, update_by
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from xhpc_work_order_push_message
    where order_push_id = #{orderPushId,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from xhpc_work_order_push_message
    where order_push_id = #{orderPushId,jdbcType=BIGINT}
  </delete>
  <insert id="insert" keyColumn="order_push_id" keyProperty="orderPushId" parameterType="com.xhpc.activity.domain.XhpcWorkOrderPushMessageDomain" useGeneratedKeys="true">
    insert into xhpc_work_order_push_message (target, `type`, content, 
      `status`, fail_msg, remark, 
      create_time, create_by, update_time, 
      update_by)
    values (#{target,jdbcType=VARCHAR}, #{type,jdbcType=SMALLINT}, #{content,jdbcType=VARCHAR}, 
      0, #{failMsg,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
      sysdate(), #{createBy,jdbcType=VARCHAR}, sysdate(),
      #{updateBy,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" keyColumn="order_push_id" keyProperty="orderPushId" parameterType="com.xhpc.activity.domain.XhpcWorkOrderPushMessageDomain" useGeneratedKeys="true">
    insert into xhpc_work_order_push_message
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="target != null">
        target,
      </if>
      <if test="type != null">
        `type`,
      </if>
      <if test="content != null">
        content,
      </if>
        `status`,
      <if test="failMsg != null">
        fail_msg,
      </if>
      <if test="remark != null">
        remark,
      </if>
        create_time,
      <if test="createBy != null">
        create_by,
      </if>
        update_time,
      <if test="updateBy != null">
        update_by,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="target != null">
        #{target,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        #{type,jdbcType=SMALLINT},
      </if>
      <if test="content != null">
        #{content,jdbcType=VARCHAR},
      </if>
        0,
      <if test="failMsg != null">
        #{failMsg,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
        sysdate(),
      <if test="createBy != null">
        #{createBy,jdbcType=VARCHAR},
      </if>
        sysdate(),
      <if test="updateBy != null">
        #{updateBy,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.xhpc.activity.domain.XhpcWorkOrderPushMessageDomain">
    update xhpc_work_order_push_message
    <set>
      <if test="target != null">
        target = #{target,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        `type` = #{type,jdbcType=SMALLINT},
      </if>
      <if test="content != null">
        content = #{content,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        `status` = #{status,jdbcType=SMALLINT},
      </if>
      <if test="failMsg != null">
        fail_msg = #{failMsg,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
        update_time = sysdate(),
      <if test="updateBy != null">
        update_by = #{updateBy,jdbcType=VARCHAR},
      </if>
    </set>
    where order_push_id = #{orderPushId,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.xhpc.activity.domain.XhpcWorkOrderPushMessageDomain">
    update xhpc_work_order_push_message
    set target = #{target,jdbcType=VARCHAR},
      `type` = #{type,jdbcType=SMALLINT},
      content = #{content,jdbcType=VARCHAR},
      `status` = #{status,jdbcType=SMALLINT},
      fail_msg = #{failMsg,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR},
      update_time =sysdate(),
      update_by = #{updateBy,jdbcType=VARCHAR}
    where order_push_id = #{orderPushId,jdbcType=BIGINT}
  </update>
</mapper>