Blame view

parking-module-pay/src/main/resources/mybatis/smapper/RealtimeInfoSMapper.xml 2.27 KB
55f68655   王彪总   新项目
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  <?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.zteits.park.mapper.smapper.RealtimeInfoSMapper">
  <select id="getEscapePaymentInfoDuring24hs" resultType="com.zteits.pay.domain.EscapesPaymentDataDO">
  	select 
  		EscapeCountDuring12To18, 
  		PaymentCountDuring12To18,
  		EscapeCountDuring18To24,
  		PaymentCountDuring18To24,
  		EscapeCountDuring0To6,
  		PaymentCountDuring0To6,
  		EscapeCountDuring6To12,
  		PaymentCountDuring6To12
  	 from
  		(select count(1) EscapeCountDuring12To18 from td_b_order where
  			create_date >= DATE_ADD(curdate(), INTERVAL -12 HOUR) 
  			and create_date  &lt; DATE_ADD(curdate(), INTERVAL -6 HOUR) and order_state = 5) as EscapeCountDuring12To181,
  		(select count(1) PaymentCountDuring12To18 from td_b_order where
  			create_date >= DATE_ADD(curdate(), INTERVAL -12 HOUR) 
  			and create_date  &lt; DATE_ADD(curdate(), INTERVAL -6 HOUR) and order_type = 5) as PaymentCountDuring12To181,
  		(select count(1) EscapeCountDuring18To24 from td_b_order where
  			create_date >= DATE_ADD(curdate(), INTERVAL -6 HOUR) 
  			and create_date  &lt; curdate() and order_state = 5) as EscapeCountDuring18To24,
  		(select count(1) PaymentCountDuring18To24 from td_b_order where
  			create_date >= DATE_ADD(curdate(), INTERVAL -6 HOUR) 
  			and create_date  &lt; curdate() and order_type = 5) as PaymentCountDuring18To24,
  		(select count(1) EscapeCountDuring0To6 from td_b_order where
  			create_date >= curdate()
  			and create_date  &lt; DATE_ADD(curdate(), INTERVAL 6 HOUR) and order_state = 5) as EscapeCountDuring0To6,
  		(select count(1) PaymentCountDuring0To6 from td_b_order where
  			create_date >= curdate() 
  			and create_date  &lt; DATE_ADD(curdate(), INTERVAL 6 HOUR)  and order_type = 5) as PaymentCountDuring0To6,
  		(select count(1) EscapeCountDuring6To12 from td_b_order where
  			create_date >= DATE_ADD(curdate(), INTERVAL 6 HOUR) 
  			and create_date  &lt; DATE_ADD(curdate(), INTERVAL 12 HOUR) and order_state = 5) as EscapeCountDuring6To12,
  		(select count(1) PaymentCountDuring6To12 from td_b_order where
  			create_date >= DATE_ADD(curdate(), INTERVAL 6 HOUR) 
  			and create_date  &lt; DATE_ADD(curdate(), INTERVAL 12 HOUR) and order_type = 5) as PaymentCountDuring6To12
  </select>
  </mapper>