TdClParkRuleCollectRelSMapper.xml
4.7 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
<?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.bill.mapper.smapper.TdClParkRuleCollectRelSMapper">
<resultMap id="BaseResultMap" type="com.zteits.bill.domain.TdClParkRuleCollectRel">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="city_id" jdbcType="BIGINT" property="cityId" />
<result column="pl_no" jdbcType="VARCHAR" property="plNo" />
<result column="area_id" jdbcType="BIGINT" property="areaId" />
<result column="rule_collect_id" jdbcType="VARCHAR" property="ruleCollectId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="pro_id" jdbcType="BIGINT" property="proId" />
<result column="country_id" jdbcType="BIGINT" property="countryId" />
<result column="city_name" jdbcType="VARCHAR" property="cityName" />
<result column="country_name" jdbcType="VARCHAR" property="countryName" />
<result column="pro_name" jdbcType="VARCHAR" property="proName" />
</resultMap>
<select id="queryParkingBindingChargingAreas" parameterType="com.zteits.clouds.api.dto.bill.closecarpark.param.QueryParkingBindingByPlNoRequest"
resultType="com.zteits.clouds.api.dto.bill.closecarpark.dto.ParkBindChargingAreasDTO">
SELECT
r.pl_no plNo,
c.rule_collect_name ruleCollectName,
r.area_id areaId
FROM
td_cl_park_rule_collect_rel r
LEFT JOIN td_cl_rule_collect c on r.rule_collect_id = c.rule_collect_id
where 1=1
<if test="plNo != null and plNo !=''">
and r.pl_no =#{plNo}
</if>
</select>
<select id="viewParkingBindingChargingAreas" parameterType="com.zteits.clouds.api.dto.bill.closecarpark.param.ViewParkingBindingChargingRequest"
resultType="com.zteits.clouds.api.dto.bill.closecarpark.dto.ViewParkBindChargingDTO">
SELECT
r.pl_no plNo,
c.rule_collect_name ruleCollectName,
r.area_id areaId,
c.rule_desc ruleDesc,
r.rule_collect_id ruleCollectId
FROM
td_cl_park_rule_collect_rel r
LEFT JOIN td_cl_rule_collect c on r.rule_collect_id = c.rule_collect_id
where r.area_id = #{areaId}
</select>
<!-- 查询停车场绑定计费规则 -->
<select id="queryParkingBindingChargingRules" parameterType="com.zteits.clouds.api.dto.bill.closecarpark.param.QueryParkingBindingChargingRequest"
resultType="com.zteits.clouds.api.dto.bill.closecarpark.dto.ParkBindChargingDTO">
select
r.pro_id proId,
r.pro_name proName,
r.country_id countryId,
r.country_name countryName,
r.city_id cityId,
r.city_name cityName,
r.pl_no plNo,
r.id,
r.area_id areaId,
GROUP_CONCAT(c.rule_collect_name) ruleCollectName,
c.fee_type feeType
FROM
td_cl_park_rule_collect_rel r
LEFT JOIN td_cl_rule_collect c on r.rule_collect_id = c.rule_collect_id
where 1=1
<if test="orgId != null and orgId != ''">
and c.org_id = #{orgId}
</if>
<if test="plNo != null and plNo != ''">
and r.pl_no = #{plNo}
</if>
<if test="proId != null and proId != ''">
and r.pro_id = #{proId}
</if>
<if test="cityId != null and cityId != ''">
and r.city_id = #{cityId}
</if>
<if test="countryId != null and countryId != ''">
and r.country_id = #{countryId}
</if>
<if test="ruleCollectName != null and ruleCollectName != ''">
AND c.rule_collect_name like concat('%',#{ruleCollectName,jdbcType=VARCHAR},'%')
</if>
group by r.pl_no
</select>
<select id="queryBindingAreaRulesList" parameterType="com.zteits.clouds.api.dto.bill.closecarpark.param.QueryParkingBindingAreaRequest"
resultType="com.zteits.clouds.api.dto.bill.closecarpark.dto.ParkBindAreasListDTO">
select
r.pro_id proId,
r.pro_name proName,
r.country_id countryId,
r.country_name countryName,
r.city_id cityId,
r.city_name cityName,
r.pl_no plNo,
r.id,
r.area_id areaId,
r.rule_collect_id ruleCollectId,
c.rule_collect_name ruleCollectName,
c.fee_type feeType
FROM
td_cl_park_rule_collect_rel r
LEFT JOIN td_cl_rule_collect c on r.rule_collect_id = c.rule_collect_id
where 1=1
<if test="plNo != null and plNo != ''">
AND r.pl_no = #{plNo}
</if>
</select>
</mapper>