NoticeMapper.xml 6.44 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.yohoufo.dal.order.NoticeMapper">
  <resultMap id="BaseResultMap" type="com.yohoufo.dal.order.model.Notice">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="uid" jdbcType="INTEGER" property="uid" />
    <result column="biz_key" jdbcType="VARCHAR" property="bizKey" />
    <result column="case_id" jdbcType="INTEGER" property="caseId" />
    <result column="rule_id" jdbcType="INTEGER" property="ruleId" />
    <result column="method" jdbcType="SMALLINT" property="method" />
    <result column="limit_quantity" jdbcType="INTEGER" property="limitQuantity" />
    <result column="quantity" jdbcType="INTEGER" property="quantity" />
    <result column="update_dtp" jdbcType="VARCHAR" property="updateDtp" />
    <result column="time_unit_region" jdbcType="INTEGER" property="timeUnitRegion" />
    <result column="time_unit" jdbcType="SMALLINT" property="timeUnit" />
    <result column="update_time" jdbcType="INTEGER" property="updateTime" />
    <result column="create_time" jdbcType="INTEGER" property="createTime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, uid, biz_key, case_id, rule_id, method, limit_quantity, quantity, update_dtp, 
    time_unit_region, time_unit, update_time, create_time
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from notice
    where id = #{id,jdbcType=BIGINT}
  </select>

  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yohoufo.dal.order.model.Notice" useGeneratedKeys="true">
    insert into notice (uid, biz_key, case_id, 
      rule_id, method, limit_quantity, 
      quantity, update_dtp, time_unit_region, 
      time_unit, update_time, create_time
      )
    values (#{uid,jdbcType=INTEGER}, #{bizKey,jdbcType=VARCHAR}, #{caseId,jdbcType=INTEGER}, 
      #{ruleId,jdbcType=INTEGER}, #{method,jdbcType=SMALLINT}, #{limitQuantity,jdbcType=INTEGER}, 
      #{quantity,jdbcType=INTEGER}, #{updateDtp,jdbcType=VARCHAR}, #{timeUnitRegion,jdbcType=INTEGER}, 
      #{timeUnit,jdbcType=SMALLINT}, #{updateTime,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER}
      )
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yohoufo.dal.order.model.Notice" useGeneratedKeys="true">
    insert into notice
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="uid != null">
        uid,
      </if>
      <if test="bizKey != null">
        biz_key,
      </if>
      <if test="caseId != null">
        case_id,
      </if>
      <if test="ruleId != null">
        rule_id,
      </if>
      <if test="method != null">
        method,
      </if>
      <if test="limitQuantity != null">
        limit_quantity,
      </if>
      <if test="quantity != null">
        quantity,
      </if>
      <if test="updateDtp != null">
        update_dtp,
      </if>
      <if test="timeUnitRegion != null">
        time_unit_region,
      </if>
      <if test="timeUnit != null">
        time_unit,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="uid != null">
        #{uid,jdbcType=INTEGER},
      </if>
      <if test="bizKey != null">
        #{bizKey,jdbcType=VARCHAR},
      </if>
      <if test="caseId != null">
        #{caseId,jdbcType=INTEGER},
      </if>
      <if test="ruleId != null">
        #{ruleId,jdbcType=INTEGER},
      </if>
      <if test="method != null">
        #{method,jdbcType=SMALLINT},
      </if>
      <if test="limitQuantity != null">
        #{limitQuantity,jdbcType=INTEGER},
      </if>
      <if test="quantity != null">
        #{quantity,jdbcType=INTEGER},
      </if>
      <if test="updateDtp != null">
        #{updateDtp,jdbcType=VARCHAR},
      </if>
      <if test="timeUnitRegion != null">
        #{timeUnitRegion,jdbcType=INTEGER},
      </if>
      <if test="timeUnit != null">
        #{timeUnit,jdbcType=SMALLINT},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.yohoufo.dal.order.model.Notice">
    update notice
    <set>
      <if test="uid != null">
        uid = #{uid,jdbcType=INTEGER},
      </if>
      <if test="bizKey != null">
        biz_key = #{bizKey,jdbcType=VARCHAR},
      </if>
      <if test="caseId != null">
        case_id = #{caseId,jdbcType=INTEGER},
      </if>
      <if test="ruleId != null">
        rule_id = #{ruleId,jdbcType=INTEGER},
      </if>
      <if test="method != null">
        method = #{method,jdbcType=SMALLINT},
      </if>
      <if test="limitQuantity != null">
        limit_quantity = #{limitQuantity,jdbcType=INTEGER},
      </if>
      <if test="quantity != null">
        quantity = #{quantity,jdbcType=INTEGER},
      </if>
      <if test="updateDtp != null">
        update_dtp = #{updateDtp,jdbcType=VARCHAR},
      </if>
      <if test="timeUnitRegion != null">
        time_unit_region = #{timeUnitRegion,jdbcType=INTEGER},
      </if>
      <if test="timeUnit != null">
        time_unit = #{timeUnit,jdbcType=SMALLINT},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.yohoufo.dal.order.model.Notice">
    update notice
    set uid = #{uid,jdbcType=INTEGER},
      biz_key = #{bizKey,jdbcType=VARCHAR},
      case_id = #{caseId,jdbcType=INTEGER},
      rule_id = #{ruleId,jdbcType=INTEGER},
      method = #{method,jdbcType=SMALLINT},
      limit_quantity = #{limitQuantity,jdbcType=INTEGER},
      quantity = #{quantity,jdbcType=INTEGER},
      update_dtp = #{updateDtp,jdbcType=VARCHAR},
      time_unit_region = #{timeUnitRegion,jdbcType=INTEGER},
      time_unit = #{timeUnit,jdbcType=SMALLINT},
      update_time = #{updateTime,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=INTEGER}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>