<?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.order.mapper.OrderActiveDetailMapper" >

  <select id="getAllActivityOrder" resultType="com.xxfc.platform.order.pojo.vo.OrderActivityVo">
      select oad.*, bo.picture as image, bo.no as orderNo,bo.user_id, bo.goods_amount, bo.real_amount, bo.`status`, bo.crt_time as orderTime from order_active_detail oad
      LEFT JOIN base_order bo on bo.id = oad.order_id
      <where>
          <if test="no != null and no != ''">
                and bo.no = #{no}
          </if>
          <if test="userId != null and userId > 0">
              and bo.user_id = #{userId}
          </if>
          <if test="type != null and type > 0">
              and oad.type = #{type}
          </if>
          <if test="startTime != null and endTime != null">
            and bo.crt_time between #{startTime} and #{endTime}
          </if>
          <if test="status != null and status > 0">
            and bo.status = #{status}
          </if>
      </where>
      order By bo.crt_time DESC
  </select>
</mapper>