<?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.usoft.fin.grpc.dal.mapper.MessagesMapper">
  <resultMap id="BaseResultMap" type="com.usoft.fin.grpc.dal.entity.Messages">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="ms_code" jdbcType="VARCHAR" property="msCode" />
    <result column="ms_content" jdbcType="VARCHAR" property="msContent" />
    <result column="ms_isread" jdbcType="SMALLINT" property="msIsread" />
    <result column="ms_receiverenuu" jdbcType="BIGINT" property="msReceiverenuu" />
    <result column="ms_type" jdbcType="VARCHAR" property="msType" />
    <result column="ms_remark" jdbcType="VARCHAR" property="msRemark" />
    <result column="ms_create_time" jdbcType="VARCHAR" property="msCreateTime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, ms_code, ms_content, ms_isread, ms_receiverenuu, ms_type, ms_remark, ms_create_time
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from t_messages
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from t_messages
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.usoft.fin.grpc.dal.entity.Messages">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_messages (ms_code, ms_content, ms_isread,
    ms_receiverenuu, ms_type, ms_remark,
    ms_create_time)
    values (#{msCode,jdbcType=VARCHAR}, #{msContent,jdbcType=VARCHAR}, #{msIsread,jdbcType=SMALLINT},
    #{msReceiverenuu,jdbcType=BIGINT}, #{msType,jdbcType=VARCHAR}, #{msRemark,jdbcType=VARCHAR},
    #{msCreateTime,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.usoft.fin.grpc.dal.entity.Messages">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_messages
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="msCode != null">
        ms_code,
      </if>
      <if test="msContent != null">
        ms_content,
      </if>
      <if test="msIsread != null">
        ms_isread,
      </if>
      <if test="msReceiverenuu != null">
        ms_receiverenuu,
      </if>
      <if test="msType != null">
        ms_type,
      </if>
      <if test="msRemark != null">
        ms_remark,
      </if>
      <if test="msCreateTime != null">
        ms_create_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="msCode != null">
        #{msCode,jdbcType=VARCHAR},
      </if>
      <if test="msContent != null">
        #{msContent,jdbcType=VARCHAR},
      </if>
      <if test="msIsread != null">
        #{msIsread,jdbcType=SMALLINT},
      </if>
      <if test="msReceiverenuu != null">
        #{msReceiverenuu,jdbcType=BIGINT},
      </if>
      <if test="msType != null">
        #{msType,jdbcType=VARCHAR},
      </if>
      <if test="msRemark != null">
        #{msRemark,jdbcType=VARCHAR},
      </if>
      <if test="msCreateTime != null">
        #{msCreateTime,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.usoft.fin.grpc.dal.entity.Messages">
    update t_messages
    <set>
      <if test="msCode != null">
        ms_code = #{msCode,jdbcType=VARCHAR},
      </if>
      <if test="msContent != null">
        ms_content = #{msContent,jdbcType=VARCHAR},
      </if>
      <if test="msIsread != null">
        ms_isread = #{msIsread,jdbcType=SMALLINT},
      </if>
      <if test="msReceiverenuu != null">
        ms_receiverenuu = #{msReceiverenuu,jdbcType=BIGINT},
      </if>
      <if test="msType != null">
        ms_type = #{msType,jdbcType=VARCHAR},
      </if>
      <if test="msRemark != null">
        ms_remark = #{msRemark,jdbcType=VARCHAR},
      </if>
      <if test="msCreateTime != null">
        ms_create_time = #{msCreateTime,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.usoft.fin.grpc.dal.entity.Messages">
    update t_messages
    set ms_code = #{msCode,jdbcType=VARCHAR},
    ms_content = #{msContent,jdbcType=VARCHAR},
    ms_isread = #{msIsread,jdbcType=SMALLINT},
    ms_receiverenuu = #{msReceiverenuu,jdbcType=BIGINT},
    ms_type = #{msType,jdbcType=VARCHAR},
    ms_remark = #{msRemark,jdbcType=VARCHAR},
    ms_create_time = #{msCreateTime,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <sql id="Table_Base_Column_List">
    t_messages.id, t_messages.ms_code, t_messages.ms_content, t_messages.ms_isread, t_messages.ms_receiverenuu,
    t_messages.ms_type, t_messages.ms_remark, t_messages.ms_create_time
  </sql>
</mapper>