IncrementOrderMapper.xml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.fdkankan.manage.mapper.IIncrementOrderMapper">
  4. <select id="pageList" resultType="com.fdkankan.manage.vo.response.IncrementOrderVo">
  5. 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,
  6. null as customer_name,0 as customer_type,null as end_customer,null as use_type ,null as project_num ,
  7. null as remark,null as agentName,null as agentId,
  8. u.user_name,u.nick_name,
  9. '线上' as payMethod
  10. from t_increment_order o
  11. left join t_user u on o.user_id = u.id
  12. <include refid="commonWhere"></include>
  13. <if test="param.customerType==1 or param.payMethod==1 or param.useType!=null">
  14. and o.rec_status = 'ABC'
  15. </if>
  16. union all
  17. 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,
  18. o.customer_name,o.customer_type,o.end_customer,o.use_type,o.project_num,o.remark,o.agent_name,o.agent_id,
  19. u.user_name,u.nick_name ,'线下'as payMethod from t_increment_order_mg o
  20. left join t_user u on o.user_id = u.id
  21. <include refid="commonWhere"></include>
  22. <if test="param.customerType!=null">
  23. and o.customer_type = #{param.customerType}
  24. </if>
  25. <if test="param.useType!=null">
  26. and o.use_type = #{param.useType}
  27. </if>
  28. <if test="param.payMethod!=null and param.payMethod==0">
  29. and o.rec_status = 'ABC'
  30. </if>
  31. order by create_time desc
  32. </select>
  33. <sql id="commonWhere">
  34. WHERE o.rec_status = 'A' and o.pay_status = '1'
  35. <if test="param.orderSn !=null and param.orderSn !='' ">
  36. and o.order_sn like concat ('%',#{param.orderSn},'%')
  37. </if>
  38. <if test="param.userName !=null and param.userName!='' ">
  39. and u.user_name like concat ('%',#{param.userName},'%')
  40. </if>
  41. <if test="param.tradeNum!=null and param.tradeNum != '' ">
  42. and o.number like concat ('%',#{param.tradeNum},'%')
  43. </if>
  44. <if test="param.startTime != null and param.startTime !='' ">
  45. and o.trade_time &gt;= #{param.startTime}
  46. </if>
  47. <if test="param.endTime != null and param.endTime !='' ">
  48. and o.trade_time &lt;= #{param.endTime}
  49. </if>
  50. <if test="param.amount != null">
  51. and o.amount = #{param.amount}
  52. </if>
  53. </sql>
  54. </mapper>