IncomeBerthReportSMapper.xml
7.63 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?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.order.mapper.smapper.IncomeBerthReportSMapper">
<resultMap id="BaseResultMap" type="com.zteits.order.domain.IncomeBerthReport">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="check_date" jdbcType="DATE" property="checkDate" />
<result column="check_date_str" jdbcType="VARCHAR" property="checkDateStr" />
<result column="begin_date" jdbcType="TIMESTAMP" property="beginDate" />
<result column="end_date" jdbcType="TIMESTAMP" property="endDate" />
<result column="org_id" jdbcType="VARCHAR" property="orgId" />
<result column="pl_no" jdbcType="VARCHAR" property="plNo" />
<result column="pl_name" jdbcType="VARCHAR" property="plName" />
<result column="berth_num" jdbcType="INTEGER" property="berthNum" />
<result column="eqp_num" jdbcType="INTEGER" property="eqpNum" />
<result column="berth_no_range" jdbcType="VARCHAR" property="berthNoRange" />
<result column="berth_area_range" jdbcType="VARCHAR" property="berthAreaRange" />
<result column="bill_start_time" jdbcType="VARCHAR" property="billStartTime" />
<result column="bill_end_time" jdbcType="VARCHAR" property="billEndTime" />
<result column="duty_charger_num" jdbcType="INTEGER" property="dutyChargerNum" />
<result column="pl_type" jdbcType="INTEGER" property="plType" />
<result column="pl_type_str" jdbcType="VARCHAR" property="plTypeStr" />
<result column="night_bill_berth_no_range" jdbcType="VARCHAR" property="nightBillBerthNoRange" />
<result column="total_fee" jdbcType="BIGINT" property="totalFee" />
<result column="act_fee" jdbcType="BIGINT" property="actFee" />
<result column="avg_hour_total_fee" jdbcType="BIGINT" property="avgHourTotalFee" />
<result column="avg_hour_act_fee" jdbcType="BIGINT" property="avgHourActFee" />
<result column="avg_order_total_fee" jdbcType="BIGINT" property="avgOrderTotalFee" />
<result column="avg_order_act_fee" jdbcType="BIGINT" property="avgOrderActFee" />
<result column="avg_berth_total_fee" jdbcType="BIGINT" property="avgBerthTotalFee" />
<result column="avg_berth_act_fee" jdbcType="BIGINT" property="avgBerthActFee" />
<result column="order_num_of_15min" jdbcType="INTEGER" property="orderNumOf15min" />
<result column="order_num_all" jdbcType="INTEGER" property="orderNumAll" />
<result column="order_num_pay" jdbcType="INTEGER" property="orderNumPay" />
<result column="park_duration_of_15min" jdbcType="BIGINT" property="parkDurationOf15min" />
<result column="park_duration_hour_of_15min" jdbcType="BIGINT" property="parkDurationHourOf15min" />
<result column="park_duration_all" jdbcType="BIGINT" property="parkDurationAll" />
<result column="park_duration_hour_all" jdbcType="BIGINT" property="parkDurationHourAll" />
<result column="park_duration_pay" jdbcType="BIGINT" property="parkDurationPay" />
<result column="data_state" jdbcType="INTEGER" property="dataState" />
<result column="create_emp_id" jdbcType="VARCHAR" property="createEmpId" />
<result column="create_emp_name" jdbcType="VARCHAR" property="createEmpName" />
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
<result column="modfiy_emp_id" jdbcType="VARCHAR" property="modfiyEmpId" />
<result column="modfiy_emp_name" jdbcType="VARCHAR" property="modfiyEmpName" />
<result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, check_date, check_date_str, begin_date, end_date, org_id, pl_no, pl_name, berth_num,
eqp_num, berth_no_range, berth_area_range, bill_start_time, bill_end_time, duty_charger_num,
pl_type, pl_type_str, night_bill_berth_no_range, total_fee, act_fee, avg_hour_total_fee,
avg_hour_act_fee, avg_order_total_fee, avg_order_act_fee, avg_berth_total_fee, avg_berth_act_fee,
order_num_of_15min, order_num_all, order_num_pay, park_duration_of_15min, park_duration_hour_of_15min,
park_duration_all, park_duration_hour_all, park_duration_pay, data_state, create_emp_id,
create_emp_name, create_date, modfiy_emp_id, modfiy_emp_name, modfiy_date, remark
</sql>
<select id="statisticIncomeBerthReport"
resultType="com.zteits.clouds.api.dto.order.dto.IncomeBerthReportDTO">
select
ifnull(sum(berth_num),0) berthNum,
ifnull(sum(eqp_num),0) eqpNum,
ifnull(sum(duty_charger_num),0) dutyChargerNum,
ifnull(sum(total_fee),0) totalFee,
ifnull(sum(act_fee),0) actFee,
ifnull(sum(order_num_of_15min),0) orderNumOf15min,
ifnull(sum(order_num_all),0) orderNumAll,
ifnull(sum(order_num_pay),0) orderNumPay,
ifnull(sum(park_duration_of_15min),0) parkDurationOf15min,
ifnull(sum(park_duration_hour_of_15min),0) parkDurationHourOf15min,
ifnull(sum(park_duration_all),0) parkDurationAll,
ifnull(sum(park_duration_hour_all),0) parkDurationHourAll,
ifnull(sum(park_duration_pay),0) parkDurationPay
from income_berth_report
where data_state = 1
and pl_no in
<foreach collection="plNos" item="plNo" open="(" close=")" separator=",">
#{plNo}
</foreach>
and check_date between #{startDate} and #{endDate}
</select>
</mapper>