<?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.lightinit.hsdataportal.mapper.OrderGoodsMapper">
  <resultMap id="BaseResultMap" type="com.lightinit.hsdataportal.entity.OrderGoods">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="order_id" jdbcType="BIGINT" property="orderId" />
    <result column="resource_auth_id" jdbcType="BIGINT" property="resourceAuthId" />
    <result column="resource_type" jdbcType="VARCHAR" property="resourceType" />
    <result column="resource_name" jdbcType="VARCHAR" property="resourceName" />
    <result column="quantity" jdbcType="INTEGER" property="quantity" />
    <result column="publish_setting_id" jdbcType="BIGINT" property="publishSettingId" />
    <result column="charge_method" jdbcType="VARCHAR" property="chargeMethod" />
    <result column="package_name" jdbcType="VARCHAR" property="packageName" />
    <result column="package_price" jdbcType="DECIMAL" property="packagePrice" />
    <result column="package_months" jdbcType="BIGINT" property="packageMonths" />
    <result column="self_cost" jdbcType="DECIMAL" property="selfCost" />
    <result column="buy_times_limit" jdbcType="BIGINT" property="buyTimesLimit" />
    <result column="use_times_limit" jdbcType="BIGINT" property="useTimesLimit" />
    <result column="total_times" jdbcType="BIGINT" property="totalTimes" />
    <result column="use_times" jdbcType="BIGINT" property="useTimes" />
    <result column="rest_times" jdbcType="BIGINT" property="restTimes" />
    <result column="effective_date" jdbcType="TIMESTAMP" property="effectiveDate" />
    <result column="expiried_date" jdbcType="TIMESTAMP" property="expiriedDate" />
    <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
    <result column="created_by" jdbcType="BIGINT" property="createdBy" />
    <result column="deleted_at" jdbcType="TIMESTAMP" property="deletedAt" />
    <result column="deleted_by" jdbcType="BIGINT" property="deletedBy" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.lightinit.hsdataportal.entity.OrderGoods">
    <result column="description" jdbcType="LONGVARCHAR" property="description" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    id, order_id, resource_auth_id, resource_type, resource_name, quantity, publish_setting_id, 
    charge_method, package_name, package_price, package_months, self_cost, buy_times_limit, 
    use_times_limit, total_times, use_times, rest_times, effective_date, expiried_date, 
    created_at, created_by, deleted_at, deleted_by
  </sql>
  <sql id="Blob_Column_List">
    description
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="com.lightinit.hsdataportal.entity.OrderGoodsExample" resultMap="ResultMapWithBLOBs">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from order_goods
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="com.lightinit.hsdataportal.entity.OrderGoodsExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from order_goods
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from order_goods
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from order_goods
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.lightinit.hsdataportal.entity.OrderGoodsExample">
    delete from order_goods
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.lightinit.hsdataportal.entity.OrderGoods">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into order_goods (order_id, resource_auth_id, resource_type, 
      resource_name, quantity, publish_setting_id, 
      charge_method, package_name, package_price, 
      package_months, self_cost, buy_times_limit, 
      use_times_limit, total_times, use_times, 
      rest_times, effective_date, expiried_date, 
      created_at, created_by, deleted_at, 
      deleted_by, description)
    values (#{orderId,jdbcType=BIGINT}, #{resourceAuthId,jdbcType=BIGINT}, #{resourceType,jdbcType=VARCHAR}, 
      #{resourceName,jdbcType=VARCHAR}, #{quantity,jdbcType=INTEGER}, #{publishSettingId,jdbcType=BIGINT}, 
      #{chargeMethod,jdbcType=VARCHAR}, #{packageName,jdbcType=VARCHAR}, #{packagePrice,jdbcType=DECIMAL}, 
      #{packageMonths,jdbcType=BIGINT}, #{selfCost,jdbcType=DECIMAL}, #{buyTimesLimit,jdbcType=BIGINT}, 
      #{useTimesLimit,jdbcType=BIGINT}, #{totalTimes,jdbcType=BIGINT}, #{useTimes,jdbcType=BIGINT}, 
      #{restTimes,jdbcType=BIGINT}, #{effectiveDate,jdbcType=TIMESTAMP}, #{expiriedDate,jdbcType=TIMESTAMP}, 
      #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{deletedAt,jdbcType=TIMESTAMP}, 
      #{deletedBy,jdbcType=BIGINT}, #{description,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.lightinit.hsdataportal.entity.OrderGoods">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into order_goods
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="orderId != null">
        order_id,
      </if>
      <if test="resourceAuthId != null">
        resource_auth_id,
      </if>
      <if test="resourceType != null">
        resource_type,
      </if>
      <if test="resourceName != null">
        resource_name,
      </if>
      <if test="quantity != null">
        quantity,
      </if>
      <if test="publishSettingId != null">
        publish_setting_id,
      </if>
      <if test="chargeMethod != null">
        charge_method,
      </if>
      <if test="packageName != null">
        package_name,
      </if>
      <if test="packagePrice != null">
        package_price,
      </if>
      <if test="packageMonths != null">
        package_months,
      </if>
      <if test="selfCost != null">
        self_cost,
      </if>
      <if test="buyTimesLimit != null">
        buy_times_limit,
      </if>
      <if test="useTimesLimit != null">
        use_times_limit,
      </if>
      <if test="totalTimes != null">
        total_times,
      </if>
      <if test="useTimes != null">
        use_times,
      </if>
      <if test="restTimes != null">
        rest_times,
      </if>
      <if test="effectiveDate != null">
        effective_date,
      </if>
      <if test="expiriedDate != null">
        expiried_date,
      </if>
      <if test="createdAt != null">
        created_at,
      </if>
      <if test="createdBy != null">
        created_by,
      </if>
      <if test="deletedAt != null">
        deleted_at,
      </if>
      <if test="deletedBy != null">
        deleted_by,
      </if>
      <if test="description != null">
        description,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="orderId != null">
        #{orderId,jdbcType=BIGINT},
      </if>
      <if test="resourceAuthId != null">
        #{resourceAuthId,jdbcType=BIGINT},
      </if>
      <if test="resourceType != null">
        #{resourceType,jdbcType=VARCHAR},
      </if>
      <if test="resourceName != null">
        #{resourceName,jdbcType=VARCHAR},
      </if>
      <if test="quantity != null">
        #{quantity,jdbcType=INTEGER},
      </if>
      <if test="publishSettingId != null">
        #{publishSettingId,jdbcType=BIGINT},
      </if>
      <if test="chargeMethod != null">
        #{chargeMethod,jdbcType=VARCHAR},
      </if>
      <if test="packageName != null">
        #{packageName,jdbcType=VARCHAR},
      </if>
      <if test="packagePrice != null">
        #{packagePrice,jdbcType=DECIMAL},
      </if>
      <if test="packageMonths != null">
        #{packageMonths,jdbcType=BIGINT},
      </if>
      <if test="selfCost != null">
        #{selfCost,jdbcType=DECIMAL},
      </if>
      <if test="buyTimesLimit != null">
        #{buyTimesLimit,jdbcType=BIGINT},
      </if>
      <if test="useTimesLimit != null">
        #{useTimesLimit,jdbcType=BIGINT},
      </if>
      <if test="totalTimes != null">
        #{totalTimes,jdbcType=BIGINT},
      </if>
      <if test="useTimes != null">
        #{useTimes,jdbcType=BIGINT},
      </if>
      <if test="restTimes != null">
        #{restTimes,jdbcType=BIGINT},
      </if>
      <if test="effectiveDate != null">
        #{effectiveDate,jdbcType=TIMESTAMP},
      </if>
      <if test="expiriedDate != null">
        #{expiriedDate,jdbcType=TIMESTAMP},
      </if>
      <if test="createdAt != null">
        #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="createdBy != null">
        #{createdBy,jdbcType=BIGINT},
      </if>
      <if test="deletedAt != null">
        #{deletedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="deletedBy != null">
        #{deletedBy,jdbcType=BIGINT},
      </if>
      <if test="description != null">
        #{description,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.lightinit.hsdataportal.entity.OrderGoodsExample" resultType="java.lang.Long">
    select count(*) from order_goods
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update order_goods
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.orderId != null">
        order_id = #{record.orderId,jdbcType=BIGINT},
      </if>
      <if test="record.resourceAuthId != null">
        resource_auth_id = #{record.resourceAuthId,jdbcType=BIGINT},
      </if>
      <if test="record.resourceType != null">
        resource_type = #{record.resourceType,jdbcType=VARCHAR},
      </if>
      <if test="record.resourceName != null">
        resource_name = #{record.resourceName,jdbcType=VARCHAR},
      </if>
      <if test="record.quantity != null">
        quantity = #{record.quantity,jdbcType=INTEGER},
      </if>
      <if test="record.publishSettingId != null">
        publish_setting_id = #{record.publishSettingId,jdbcType=BIGINT},
      </if>
      <if test="record.chargeMethod != null">
        charge_method = #{record.chargeMethod,jdbcType=VARCHAR},
      </if>
      <if test="record.packageName != null">
        package_name = #{record.packageName,jdbcType=VARCHAR},
      </if>
      <if test="record.packagePrice != null">
        package_price = #{record.packagePrice,jdbcType=DECIMAL},
      </if>
      <if test="record.packageMonths != null">
        package_months = #{record.packageMonths,jdbcType=BIGINT},
      </if>
      <if test="record.selfCost != null">
        self_cost = #{record.selfCost,jdbcType=DECIMAL},
      </if>
      <if test="record.buyTimesLimit != null">
        buy_times_limit = #{record.buyTimesLimit,jdbcType=BIGINT},
      </if>
      <if test="record.useTimesLimit != null">
        use_times_limit = #{record.useTimesLimit,jdbcType=BIGINT},
      </if>
      <if test="record.totalTimes != null">
        total_times = #{record.totalTimes,jdbcType=BIGINT},
      </if>
      <if test="record.useTimes != null">
        use_times = #{record.useTimes,jdbcType=BIGINT},
      </if>
      <if test="record.restTimes != null">
        rest_times = #{record.restTimes,jdbcType=BIGINT},
      </if>
      <if test="record.effectiveDate != null">
        effective_date = #{record.effectiveDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.expiriedDate != null">
        expiried_date = #{record.expiriedDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createdAt != null">
        created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createdBy != null">
        created_by = #{record.createdBy,jdbcType=BIGINT},
      </if>
      <if test="record.deletedAt != null">
        deleted_at = #{record.deletedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.deletedBy != null">
        deleted_by = #{record.deletedBy,jdbcType=BIGINT},
      </if>
      <if test="record.description != null">
        description = #{record.description,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    update order_goods
    set id = #{record.id,jdbcType=BIGINT},
      order_id = #{record.orderId,jdbcType=BIGINT},
      resource_auth_id = #{record.resourceAuthId,jdbcType=BIGINT},
      resource_type = #{record.resourceType,jdbcType=VARCHAR},
      resource_name = #{record.resourceName,jdbcType=VARCHAR},
      quantity = #{record.quantity,jdbcType=INTEGER},
      publish_setting_id = #{record.publishSettingId,jdbcType=BIGINT},
      charge_method = #{record.chargeMethod,jdbcType=VARCHAR},
      package_name = #{record.packageName,jdbcType=VARCHAR},
      package_price = #{record.packagePrice,jdbcType=DECIMAL},
      package_months = #{record.packageMonths,jdbcType=BIGINT},
      self_cost = #{record.selfCost,jdbcType=DECIMAL},
      buy_times_limit = #{record.buyTimesLimit,jdbcType=BIGINT},
      use_times_limit = #{record.useTimesLimit,jdbcType=BIGINT},
      total_times = #{record.totalTimes,jdbcType=BIGINT},
      use_times = #{record.useTimes,jdbcType=BIGINT},
      rest_times = #{record.restTimes,jdbcType=BIGINT},
      effective_date = #{record.effectiveDate,jdbcType=TIMESTAMP},
      expiried_date = #{record.expiriedDate,jdbcType=TIMESTAMP},
      created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      created_by = #{record.createdBy,jdbcType=BIGINT},
      deleted_at = #{record.deletedAt,jdbcType=TIMESTAMP},
      deleted_by = #{record.deletedBy,jdbcType=BIGINT},
      description = #{record.description,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update order_goods
    set id = #{record.id,jdbcType=BIGINT},
      order_id = #{record.orderId,jdbcType=BIGINT},
      resource_auth_id = #{record.resourceAuthId,jdbcType=BIGINT},
      resource_type = #{record.resourceType,jdbcType=VARCHAR},
      resource_name = #{record.resourceName,jdbcType=VARCHAR},
      quantity = #{record.quantity,jdbcType=INTEGER},
      publish_setting_id = #{record.publishSettingId,jdbcType=BIGINT},
      charge_method = #{record.chargeMethod,jdbcType=VARCHAR},
      package_name = #{record.packageName,jdbcType=VARCHAR},
      package_price = #{record.packagePrice,jdbcType=DECIMAL},
      package_months = #{record.packageMonths,jdbcType=BIGINT},
      self_cost = #{record.selfCost,jdbcType=DECIMAL},
      buy_times_limit = #{record.buyTimesLimit,jdbcType=BIGINT},
      use_times_limit = #{record.useTimesLimit,jdbcType=BIGINT},
      total_times = #{record.totalTimes,jdbcType=BIGINT},
      use_times = #{record.useTimes,jdbcType=BIGINT},
      rest_times = #{record.restTimes,jdbcType=BIGINT},
      effective_date = #{record.effectiveDate,jdbcType=TIMESTAMP},
      expiried_date = #{record.expiriedDate,jdbcType=TIMESTAMP},
      created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      created_by = #{record.createdBy,jdbcType=BIGINT},
      deleted_at = #{record.deletedAt,jdbcType=TIMESTAMP},
      deleted_by = #{record.deletedBy,jdbcType=BIGINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.lightinit.hsdataportal.entity.OrderGoods">
    update order_goods
    <set>
      <if test="orderId != null">
        order_id = #{orderId,jdbcType=BIGINT},
      </if>
      <if test="resourceAuthId != null">
        resource_auth_id = #{resourceAuthId,jdbcType=BIGINT},
      </if>
      <if test="resourceType != null">
        resource_type = #{resourceType,jdbcType=VARCHAR},
      </if>
      <if test="resourceName != null">
        resource_name = #{resourceName,jdbcType=VARCHAR},
      </if>
      <if test="quantity != null">
        quantity = #{quantity,jdbcType=INTEGER},
      </if>
      <if test="publishSettingId != null">
        publish_setting_id = #{publishSettingId,jdbcType=BIGINT},
      </if>
      <if test="chargeMethod != null">
        charge_method = #{chargeMethod,jdbcType=VARCHAR},
      </if>
      <if test="packageName != null">
        package_name = #{packageName,jdbcType=VARCHAR},
      </if>
      <if test="packagePrice != null">
        package_price = #{packagePrice,jdbcType=DECIMAL},
      </if>
      <if test="packageMonths != null">
        package_months = #{packageMonths,jdbcType=BIGINT},
      </if>
      <if test="selfCost != null">
        self_cost = #{selfCost,jdbcType=DECIMAL},
      </if>
      <if test="buyTimesLimit != null">
        buy_times_limit = #{buyTimesLimit,jdbcType=BIGINT},
      </if>
      <if test="useTimesLimit != null">
        use_times_limit = #{useTimesLimit,jdbcType=BIGINT},
      </if>
      <if test="totalTimes != null">
        total_times = #{totalTimes,jdbcType=BIGINT},
      </if>
      <if test="useTimes != null">
        use_times = #{useTimes,jdbcType=BIGINT},
      </if>
      <if test="restTimes != null">
        rest_times = #{restTimes,jdbcType=BIGINT},
      </if>
      <if test="effectiveDate != null">
        effective_date = #{effectiveDate,jdbcType=TIMESTAMP},
      </if>
      <if test="expiriedDate != null">
        expiried_date = #{expiriedDate,jdbcType=TIMESTAMP},
      </if>
      <if test="createdAt != null">
        created_at = #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="createdBy != null">
        created_by = #{createdBy,jdbcType=BIGINT},
      </if>
      <if test="deletedAt != null">
        deleted_at = #{deletedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="deletedBy != null">
        deleted_by = #{deletedBy,jdbcType=BIGINT},
      </if>
      <if test="description != null">
        description = #{description,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.lightinit.hsdataportal.entity.OrderGoods">
    update order_goods
    set order_id = #{orderId,jdbcType=BIGINT},
      resource_auth_id = #{resourceAuthId,jdbcType=BIGINT},
      resource_type = #{resourceType,jdbcType=VARCHAR},
      resource_name = #{resourceName,jdbcType=VARCHAR},
      quantity = #{quantity,jdbcType=INTEGER},
      publish_setting_id = #{publishSettingId,jdbcType=BIGINT},
      charge_method = #{chargeMethod,jdbcType=VARCHAR},
      package_name = #{packageName,jdbcType=VARCHAR},
      package_price = #{packagePrice,jdbcType=DECIMAL},
      package_months = #{packageMonths,jdbcType=BIGINT},
      self_cost = #{selfCost,jdbcType=DECIMAL},
      buy_times_limit = #{buyTimesLimit,jdbcType=BIGINT},
      use_times_limit = #{useTimesLimit,jdbcType=BIGINT},
      total_times = #{totalTimes,jdbcType=BIGINT},
      use_times = #{useTimes,jdbcType=BIGINT},
      rest_times = #{restTimes,jdbcType=BIGINT},
      effective_date = #{effectiveDate,jdbcType=TIMESTAMP},
      expiried_date = #{expiriedDate,jdbcType=TIMESTAMP},
      created_at = #{createdAt,jdbcType=TIMESTAMP},
      created_by = #{createdBy,jdbcType=BIGINT},
      deleted_at = #{deletedAt,jdbcType=TIMESTAMP},
      deleted_by = #{deletedBy,jdbcType=BIGINT},
      description = #{description,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.lightinit.hsdataportal.entity.OrderGoods">
    update order_goods
    set order_id = #{orderId,jdbcType=BIGINT},
      resource_auth_id = #{resourceAuthId,jdbcType=BIGINT},
      resource_type = #{resourceType,jdbcType=VARCHAR},
      resource_name = #{resourceName,jdbcType=VARCHAR},
      quantity = #{quantity,jdbcType=INTEGER},
      publish_setting_id = #{publishSettingId,jdbcType=BIGINT},
      charge_method = #{chargeMethod,jdbcType=VARCHAR},
      package_name = #{packageName,jdbcType=VARCHAR},
      package_price = #{packagePrice,jdbcType=DECIMAL},
      package_months = #{packageMonths,jdbcType=BIGINT},
      self_cost = #{selfCost,jdbcType=DECIMAL},
      buy_times_limit = #{buyTimesLimit,jdbcType=BIGINT},
      use_times_limit = #{useTimesLimit,jdbcType=BIGINT},
      total_times = #{totalTimes,jdbcType=BIGINT},
      use_times = #{useTimes,jdbcType=BIGINT},
      rest_times = #{restTimes,jdbcType=BIGINT},
      effective_date = #{effectiveDate,jdbcType=TIMESTAMP},
      expiried_date = #{expiriedDate,jdbcType=TIMESTAMP},
      created_at = #{createdAt,jdbcType=TIMESTAMP},
      created_by = #{createdBy,jdbcType=BIGINT},
      deleted_at = #{deletedAt,jdbcType=TIMESTAMP},
      deleted_by = #{deletedBy,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="getOrderId" resultType="java.lang.Long">
    SELECT order_id FROM order_goods
    WHERE resource_type = #{resourceType}
    AND publish_setting_id = #{settingId}
    AND charge_method != #{chargeMethod}
    order by id Desc limit 0,1
  </select>
</mapper>