BusinessAlterLogDao.xml 4.3 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="com.tianbo.analysis.dao.BusinessAlterLogDao">
  <resultMap id="BaseResultMap" type="com.tianbo.analysis.model.BusinessAlterLog">
    <result column="AUTOID" jdbcType="VARCHAR" property="autoid" />
    <result column="CREATEDATE" jdbcType="TIMESTAMP" property="createdate" />
    <result column="BUSINESSTYPE" jdbcType="VARCHAR" property="businesstype" />
    <result column="ALTER_REASON" jdbcType="VARCHAR" property="alterReason" />
    <result column="CONTANTNAME" jdbcType="VARCHAR" property="contantname" />
    <result column="CONTENTTEL" jdbcType="VARCHAR" property="contenttel" />
    <result column="BILL_AUOTID" jdbcType="VARCHAR" property="billAuotid" />
  </resultMap>
  <sql id="Base_Column_List">
    AUTOID, CREATEDATE, BUSINESSTYPE, ALTER_REASON, CONTANTNAME, CONTENTTEL, BILL_AUOTID
  </sql>
  <insert id="insert" parameterType="com.tianbo.analysis.model.BusinessAlterLog">
    insert into BUSINESS_ALTER_LOG (AUTOID, CREATEDATE, BUSINESSTYPE,
      ALTER_REASON, CONTANTNAME, CONTENTTEL,
      BILL_AUOTID)
    values (#{autoid,jdbcType=VARCHAR}, #{createdate,jdbcType=TIMESTAMP}, #{businesstype,jdbcType=VARCHAR},
      #{alterReason,jdbcType=VARCHAR}, #{contantname,jdbcType=VARCHAR}, #{contenttel,jdbcType=VARCHAR},
      #{billAuotid,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.tianbo.analysis.model.BusinessAlterLog">
    insert into BUSINESS_ALTER_LOG
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="autoid != null">
        AUTOID,
      </if>
      <if test="createdate != null">
        CREATEDATE,
      </if>
      <if test="businesstype != null">
        BUSINESSTYPE,
      </if>
      <if test="alterReason != null">
        ALTER_REASON,
      </if>
      <if test="contantname != null">
        CONTANTNAME,
      </if>
      <if test="contenttel != null">
        CONTENTTEL,
      </if>
      <if test="billAuotid != null">
        BILL_AUOTID,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="autoid != null">
        #{autoid,jdbcType=VARCHAR},
      </if>
      <if test="createdate != null">
        #{createdate,jdbcType=TIMESTAMP},
      </if>
      <if test="businesstype != null">
        #{businesstype,jdbcType=VARCHAR},
      </if>
      <if test="alterReason != null">
        #{alterReason,jdbcType=VARCHAR},
      </if>
      <if test="contantname != null">
        #{contantname,jdbcType=VARCHAR},
      </if>
      <if test="contenttel != null">
        #{contenttel,jdbcType=VARCHAR},
      </if>
      <if test="billAuotid != null">
        #{billAuotid,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="update" parameterType="com.tianbo.analysis.model.BusinessAlterLog">
    update BUSINESS_ALTER_LOG
    set CREATEDATE = #{createdate,jdbcType=TIMESTAMP},
        BUSINESSTYPE = #{businesstype,jdbcType=VARCHAR},
        ALTER_REASON = #{alterReason,jdbcType=VARCHAR},
        CONTANTNAME = #{contantname,jdbcType=VARCHAR},
        CONTENTTEL = #{contenttel,jdbcType=VARCHAR},
        BILL_AUOTID = #{billAuotid,jdbcType=VARCHAR}
    where AUTOID = #{autoid,jdbcType=VARCHAR}
  </update>

  <update id="updateSelective" parameterType="com.tianbo.analysis.model.BusinessAlterLog">
    update BUSINESS_ALTER_LOG
    <set>
      <if test="createdate != null">CREATEDATE = #{createdate,jdbcType=TIMESTAMP},</if>
      <if test="businesstype != null">BUSINESSTYPE = #{businesstype,jdbcType=VARCHAR},</if>
      <if test="alterReason != null">ALTER_REASON = #{alterReason,jdbcType=VARCHAR},</if>
      <if test="contantname != null">CONTANTNAME = #{contantname,jdbcType=VARCHAR},</if>
      <if test="contenttel != null">CONTENTTEL = #{contenttel,jdbcType=VARCHAR},</if>
      <if test="billAuotid != null">BILL_AUOTID = #{billAuotid,jdbcType=VARCHAR},</if>
    </set>
    where AUTOID = #{autoid,jdbcType=VARCHAR}
  </update>
  <select id="selectByBillAutoidAndType" parameterType="com.tianbo.analysis.model.BusinessAlterLog" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from BUSINESS_ALTER_LOG
    where BILL_AUOTID = #{billAuotid,jdbcType=VARCHAR}
    and BUSINESSTYPE = #{businesstype,jdbcType=VARCHAR}

  </select>
</mapper>