<?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.transaction.TransSendlistMapper">
  <resultMap id="BaseResultMap" type="com.yd.dal.entity.transaction.TransSendList">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="send_tag" jdbcType="VARCHAR" property="sendTag" />
    <result column="sender" jdbcType="VARCHAR" property="sender" />
    <result column="customer_id" jdbcType="BIGINT" property="customerId" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="mobile_no" jdbcType="VARCHAR" property="mobileNo" />
    <result column="use_for" jdbcType="INTEGER" property="useFor" />
    <result column="use_for_id" jdbcType="BIGINT" property="useForId" />
    <result column="sms_template_code" jdbcType="VARCHAR" property="smsTemplateCode" />
    <result column="subject" jdbcType="VARCHAR" property="subject" />
    <result column="content_summary" jdbcType="VARCHAR" property="contentSummary" />
    <result column="is_success" jdbcType="INTEGER" property="isSuccess" />
    <result column="fail_count" jdbcType="INTEGER" property="failCount" />
    <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
    <result column="created_by" jdbcType="BIGINT" property="createdBy" />
    <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
    <result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.yd.dal.entity.transaction.TransSendList">
    <result column="email_to" jdbcType="LONGVARCHAR" property="emailTo" />
    <result column="email_cc" jdbcType="LONGVARCHAR" property="emailCc" />
    <result column="email_bcc" jdbcType="LONGVARCHAR" property="emailBcc" />
    <result column="content" jdbcType="LONGVARCHAR" property="content" />
  </resultMap>
  <sql id="Base_Column_List">
    id, send_tag, sender, customer_id, `name`, mobile_no, use_for, use_for_id, sms_template_code, 
    subject, content_summary, is_success, fail_count, created_at, created_by, updated_at, 
    updated_by
  </sql>
  <sql id="Blob_Column_List">
    email_to, email_cc, email_bcc, content
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from ag_trans_sendlist
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from ag_trans_sendlist
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.transaction.TransSendList" useGeneratedKeys="true">
    insert into ag_trans_sendlist (send_tag, sender, customer_id, 
      `name`, mobile_no, use_for, 
      use_for_id, sms_template_code, subject, 
      content_summary, is_success, fail_count, 
      created_at, created_by, updated_at, 
      updated_by, email_to, email_cc, 
      email_bcc, content)
    values (#{sendTag,jdbcType=VARCHAR}, #{sender,jdbcType=VARCHAR}, #{customerId,jdbcType=BIGINT}, 
      #{name,jdbcType=VARCHAR}, #{mobileNo,jdbcType=VARCHAR}, #{useFor,jdbcType=INTEGER}, 
      #{useForId,jdbcType=BIGINT}, #{smsTemplateCode,jdbcType=VARCHAR}, #{subject,jdbcType=VARCHAR}, 
      #{contentSummary,jdbcType=VARCHAR}, #{isSuccess,jdbcType=INTEGER}, #{failCount,jdbcType=INTEGER}, 
      #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP}, 
      #{updatedBy,jdbcType=BIGINT}, #{emailTo,jdbcType=LONGVARCHAR}, #{emailCc,jdbcType=LONGVARCHAR}, 
      #{emailBcc,jdbcType=LONGVARCHAR}, #{content,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.transaction.TransSendList" useGeneratedKeys="true">
    insert into ag_trans_sendlist
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="sendTag != null">
        send_tag,
      </if>
      <if test="sender != null">
        sender,
      </if>
      <if test="customerId != null">
        customer_id,
      </if>
      <if test="name != null">
        `name`,
      </if>
      <if test="mobileNo != null">
        mobile_no,
      </if>
      <if test="useFor != null">
        use_for,
      </if>
      <if test="useForId != null">
        use_for_id,
      </if>
      <if test="smsTemplateCode != null">
        sms_template_code,
      </if>
      <if test="subject != null">
        subject,
      </if>
      <if test="contentSummary != null">
        content_summary,
      </if>
      <if test="isSuccess != null">
        is_success,
      </if>
      <if test="failCount != null">
        fail_count,
      </if>
      <if test="createdAt != null">
        created_at,
      </if>
      <if test="createdBy != null">
        created_by,
      </if>
      <if test="updatedAt != null">
        updated_at,
      </if>
      <if test="updatedBy != null">
        updated_by,
      </if>
      <if test="emailTo != null">
        email_to,
      </if>
      <if test="emailCc != null">
        email_cc,
      </if>
      <if test="emailBcc != null">
        email_bcc,
      </if>
      <if test="content != null">
        content,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="sendTag != null">
        #{sendTag,jdbcType=VARCHAR},
      </if>
      <if test="sender != null">
        #{sender,jdbcType=VARCHAR},
      </if>
      <if test="customerId != null">
        #{customerId,jdbcType=BIGINT},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="mobileNo != null">
        #{mobileNo,jdbcType=VARCHAR},
      </if>
      <if test="useFor != null">
        #{useFor,jdbcType=INTEGER},
      </if>
      <if test="useForId != null">
        #{useForId,jdbcType=BIGINT},
      </if>
      <if test="smsTemplateCode != null">
        #{smsTemplateCode,jdbcType=VARCHAR},
      </if>
      <if test="subject != null">
        #{subject,jdbcType=VARCHAR},
      </if>
      <if test="contentSummary != null">
        #{contentSummary,jdbcType=VARCHAR},
      </if>
      <if test="isSuccess != null">
        #{isSuccess,jdbcType=INTEGER},
      </if>
      <if test="failCount != null">
        #{failCount,jdbcType=INTEGER},
      </if>
      <if test="createdAt != null">
        #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="createdBy != null">
        #{createdBy,jdbcType=BIGINT},
      </if>
      <if test="updatedAt != null">
        #{updatedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="updatedBy != null">
        #{updatedBy,jdbcType=BIGINT},
      </if>
      <if test="emailTo != null">
        #{emailTo,jdbcType=LONGVARCHAR},
      </if>
      <if test="emailCc != null">
        #{emailCc,jdbcType=LONGVARCHAR},
      </if>
      <if test="emailBcc != null">
        #{emailBcc,jdbcType=LONGVARCHAR},
      </if>
      <if test="content != null">
        #{content,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.transaction.TransSendList">
    update ag_trans_sendlist
    <set>
      <if test="sendTag != null">
        send_tag = #{sendTag,jdbcType=VARCHAR},
      </if>
      <if test="sender != null">
        sender = #{sender,jdbcType=VARCHAR},
      </if>
      <if test="customerId != null">
        customer_id = #{customerId,jdbcType=BIGINT},
      </if>
      <if test="name != null">
        `name` = #{name,jdbcType=VARCHAR},
      </if>
      <if test="mobileNo != null">
        mobile_no = #{mobileNo,jdbcType=VARCHAR},
      </if>
      <if test="useFor != null">
        use_for = #{useFor,jdbcType=INTEGER},
      </if>
      <if test="useForId != null">
        use_for_id = #{useForId,jdbcType=BIGINT},
      </if>
      <if test="smsTemplateCode != null">
        sms_template_code = #{smsTemplateCode,jdbcType=VARCHAR},
      </if>
      <if test="subject != null">
        subject = #{subject,jdbcType=VARCHAR},
      </if>
      <if test="contentSummary != null">
        content_summary = #{contentSummary,jdbcType=VARCHAR},
      </if>
      <if test="isSuccess != null">
        is_success = #{isSuccess,jdbcType=INTEGER},
      </if>
      <if test="failCount != null">
        fail_count = #{failCount,jdbcType=INTEGER},
      </if>
      <if test="createdAt != null">
        created_at = #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="createdBy != null">
        created_by = #{createdBy,jdbcType=BIGINT},
      </if>
      <if test="updatedAt != null">
        updated_at = #{updatedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="updatedBy != null">
        updated_by = #{updatedBy,jdbcType=BIGINT},
      </if>
      <if test="emailTo != null">
        email_to = #{emailTo,jdbcType=LONGVARCHAR},
      </if>
      <if test="emailCc != null">
        email_cc = #{emailCc,jdbcType=LONGVARCHAR},
      </if>
      <if test="emailBcc != null">
        email_bcc = #{emailBcc,jdbcType=LONGVARCHAR},
      </if>
      <if test="content != null">
        content = #{content,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.yd.dal.entity.transaction.TransSendList">
    update ag_trans_sendlist
    set send_tag = #{sendTag,jdbcType=VARCHAR},
      sender = #{sender,jdbcType=VARCHAR},
      customer_id = #{customerId,jdbcType=BIGINT},
      `name` = #{name,jdbcType=VARCHAR},
      mobile_no = #{mobileNo,jdbcType=VARCHAR},
      use_for = #{useFor,jdbcType=INTEGER},
      use_for_id = #{useForId,jdbcType=BIGINT},
      sms_template_code = #{smsTemplateCode,jdbcType=VARCHAR},
      subject = #{subject,jdbcType=VARCHAR},
      content_summary = #{contentSummary,jdbcType=VARCHAR},
      is_success = #{isSuccess,jdbcType=INTEGER},
      fail_count = #{failCount,jdbcType=INTEGER},
      created_at = #{createdAt,jdbcType=TIMESTAMP},
      created_by = #{createdBy,jdbcType=BIGINT},
      updated_at = #{updatedAt,jdbcType=TIMESTAMP},
      updated_by = #{updatedBy,jdbcType=BIGINT},
      email_to = #{emailTo,jdbcType=LONGVARCHAR},
      email_cc = #{emailCc,jdbcType=LONGVARCHAR},
      email_bcc = #{emailBcc,jdbcType=LONGVARCHAR},
      content = #{content,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.transaction.TransSendList">
    update ag_trans_sendlist
    set send_tag = #{sendTag,jdbcType=VARCHAR},
      sender = #{sender,jdbcType=VARCHAR},
      customer_id = #{customerId,jdbcType=BIGINT},
      `name` = #{name,jdbcType=VARCHAR},
      mobile_no = #{mobileNo,jdbcType=VARCHAR},
      use_for = #{useFor,jdbcType=INTEGER},
      use_for_id = #{useForId,jdbcType=BIGINT},
      sms_template_code = #{smsTemplateCode,jdbcType=VARCHAR},
      subject = #{subject,jdbcType=VARCHAR},
      content_summary = #{contentSummary,jdbcType=VARCHAR},
      is_success = #{isSuccess,jdbcType=INTEGER},
      fail_count = #{failCount,jdbcType=INTEGER},
      created_at = #{createdAt,jdbcType=TIMESTAMP},
      created_by = #{createdBy,jdbcType=BIGINT},
      updated_at = #{updatedAt,jdbcType=TIMESTAMP},
      updated_by = #{updatedBy,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>