<?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.yd.dal.mapper.sms.ShortMessageSendRecordMapper">
  <resultMap id="BaseResultMap" type="com.yd.dal.entity.sms.ShortMessageSendRecord">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="mobile_no" jdbcType="VARCHAR" property="mobileNo" />
    <result column="business_type" jdbcType="VARCHAR" property="businessType" />
    <result column="business_id" jdbcType="VARCHAR" property="businessId" />
    <result column="sms_type" jdbcType="VARCHAR" property="smsType" />
    <result column="sms_content" jdbcType="VARCHAR" property="smsContent" />
    <result column="verification_code" jdbcType="VARCHAR" property="verificationCode" />
    <result column="send_time" jdbcType="TIMESTAMP" property="sendTime" />
    <result column="expire_time" jdbcType="TIMESTAMP" property="expireTime" />
    <result column="send_status" jdbcType="VARCHAR" property="sendStatus" />
    <result column="return_message" jdbcType="VARCHAR" property="returnMessage" />
    <result column="request_id" jdbcType="VARCHAR" property="requestId" />
    <result column="biz_id" jdbcType="VARCHAR" property="bizId" />
    <result column="template_code" jdbcType="VARCHAR" property="templateCode" />
  </resultMap>
  <sql id="Base_Column_List">
    id, mobile_no, business_type, business_id, sms_type, sms_content, verification_code, 
    send_time, expire_time, send_status, return_message, request_id, biz_id, template_code
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from ag_sms_record
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from ag_sms_record
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.sms.ShortMessageSendRecord" useGeneratedKeys="true">
    insert into ag_sms_record (mobile_no, business_type, business_id, 
      sms_type, sms_content, verification_code, 
      send_time, expire_time, send_status, 
      return_message, request_id, biz_id, 
      template_code)
    values (#{mobileNo,jdbcType=VARCHAR}, #{businessType,jdbcType=VARCHAR}, #{businessId,jdbcType=VARCHAR}, 
      #{smsType,jdbcType=VARCHAR}, #{smsContent,jdbcType=VARCHAR}, #{verificationCode,jdbcType=VARCHAR}, 
      #{sendTime,jdbcType=TIMESTAMP}, #{expireTime,jdbcType=TIMESTAMP}, #{sendStatus,jdbcType=VARCHAR}, 
      #{returnMessage,jdbcType=VARCHAR}, #{requestId,jdbcType=VARCHAR}, #{bizId,jdbcType=VARCHAR}, 
      #{templateCode,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.sms.ShortMessageSendRecord" useGeneratedKeys="true">
    insert into ag_sms_record
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="mobileNo != null">
        mobile_no,
      </if>
      <if test="businessType != null">
        business_type,
      </if>
      <if test="businessId != null">
        business_id,
      </if>
      <if test="smsType != null">
        sms_type,
      </if>
      <if test="smsContent != null">
        sms_content,
      </if>
      <if test="verificationCode != null">
        verification_code,
      </if>
      <if test="sendTime != null">
        send_time,
      </if>
      <if test="expireTime != null">
        expire_time,
      </if>
      <if test="sendStatus != null">
        send_status,
      </if>
      <if test="returnMessage != null">
        return_message,
      </if>
      <if test="requestId != null">
        request_id,
      </if>
      <if test="bizId != null">
        biz_id,
      </if>
      <if test="templateCode != null">
        template_code,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="mobileNo != null">
        #{mobileNo,jdbcType=VARCHAR},
      </if>
      <if test="businessType != null">
        #{businessType,jdbcType=VARCHAR},
      </if>
      <if test="businessId != null">
        #{businessId,jdbcType=VARCHAR},
      </if>
      <if test="smsType != null">
        #{smsType,jdbcType=VARCHAR},
      </if>
      <if test="smsContent != null">
        #{smsContent,jdbcType=VARCHAR},
      </if>
      <if test="verificationCode != null">
        #{verificationCode,jdbcType=VARCHAR},
      </if>
      <if test="sendTime != null">
        #{sendTime,jdbcType=TIMESTAMP},
      </if>
      <if test="expireTime != null">
        #{expireTime,jdbcType=TIMESTAMP},
      </if>
      <if test="sendStatus != null">
        #{sendStatus,jdbcType=VARCHAR},
      </if>
      <if test="returnMessage != null">
        #{returnMessage,jdbcType=VARCHAR},
      </if>
      <if test="requestId != null">
        #{requestId,jdbcType=VARCHAR},
      </if>
      <if test="bizId != null">
        #{bizId,jdbcType=VARCHAR},
      </if>
      <if test="templateCode != null">
        #{templateCode,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.sms.ShortMessageSendRecord">
    update ag_sms_record
    <set>
      <if test="mobileNo != null">
        mobile_no = #{mobileNo,jdbcType=VARCHAR},
      </if>
      <if test="businessType != null">
        business_type = #{businessType,jdbcType=VARCHAR},
      </if>
      <if test="businessId != null">
        business_id = #{businessId,jdbcType=VARCHAR},
      </if>
      <if test="smsType != null">
        sms_type = #{smsType,jdbcType=VARCHAR},
      </if>
      <if test="smsContent != null">
        sms_content = #{smsContent,jdbcType=VARCHAR},
      </if>
      <if test="verificationCode != null">
        verification_code = #{verificationCode,jdbcType=VARCHAR},
      </if>
      <if test="sendTime != null">
        send_time = #{sendTime,jdbcType=TIMESTAMP},
      </if>
      <if test="expireTime != null">
        expire_time = #{expireTime,jdbcType=TIMESTAMP},
      </if>
      <if test="sendStatus != null">
        send_status = #{sendStatus,jdbcType=VARCHAR},
      </if>
      <if test="returnMessage != null">
        return_message = #{returnMessage,jdbcType=VARCHAR},
      </if>
      <if test="requestId != null">
        request_id = #{requestId,jdbcType=VARCHAR},
      </if>
      <if test="bizId != null">
        biz_id = #{bizId,jdbcType=VARCHAR},
      </if>
      <if test="templateCode != null">
        template_code = #{templateCode,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.sms.ShortMessageSendRecord">
    update ag_sms_record
    set mobile_no = #{mobileNo,jdbcType=VARCHAR},
      business_type = #{businessType,jdbcType=VARCHAR},
      business_id = #{businessId,jdbcType=VARCHAR},
      sms_type = #{smsType,jdbcType=VARCHAR},
      sms_content = #{smsContent,jdbcType=VARCHAR},
      verification_code = #{verificationCode,jdbcType=VARCHAR},
      send_time = #{sendTime,jdbcType=TIMESTAMP},
      expire_time = #{expireTime,jdbcType=TIMESTAMP},
      send_status = #{sendStatus,jdbcType=VARCHAR},
      return_message = #{returnMessage,jdbcType=VARCHAR},
      request_id = #{requestId,jdbcType=VARCHAR},
      biz_id = #{bizId,jdbcType=VARCHAR},
      template_code = #{templateCode,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>