messageheadMapper.xml 6.0 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.sy.mapper.messageheadMapper">
  <resultMap id="BaseResultMap" type="com.sy.model.messagehead">
    <id column="MESSAGEID" jdbcType="VARCHAR" property="messageid" />
    <result column="MESSAGETYPE" jdbcType="VARCHAR" property="messagetype" />
    <result column="MESSAGETIME" jdbcType="TIMESTAMP" property="messagetime" />
    <result column="SENDERID" jdbcType="VARCHAR" property="senderid" />
    <result column="SENDERADDRESS" jdbcType="VARCHAR" property="senderaddress" />
    <result column="RECEIVERID" jdbcType="VARCHAR" property="receiverid" />
    <result column="RECEIVERADDRESS" jdbcType="VARCHAR" property="receiveraddress" />
    <result column="PLATFORMNO" jdbcType="VARCHAR" property="platformno" />
    <result column="CUSTOMCODE" jdbcType="VARCHAR" property="customcode" />
    <result column="SEQNO" jdbcType="VARCHAR" property="seqno" />
    <result column="NOTE" jdbcType="VARCHAR" property="note" />
  </resultMap>
  <sql id="Base_Column_List">
    MESSAGEID, MESSAGETYPE, MESSAGETIME, SENDERID, SENDERADDRESS, RECEIVERID, RECEIVERADDRESS, 
    PLATFORMNO, CUSTOMCODE, SEQNO, NOTE
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from messagehead
    where MESSAGEID = #{messageid,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from messagehead
    where MESSAGEID = #{messageid,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.sy.model.messagehead">
    insert into messagehead (MESSAGEID, MESSAGETYPE, MESSAGETIME, 
      SENDERID, SENDERADDRESS, RECEIVERID, 
      RECEIVERADDRESS, PLATFORMNO, CUSTOMCODE, 
      SEQNO, NOTE)
    values (#{messageid,jdbcType=VARCHAR}, #{messagetype,jdbcType=VARCHAR}, #{messagetime,jdbcType=TIMESTAMP}, 
      #{senderid,jdbcType=VARCHAR}, #{senderaddress,jdbcType=VARCHAR}, #{receiverid,jdbcType=VARCHAR}, 
      #{receiveraddress,jdbcType=VARCHAR}, #{platformno,jdbcType=VARCHAR}, #{customcode,jdbcType=VARCHAR}, 
      #{seqno,jdbcType=VARCHAR}, #{note,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.sy.model.messagehead">
    insert into messagehead
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="messageid != null">
        MESSAGEID,
      </if>
      <if test="messagetype != null">
        MESSAGETYPE,
      </if>
      <if test="messagetime != null">
        MESSAGETIME,
      </if>
      <if test="senderid != null">
        SENDERID,
      </if>
      <if test="senderaddress != null">
        SENDERADDRESS,
      </if>
      <if test="receiverid != null">
        RECEIVERID,
      </if>
      <if test="receiveraddress != null">
        RECEIVERADDRESS,
      </if>
      <if test="platformno != null">
        PLATFORMNO,
      </if>
      <if test="customcode != null">
        CUSTOMCODE,
      </if>
      <if test="seqno != null">
        SEQNO,
      </if>
      <if test="note != null">
        NOTE,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="messageid != null">
        #{messageid,jdbcType=VARCHAR},
      </if>
      <if test="messagetype != null">
        #{messagetype,jdbcType=VARCHAR},
      </if>
      <if test="messagetime != null">
        #{messagetime,jdbcType=TIMESTAMP},
      </if>
      <if test="senderid != null">
        #{senderid,jdbcType=VARCHAR},
      </if>
      <if test="senderaddress != null">
        #{senderaddress,jdbcType=VARCHAR},
      </if>
      <if test="receiverid != null">
        #{receiverid,jdbcType=VARCHAR},
      </if>
      <if test="receiveraddress != null">
        #{receiveraddress,jdbcType=VARCHAR},
      </if>
      <if test="platformno != null">
        #{platformno,jdbcType=VARCHAR},
      </if>
      <if test="customcode != null">
        #{customcode,jdbcType=VARCHAR},
      </if>
      <if test="seqno != null">
        #{seqno,jdbcType=VARCHAR},
      </if>
      <if test="note != null">
        #{note,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.sy.model.messagehead">
    update messagehead
    <set>
      <if test="messagetype != null">
        MESSAGETYPE = #{messagetype,jdbcType=VARCHAR},
      </if>
      <if test="messagetime != null">
        MESSAGETIME = #{messagetime,jdbcType=TIMESTAMP},
      </if>
      <if test="senderid != null">
        SENDERID = #{senderid,jdbcType=VARCHAR},
      </if>
      <if test="senderaddress != null">
        SENDERADDRESS = #{senderaddress,jdbcType=VARCHAR},
      </if>
      <if test="receiverid != null">
        RECEIVERID = #{receiverid,jdbcType=VARCHAR},
      </if>
      <if test="receiveraddress != null">
        RECEIVERADDRESS = #{receiveraddress,jdbcType=VARCHAR},
      </if>
      <if test="platformno != null">
        PLATFORMNO = #{platformno,jdbcType=VARCHAR},
      </if>
      <if test="customcode != null">
        CUSTOMCODE = #{customcode,jdbcType=VARCHAR},
      </if>
      <if test="seqno != null">
        SEQNO = #{seqno,jdbcType=VARCHAR},
      </if>
      <if test="note != null">
        NOTE = #{note,jdbcType=VARCHAR},
      </if>
    </set>
    where MESSAGEID = #{messageid,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.sy.model.messagehead">
    update messagehead
    set MESSAGETYPE = #{messagetype,jdbcType=VARCHAR},
      MESSAGETIME = #{messagetime,jdbcType=TIMESTAMP},
      SENDERID = #{senderid,jdbcType=VARCHAR},
      SENDERADDRESS = #{senderaddress,jdbcType=VARCHAR},
      RECEIVERID = #{receiverid,jdbcType=VARCHAR},
      RECEIVERADDRESS = #{receiveraddress,jdbcType=VARCHAR},
      PLATFORMNO = #{platformno,jdbcType=VARCHAR},
      CUSTOMCODE = #{customcode,jdbcType=VARCHAR},
      SEQNO = #{seqno,jdbcType=VARCHAR},
      NOTE = #{note,jdbcType=VARCHAR}
    where MESSAGEID = #{messageid,jdbcType=VARCHAR}
  </update>
</mapper>