<?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.ssm.mapper.business.SmsUpMessageMapper" >
  <resultMap id="BaseResultMap" type="com.ssm.model.business.SmsUpMessage" >
    <id column="id" property="id" jdbcType="INTEGER" />
  </resultMap>
  <resultMap id="ResultMapWithBLOBs" type="com.ssm.model.business.SmsUpMessage" extends="BaseResultMap" >
    <result column="date_time" property="dateTime" jdbcType="VARCHAR" />
    <result column="phoen" property="phoen" jdbcType="VARCHAR" />
    <result column="up_gallery" property="upGallery" jdbcType="VARCHAR" />
    <result column="up_gallery_child" property="upGalleryChild" jdbcType="VARCHAR" />
    <result column="content" property="content" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id
  </sql>
  <sql id="Blob_Column_List" >
    date_time, phoen, up_gallery, up_gallery_child, content
  </sql>
  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from sms_up_message
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from sms_up_message
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.ssm.model.business.SmsUpMessage" >
    insert into sms_up_message (id, date_time, phoen, 
      up_gallery, up_gallery_child, content
      )
    values (#{id,jdbcType=INTEGER}, #{dateTime,jdbcType=VARCHAR}, #{phoen,jdbcType=VARCHAR}, 
      #{upGallery,jdbcType=VARCHAR}, #{upGalleryChild,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.ssm.model.business.SmsUpMessage" >
    insert into sms_up_message
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="dateTime != null" >
        date_time,
      </if>
      <if test="phoen != null" >
        phoen,
      </if>
      <if test="upGallery != null" >
        up_gallery,
      </if>
      <if test="upGalleryChild != null" >
        up_gallery_child,
      </if>
      <if test="content != null" >
        content,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=INTEGER},
      </if>
      <if test="dateTime != null" >
        #{dateTime,jdbcType=VARCHAR},
      </if>
      <if test="phoen != null" >
        #{phoen,jdbcType=VARCHAR},
      </if>
      <if test="upGallery != null" >
        #{upGallery,jdbcType=VARCHAR},
      </if>
      <if test="upGalleryChild != null" >
        #{upGalleryChild,jdbcType=VARCHAR},
      </if>
      <if test="content != null" >
        #{content,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.ssm.model.business.SmsUpMessage" >
    update sms_up_message
    <set >
      <if test="dateTime != null" >
        date_time = #{dateTime,jdbcType=VARCHAR},
      </if>
      <if test="phoen != null" >
        phoen = #{phoen,jdbcType=VARCHAR},
      </if>
      <if test="upGallery != null" >
        up_gallery = #{upGallery,jdbcType=VARCHAR},
      </if>
      <if test="upGalleryChild != null" >
        up_gallery_child = #{upGalleryChild,jdbcType=VARCHAR},
      </if>
      <if test="content != null" >
        content = #{content,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.ssm.model.business.SmsUpMessage" >
    update sms_up_message
    set date_time = #{dateTime,jdbcType=VARCHAR},
      phoen = #{phoen,jdbcType=VARCHAR},
      up_gallery = #{upGallery,jdbcType=VARCHAR},
      up_gallery_child = #{upGalleryChild,jdbcType=VARCHAR},
      content = #{content,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <select id="selectsmsUpMessage" resultMap="ResultMapWithBLOBs">
  	select * from sms_up_message s where 1=1 
  	<if test="smsUpMessage.phoen != null and smsUpMessage.phoen != ''" >
       AND s.phoen like  CONCAT('%',#{smsUpMessage.phoen,jdbcType=VARCHAR},'%')
      
    </if>
       order by s.date_time desc
  </select>
</mapper>