TpPNetworkCardStatisticMonthSMapper.xml
3.82 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
<?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.TpPNetworkCardStatisticMonthSMapper">
<resultMap id="BaseResultMap" type="com.zteits.park.domain.TpPNetworkCardStatisticMonth">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="card_no" jdbcType="VARCHAR" property="cardNo" />
<result column="eqp_type" jdbcType="INTEGER" property="eqpType" />
<result column="static_date" jdbcType="DATE" property="staticDate" />
<result column="static_date_str" jdbcType="VARCHAR" property="staticDateStr" />
<result column="statistic_begin_time" jdbcType="TIMESTAMP" property="statisticBeginTime" />
<result column="statistic_end_time" jdbcType="TIMESTAMP" property="statisticEndTime" />
<result column="mobile_data_total" jdbcType="BIGINT" property="mobileDataTotal" />
<result column="mobile_data_use" jdbcType="BIGINT" property="mobileDataUse" />
<result column="mobile_data_oxceed" jdbcType="BIGINT" property="mobileDataOxceed" />
<result column="org_id" jdbcType="BIGINT" property="orgId" />
<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="Base_Column_List">
id, card_no, eqp_type, static_date, static_date_str, statistic_begin_time, statistic_end_time,
mobile_data_total, mobile_data_use, mobile_data_oxceed, org_id, data_state, create_emp_id,
create_emp_name, create_date, modfiy_emp_id, modfiy_emp_name, modfiy_date, remark
</sql>
<!-- 物联网卡分页查询 -->
<select id="queryTpPNetworkCardStatisticMonthForPage" parameterType="com.zteits.clouds.api.dto.park.param.TpPNetworkCardStatisticMonthRequest"
resultType="com.zteits.park.domain.TpPNetworkCardStatisticMonth">
select
static_date_str staticDateStr,
eqp_type eqpType,
-- count(1) totalNum,
sum(mobile_data_total) mobileDataTotal,
sum(mobile_data_use) mobileDataUse,
sum(mobile_data_oxceed) mobileDataOxceed
from tp_p_network_card_statistic_month
where data_state = 1
<if test="eqpType != null">
and eqp_type = #{eqpType,jdbcType=INTEGER}
</if>
<if test="orgId != null">
and org_id = #{orgId,jdbcType=BIGINT}
</if>
and static_date_str >= #{beginDateStr} and #{endDateStr} >= static_date_str
group by static_date_str, eqp_type
order by static_date_str desc
</select>
<!-- 物联网卡查询 -->
<select id="queryTpPNetworkCardStatisticMonth" parameterType="com.zteits.clouds.api.dto.park.param.TpPNetworkCardStatisticMonthRequest"
resultType="com.zteits.park.domain.TpPNetworkCardStatisticMonth">
select
eqp_type eqpType,
-- count(1) totalNum,
sum(mobile_data_total) mobileDataTotal,
sum(mobile_data_use) mobileDataUse,
sum(mobile_data_oxceed) mobileDataOxceed
from tp_p_network_card_statistic_month
where data_state = 1
<if test="eqpType != null">
and eqp_type = #{eqpType,jdbcType=INTEGER}
</if>
<if test="orgId != null">
and org_id = #{orgId,jdbcType=BIGINT}
</if>
and static_date_str >= #{beginDateStr} and #{endDateStr} >= static_date_str
group by eqp_type
order by eqp_type
</select>
</mapper>