CustomerBehaveMapper.xml 2.27 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="cn.runsa.crmapp.common.mapper.CustomerBehaveMapper" >
  <resultMap id="BaseResultMap" type="cn.runsa.crmapp.common.entity.CustomerBehave" >
    <result column="appCustId" property="appcustid" jdbcType="VARCHAR" />
    <result column="actTime" property="acttime" jdbcType="VARCHAR" />
    <result column="actType" property="acttype" jdbcType="VARCHAR" />
    <result column="orderId" property="orderid" jdbcType="VARCHAR" />
  </resultMap>
  <resultMap id="ResultMapWithBLOBs" type="cn.runsa.crmapp.common.entity.CustomerBehave" extends="BaseResultMap" >
    <result column="extra" property="extra" jdbcType="LONGVARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    appCustId, actTime, actType, orderId
  </sql>
  <sql id="Blob_Column_List" >
    extra
  </sql>
  <insert id="insert" parameterType="cn.runsa.crmapp.common.entity.CustomerBehave" >
    insert into crm_customer_behave (appCustId, actTime, actType, 
      orderId, extra)
    values (#{appcustid,jdbcType=VARCHAR}, #{acttime,jdbcType=VARCHAR}, #{acttype,jdbcType=VARCHAR}, 
      #{orderid,jdbcType=VARCHAR}, #{extra,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="cn.runsa.crmapp.common.entity.CustomerBehave" >
    insert into crm_customer_behave
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="appcustid != null" >
        appCustId,
      </if>
      <if test="acttime != null" >
        actTime,
      </if>
      <if test="acttype != null" >
        actType,
      </if>
      <if test="orderid != null" >
        orderId,
      </if>
      <if test="extra != null" >
        extra,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="appcustid != null" >
        #{appcustid,jdbcType=VARCHAR},
      </if>
      <if test="acttime != null" >
        #{acttime,jdbcType=VARCHAR},
      </if>
      <if test="acttype != null" >
        #{acttype,jdbcType=VARCHAR},
      </if>
      <if test="orderid != null" >
        #{orderid,jdbcType=VARCHAR},
      </if>
      <if test="extra != null" >
        #{extra,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
</mapper>