TdCBusinessOrderParkRecordSMapper.xml
5.27 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?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.business.mapper.smapper.TdCBusinessOrderParkRecordSMapper">
<resultMap id="BaseResultMap" type="com.zteits.business.domain.TdCBusinessOrderParkRecord">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="order_id" jdbcType="VARCHAR" property="orderId" />
<result column="pl_no" jdbcType="VARCHAR" property="plNo" />
<result column="pl_name" jdbcType="VARCHAR" property="plName" />
<result column="order_act_fee" jdbcType="BIGINT" property="orderActFee" />
<result column="order_total_fee" jdbcType="BIGINT" property="orderTotalFee" />
<result column="car_number" jdbcType="VARCHAR" property="carNumber" />
<result column="car_type" jdbcType="INTEGER" property="carType" />
<result column="park_in_time" jdbcType="TIMESTAMP" property="parkInTime" />
<result column="park_out_time" jdbcType="TIMESTAMP" property="parkOutTime" />
<result column="parking_duration" jdbcType="BIGINT" property="parkingDuration" />
<result column="business_id" jdbcType="VARCHAR" property="businessId" />
<result column="b_coupon_id" jdbcType="BIGINT" property="bCouponId" />
<result column="b_coupon_code" jdbcType="VARCHAR" property="bCouponCode" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="type_value" jdbcType="INTEGER" property="typeValue" />
<result column="real_value" jdbcType="INTEGER" property="realValue" />
<result column="data_state" jdbcType="INTEGER" property="dataState" />
<result column="org_id" jdbcType="BIGINT" property="orgId" />
<result column="create_emp_id" jdbcType="VARCHAR" property="createEmpId" />
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
<result column="modfiy_emp_id" jdbcType="VARCHAR" property="modfiyEmpId" />
<result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
<result column="business_name" jdbcType="VARCHAR" property="businessName" />
<result column="type_name" jdbcType="VARCHAR" property="typeName" />
</resultMap>
<select id="queryBusinessOrderParkRecordForPageList" parameterType="com.zteits.clouds.api.dto.business.param.TdCBusinessOrderParkRecordRequest" resultMap="BaseResultMap">
select
re.id,
re.order_id,
re.pl_no,
re.pl_name,
re.order_act_fee,
re.order_total_fee,
re.car_number,
re.car_type ,
re.park_in_time ,
re.park_out_time ,
re.parking_duration ,
re.business_id ,
re.b_coupon_id ,
re.b_coupon_code ,
re.type ,
re.type_value ,
re.real_value ,
re.data_state ,
re.org_id ,
re.create_emp_id ,
re.create_date ,
re.modfiy_emp_id ,
re.modfiy_date ,
re.business_name ,
re.type_name
from td_c_business_order_park_record re,
td_c_business_coupon co
where re.data_state = 1
and re.b_coupon_code = co.card_no
and co.is_uesed = 1
<if test="businessId !=null and businessId !=''">
AND re.business_id LIKE CONCAT('%',#{businessId},'%')
</if>
<if test="businessName !=null and businessName !=''">
AND re.business_name LIKE CONCAT('%',#{businessName},'%')
</if>
<if test="startTime !=null">
AND re.create_date > #{startTime}
</if>
<if test="endTime !=null">
AND re.create_date < #{endTime}
</if>
<if test="carNumber !=null and carNumber !=''">
AND re.car_number = #{carNumber}
</if>
<if test="type !=null and type !=''">
AND re.type = #{type}
</if>
<if test="orgId !=null and orgId !=''">
AND re.org_id = #{orgId}
</if>
<if test="orderId !=null and orderId !=''">
AND re.order_id = #{orderId}
</if>
</select>
<select id="queryParkingCouponSummary" parameterType="com.zteits.clouds.api.dto.business.param.TdCBusinessOrderParkRecordRequest" resultType="com.zteits.clouds.api.dto.business.dto.TdCBusinessOrderParkCouponSummaryDTO">
select
sum((IFNULL(re.order_act_fee,0))) as orderActFeeAll,
sum((IFNULL(re.order_total_fee,0))) as orderTotalFeeAll,
(sum((IFNULL(re.order_total_fee,0))) - sum((IFNULL(re.order_act_fee,0)))) as dicountFeeAll
from td_c_business_order_park_record re,
td_c_business_coupon co
where re.data_state = 1
and re.b_coupon_code = co.card_no
and co.is_uesed = 1
<if test="businessId !=null and businessId !=''">
AND re.business_id LIKE CONCAT('%',#{businessId},'%')
</if>
<if test="startTime !=null">
AND re.create_date > #{startTime}
</if>
<if test="endTime !=null">
AND re.create_date < #{endTime}
</if>
<if test="carNumber !=null and carNumber !=''">
AND re.car_number = #{carNumber}
</if>
<if test="type !=null and type !=''">
AND re.type = #{type}
</if>
<if test="orgId !=null and orgId !=''">
AND re.org_id = #{orgId}
</if>
<if test="orderId !=null and orderId !=''">
AND re.order_id = #{orderId}
</if>
</select>
</mapper>