1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?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.fdkankan.manage.mapper.IIncrementOrderMapper">
- <select id="pageList" resultType="com.fdkankan.manage.vo.response.IncrementOrderVo">
- select o.id,o.trade_time ,o.order_sn,o.member_levels,o.amount,o.count,o.pay_type,o.number,o.pay_status,o.time_zone_off,o.increment_id,o.create_time,
- null as customer_name,0 as customer_type,null as end_customer,null as use_type ,null as project_num ,
- null as remark,null as agentName,null as agentId,
- u.user_name,u.nick_name,
- '线上' as payMethod
- from t_increment_order o
- left join t_user u on o.user_id = u.id
- <include refid="commonWhere"></include>
- <if test="param.customerType==1 or param.payMethod==1 or param.useType!=null">
- and o.rec_status = 'ABC'
- </if>
- union all
- select o.id,o.trade_time ,o.order_sn,o.member_levels,o.amount,o.count,o.pay_type,o.number,o.pay_status,o.time_zone_off,o.increment_id,o.create_time,
- o.customer_name,o.customer_type,o.end_customer,o.use_type,o.project_num,o.remark,o.agent_name,o.agent_id,
- u.user_name,u.nick_name ,'线下'as payMethod from t_increment_order_mg o
- left join t_user u on o.user_id = u.id
- <include refid="commonWhere"></include>
- <if test="param.customerType!=null">
- and o.customer_type = #{param.customerType}
- </if>
- <if test="param.useType!=null">
- and o.use_type = #{param.useType}
- </if>
- <if test="param.payMethod!=null and param.payMethod==0">
- and o.rec_status = 'ABC'
- </if>
- order by create_time desc
- </select>
- <sql id="commonWhere">
- WHERE o.rec_status = 'A' and o.pay_status = '1'
- <if test="param.orderSn !=null and param.orderSn !='' ">
- and o.order_sn like concat ('%',#{param.orderSn},'%')
- </if>
- <if test="param.userName !=null and param.userName!='' ">
- and u.user_name like concat ('%',#{param.userName},'%')
- </if>
- <if test="param.tradeNum!=null and param.tradeNum != '' ">
- and o.number like concat ('%',#{param.tradeNum},'%')
- </if>
- <if test="param.startTime != null and param.startTime !='' ">
- and o.trade_time >= #{param.startTime}
- </if>
- <if test="param.endTime != null and param.endTime !='' ">
- and o.trade_time <= #{param.endTime}
- </if>
- <if test="param.amount != null">
- and o.amount = #{param.amount}
- </if>
- </sql>
- </mapper>
|