ChannelOrderMapper.xml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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.qs.mp.channel.mapper.ChannelOrderMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.qs.mp.channel.domain.ChannelOrder">
  6. <id column="order_id" property="orderId" />
  7. <result column="channel_id" property="channelId" />
  8. <result column="title" property="title" />
  9. <result column="order_amt" property="orderAmt" />
  10. <result column="discount_amt" property="discountAmt" />
  11. <result column="freight_amt" property="freightAmt" />
  12. <result column="pay_amt" property="payAmt" />
  13. <result column="status" property="status" />
  14. <result column="pkg_num" property="pkgNum" />
  15. <result column="memo" property="memo" />
  16. <result column="receiver" property="receiver" />
  17. <result column="tel" property="tel" />
  18. <result column="province" property="province" />
  19. <result column="city" property="city" />
  20. <result column="area" property="area" />
  21. <result column="address" property="address" />
  22. <result column="delivery_id" property="deliveryId" />
  23. <result column="delivery_flow_id" property="deliveryFlowId" />
  24. <result column="delivery_time" property="deliveryTime" />
  25. <result column="created_time" property="createdTime" />
  26. <result column="updated_time" property="updatedTime" />
  27. </resultMap>
  28. <!-- 通用查询结果列 -->
  29. <sql id="Base_Column_List">
  30. order_id, channel_id, title, order_amt, discount_amt, freight_amt, pay_amt, status, pkg_num, memo, receiver, tel, province, city, area, address, delivery_id, delivery_flow_id, delivery_time, created_time, updated_time
  31. </sql>
  32. <!-- 查询经销商订单列表 -->
  33. <select id="selectChannelOrderVoList" resultType="com.qs.mp.channel.domain.vo.ChannelOrderVO">
  34. select DISTINCT t1.* , t2.name channelName, t3.name parentName
  35. from mp_channel_order t1
  36. left join mp_channel t2 on t1.channel_id = t2.channel_id
  37. left join mp_channel t3 on t2.parent_id = t3.channel_id
  38. ${ew.customSqlSegment}
  39. </select>
  40. <!-- 查询经销商订单数量 -->
  41. <select id="selectChannelOrderCount" resultType="integer">
  42. select count(DISTINCT t1.order_id)
  43. from mp_channel_order t1
  44. left join mp_channel t2 on t1.channel_id = t2.channel_id
  45. left join mp_channel t3 on t2.parent_id = t3.channel_id
  46. ${ew.customSqlSegment}
  47. </select>
  48. <select id="selectIndexChannelOrderDailyInfoList" resultType="com.qs.mp.admin.domain.vo.IndexVO">
  49. select
  50. DATE_FORMAT(t1.created_time, '%Y%m%d') AS time,
  51. SUM(t1.pay_amt) AS payAmt
  52. from mp_channel_order t1
  53. ${ew.customSqlSegment}
  54. group by time
  55. </select>
  56. </mapper>