<?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.xxfc.platform.activity.mapper.IntegralRuleMapper" >
  <resultMap id="BaseResultMap" type="com.xxfc.platform.activity.entity.IntegralRule" >
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="period" property="period" jdbcType="BIT" />
    <result column="number" property="number" jdbcType="INTEGER" />
    <result column="point" property="point" jdbcType="INTEGER" />
    <result column="price" property="price" jdbcType="DECIMAL" />
    <result column="is_continuity" property="isContinuity" jdbcType="BIT" />
    <result column="finish_day" property="finishDay" jdbcType="INTEGER" />
    <result column="finish_point" property="finishPoint" jdbcType="INTEGER" />
    <result column="status" property="status" jdbcType="BIT" />
    <result column="crt_time" property="crtTime" jdbcType="BIGINT" />
    <result column="isdel" property="isdel" jdbcType="BIT" />
    <result column="start_time" property="startTime" jdbcType="BIGINT" />
    <result column="end_time" property="endTime" jdbcType="BIGINT" />
    <result column="upd_time" property="updTime" jdbcType="BIGINT" />
    <result column="remarks" property="remarks" jdbcType="VARCHAR" />
    <result column="detail" property="detail" jdbcType="VARCHAR" />
    <result column="img" property="img" jdbcType="VARCHAR" />
    <result column="order_id" property="orderId" jdbcType="INTEGER" />
    <result column="name" property="name" jdbcType="VARCHAR" />
    <result column="code" property="code" jdbcType="VARCHAR" />
    <result column="regulation" property="regulation" jdbcType="LONGVARCHAR" />
    <result column="other_rule" property="otherRule" jdbcType="LONGVARCHAR" />
  </resultMap>

  <select id="selectAllByParam" resultType="com.xxfc.platform.activity.entity.IntegralRule" parameterType="com.xxfc.platform.activity.vo.IntegralRuleDto">

    select i1.* from integral_rule i1
    <where>
        <if test="id != null">
         and i1.id = #{id}
        </if>
        <if test="code != null">
          and i1.code = #{code}
        </if>
        and i1.isdel = 0 and status = 1
    </where>
    order by i1.order_id DESC ,i1.crt_time DESC
  </select>

</mapper>