MallBizOrderDao.xml 10.5 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.diligrp.cashier.mall.dao.MallBizOrderDao">
  <resultMap id="BaseResultMap" type="com.diligrp.cashier.mall.model.MallBizOrder">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
    <result column="order_id" jdbcType="VARCHAR" property="orderId" />
    <result column="trade_id" jdbcType="VARCHAR" property="tradeId" />
    <result column="channel" jdbcType="VARCHAR" property="channel" />
    <result column="mch_id" jdbcType="VARCHAR" property="mchId" />
    <result column="source" jdbcType="TINYINT" property="source" />
    <result column="order_type" jdbcType="TINYINT" property="orderType" />
    <result column="user_code" jdbcType="VARCHAR" property="userCode" />
    <result column="username" jdbcType="VARCHAR" property="username" />
    <result column="company_code" jdbcType="VARCHAR" property="companyCode" />
    <result column="shop_code" jdbcType="VARCHAR" property="shopCode" />
    <result column="shop_name" jdbcType="VARCHAR" property="shopName" />
    <result column="total_amount" jdbcType="BIGINT" property="totalAmount" />
    <result column="freight_fee" jdbcType="BIGINT" property="freightFee" />
    <result column="state" jdbcType="TINYINT" property="state" />
    <result column="rtmart_state" jdbcType="TINYINT" property="rtmartState" />
    <result column="order_time" jdbcType="TIMESTAMP" property="orderTime" />
    <result column="order_expire" jdbcType="INTEGER" property="orderExpire" />
    <result column="version" jdbcType="INTEGER" property="version" />
    <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
    <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, order_no, order_id, trade_id, channel, mch_id, source, order_type, user_code,
    username, company_code, shop_code, shop_name, total_amount, freight_fee, state,
    rtmart_state, order_time, order_expire, version, created_time, modified_time
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from mall_biz_order
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from mall_biz_order
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.diligrp.cashier.mall.model.MallBizOrder">
    insert into mall_biz_order (id, order_no, order_id,
      trade_id, channel, mch_id,
      source, order_type, user_code,
      username, company_code, shop_code,
      shop_name, total_amount, freight_fee,
      state, rtmart_state, order_time,
      order_expire, version, created_time,
      modified_time)
    values (#{id,jdbcType=BIGINT}, #{orderNo,jdbcType=VARCHAR}, #{orderId,jdbcType=VARCHAR},
      #{tradeId,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR}, #{mchId,jdbcType=VARCHAR},
      #{source,jdbcType=TINYINT}, #{orderType,jdbcType=TINYINT}, #{userCode,jdbcType=VARCHAR},
      #{username,jdbcType=VARCHAR}, #{companyCode,jdbcType=VARCHAR}, #{shopCode,jdbcType=VARCHAR},
      #{shopName,jdbcType=VARCHAR}, #{totalAmount,jdbcType=BIGINT}, #{freightFee,jdbcType=BIGINT},
      #{state,jdbcType=TINYINT}, #{rtmartState,jdbcType=TINYINT}, #{orderTime,jdbcType=TIMESTAMP},
      #{orderExpire,jdbcType=INTEGER}, #{version,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP},
      #{modifiedTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.diligrp.cashier.mall.model.MallBizOrder">
    insert into mall_biz_order
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="orderNo != null">
        order_no,
      </if>
      <if test="orderId != null">
        order_id,
      </if>
      <if test="tradeId != null">
        trade_id,
      </if>
      <if test="channel != null">
        channel,
      </if>
      <if test="mchId != null">
        mch_id,
      </if>
      <if test="source != null">
        source,
      </if>
      <if test="orderType != null">
        order_type,
      </if>
      <if test="userCode != null">
        user_code,
      </if>
      <if test="username != null">
        username,
      </if>
      <if test="companyCode != null">
        company_code,
      </if>
      <if test="shopCode != null">
        shop_code,
      </if>
      <if test="shopName != null">
        shop_name,
      </if>
      <if test="totalAmount != null">
        total_amount,
      </if>
      <if test="freightFee != null">
        freight_fee,
      </if>
      <if test="state != null">
        state,
      </if>
      <if test="rtmartState != null">
        rtmart_state,
      </if>
      <if test="orderTime != null">
        order_time,
      </if>
      <if test="orderExpire != null">
        order_expire,
      </if>
      <if test="version != null">
        version,
      </if>
      <if test="createdTime != null">
        created_time,
      </if>
      <if test="modifiedTime != null">
        modified_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="orderNo != null">
        #{orderNo,jdbcType=VARCHAR},
      </if>
      <if test="orderId != null">
        #{orderId,jdbcType=VARCHAR},
      </if>
      <if test="tradeId != null">
        #{tradeId,jdbcType=VARCHAR},
      </if>
      <if test="channel != null">
        #{channel,jdbcType=VARCHAR},
      </if>
      <if test="mchId != null">
        #{mchId,jdbcType=VARCHAR},
      </if>
      <if test="source != null">
        #{source,jdbcType=TINYINT},
      </if>
      <if test="orderType != null">
        #{orderType,jdbcType=TINYINT},
      </if>
      <if test="userCode != null">
        #{userCode,jdbcType=VARCHAR},
      </if>
      <if test="username != null">
        #{username,jdbcType=VARCHAR},
      </if>
      <if test="companyCode != null">
        #{companyCode,jdbcType=VARCHAR},
      </if>
      <if test="shopCode != null">
        #{shopCode,jdbcType=VARCHAR},
      </if>
      <if test="shopName != null">
        #{shopName,jdbcType=VARCHAR},
      </if>
      <if test="totalAmount != null">
        #{totalAmount,jdbcType=BIGINT},
      </if>
      <if test="freightFee != null">
        #{freightFee,jdbcType=BIGINT},
      </if>
      <if test="state != null">
        #{state,jdbcType=TINYINT},
      </if>
      <if test="rtmartState != null">
        #{rtmartState,jdbcType=TINYINT},
      </if>
      <if test="orderTime != null">
        #{orderTime,jdbcType=TIMESTAMP},
      </if>
      <if test="orderExpire != null">
        #{orderExpire,jdbcType=INTEGER},
      </if>
      <if test="version != null">
        #{version,jdbcType=INTEGER},
      </if>
      <if test="createdTime != null">
        #{createdTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifiedTime != null">
        #{modifiedTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.diligrp.cashier.mall.model.MallBizOrder">
    update mall_biz_order
    <set>
      <if test="orderNo != null">
        order_no = #{orderNo,jdbcType=VARCHAR},
      </if>
      <if test="orderId != null">
        order_id = #{orderId,jdbcType=VARCHAR},
      </if>
      <if test="tradeId != null">
        trade_id = #{tradeId,jdbcType=VARCHAR},
      </if>
      <if test="channel != null">
        channel = #{channel,jdbcType=VARCHAR},
      </if>
      <if test="mchId != null">
        mch_id = #{mchId,jdbcType=VARCHAR},
      </if>
      <if test="source != null">
        source = #{source,jdbcType=TINYINT},
      </if>
      <if test="orderType != null">
        order_type = #{orderType,jdbcType=TINYINT},
      </if>
      <if test="userCode != null">
        user_code = #{userCode,jdbcType=VARCHAR},
      </if>
      <if test="username != null">
        username = #{username,jdbcType=VARCHAR},
      </if>
      <if test="companyCode != null">
        company_code = #{companyCode,jdbcType=VARCHAR},
      </if>
      <if test="shopCode != null">
        shop_code = #{shopCode,jdbcType=VARCHAR},
      </if>
      <if test="shopName != null">
        shop_name = #{shopName,jdbcType=VARCHAR},
      </if>
      <if test="totalAmount != null">
        total_amount = #{totalAmount,jdbcType=BIGINT},
      </if>
      <if test="freightFee != null">
        freight_fee = #{freightFee,jdbcType=BIGINT},
      </if>
      <if test="state != null">
        state = #{state,jdbcType=TINYINT},
      </if>
      <if test="rtmartState != null">
        rtmart_state = #{rtmartState,jdbcType=TINYINT},
      </if>
      <if test="orderTime != null">
        order_time = #{orderTime,jdbcType=TIMESTAMP},
      </if>
      <if test="orderExpire != null">
        order_expire = #{orderExpire,jdbcType=INTEGER},
      </if>
      <if test="version != null">
        version = #{version,jdbcType=INTEGER},
      </if>
      <if test="createdTime != null">
        created_time = #{createdTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifiedTime != null">
        modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.diligrp.cashier.mall.model.MallBizOrder">
    update mall_biz_order
    set order_no = #{orderNo,jdbcType=VARCHAR},
      order_id = #{orderId,jdbcType=VARCHAR},
      trade_id = #{tradeId,jdbcType=VARCHAR},
      channel = #{channel,jdbcType=VARCHAR},
      mch_id = #{mchId,jdbcType=VARCHAR},
      source = #{source,jdbcType=TINYINT},
      order_type = #{orderType,jdbcType=TINYINT},
      user_code = #{userCode,jdbcType=VARCHAR},
      username = #{username,jdbcType=VARCHAR},
      company_code = #{companyCode,jdbcType=VARCHAR},
      shop_code = #{shopCode,jdbcType=VARCHAR},
      shop_name = #{shopName,jdbcType=VARCHAR},
      total_amount = #{totalAmount,jdbcType=BIGINT},
      freight_fee = #{freightFee,jdbcType=BIGINT},
      state = #{state,jdbcType=TINYINT},
      rtmart_state = #{rtmartState,jdbcType=TINYINT},
      order_time = #{orderTime,jdbcType=TIMESTAMP},
      order_expire = #{orderExpire,jdbcType=INTEGER},
      version = #{version,jdbcType=INTEGER},
      created_time = #{createdTime,jdbcType=TIMESTAMP},
      modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>