DropPointInfoMapper.xml
7.53 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?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.trash.dropPointInfo.mapper.DropPointInfoMapper">
<resultMap type="DropPointInfo" id="DropPointInfoResult">
<result property="id" column="id" />
<result property="dropPointName" column="drop_point_name" />
<result property="district" column="district" />
<result property="street" column="street" />
<result property="community" column="community" />
<result property="address" column="address" />
<result property="type" column="type" />
<result property="area" column="area" />
<result property="capacity" column="capacity" />
<result property="managementUnit" column="management_unit" />
<result property="custodian" column="custodian" />
<result property="custodianPhone" column="custodian_phone" />
<result property="dropTime" column="drop_time" />
<result property="dropPointNo" column="drop_point_no" />
<result property="operatingUnit" column="operating_unit" />
<result property="transportUnit" column="transport_unit" />
<result property="coordinatePoint" column="coordinate_point" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="status" column="status" />
<result property="plot" column="plot" />
</resultMap>
<sql id="selectDropPointInfoVo">
select id, drop_point_name, district, street, community, address, type,
area, capacity, management_unit, custodian, custodian_phone,
drop_time, drop_point_no, operating_unit,status,
transport_unit,coordinate_point, create_time, create_by, update_time,
update_by,plot from drop_point_info
</sql>
<select id="selectDropPointInfoList" parameterType="DropPointInfo"
resultMap="DropPointInfoResult">
<include refid="selectDropPointInfoVo" />
<where>
<if test="dropPointName != null and dropPointName != ''"> and drop_point_name like concat('%', #{dropPointName},
'%')</if>
<if test="address != null and address != ''"> and address like concat('%', #{address}, '%')</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="dropPointNo != null and dropPointNo != ''"> and drop_point_no like concat(#{dropPointNo}, '%')</if>
<if test="district != null and district != ''"> and district = #{district}</if>
<if test="street != null and street != ''"> and street = #{street}</if>
<if test="community != null and community != ''"> and community = #{community}</if>
<if test="sList != null and sList.size() > 0 ">
and street in
<foreach item="id" collection="sList" open="(" separator=","
close=")">
#{id}
</foreach>
</if>
</where>
</select>
<select id="selectDropPointInfoListByPhone" parameterType="String"
resultMap="DropPointInfoResult">
<include refid="selectDropPointInfoVo" />
where custodian_phone = #{custodianPhone}
</select>
<select id="selectPhoneByDropPointNo" parameterType="String">
select custodian_phone from drop_point_info where drop_point_no = #{dropPointNo}
</select>
<select id="selectDropPointInfoById" parameterType="Long"
resultMap="DropPointInfoResult">
<include refid="selectDropPointInfoVo" />
where id = #{id}
</select>
<insert id="insertDropPointInfo" parameterType="DropPointInfo"
useGeneratedKeys="true" keyProperty="id">
insert into drop_point_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dropPointName != null">drop_point_name,</if>
<if test="district != null">district,</if>
<if test="street != null">street,</if>
<if test="community != null">community,</if>
<if test="address != null">address,</if>
<if test="type != null">type,</if>
<if test="area != null">area,</if>
<if test="capacity != null">capacity,</if>
<if test="managementUnit != null">management_unit,</if>
<if test="custodian != null">custodian,</if>
<if test="custodianPhone != null">custodian_phone,</if>
<if test="dropTime != null">drop_time,</if>
<if test="dropPointNo != null">drop_point_no,</if>
<if test="operatingUnit != null">operating_unit,</if>
<if test="transportUnit != null">transport_unit,</if>
<if test="coordinatePoint != null">coordinate_point,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="plot != null">plot,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="dropPointName != null">#{dropPointName},</if>
<if test="district != null">#{district},</if>
<if test="street != null">#{street},</if>
<if test="community != null">#{community},</if>
<if test="address != null">#{address},</if>
<if test="type != null">#{type},</if>
<if test="area != null">#{area},</if>
<if test="capacity != null">#{capacity},</if>
<if test="managementUnit != null">#{managementUnit},</if>
<if test="custodian != null">#{custodian},</if>
<if test="custodianPhone != null">#{custodianPhone},</if>
<if test="dropTime != null">#{dropTime},</if>
<if test="dropPointNo != null">#{dropPointNo},</if>
<if test="operatingUnit != null">#{operatingUnit},</if>
<if test="transportUnit != null">#{transportUnit},</if>
<if test="coordinatePoint != null">#{coordinatePoint},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="plot != null">#{plot},</if>
</trim>
</insert>
<update id="updateDropPointInfo" parameterType="DropPointInfo">
update drop_point_info
<trim prefix="SET" suffixOverrides=",">
<if test="dropPointName != null">drop_point_name = #{dropPointName},</if>
<if test="district != null">district = #{district},</if>
<if test="street != null">street = #{street},</if>
<if test="community != null">community = #{community},</if>
<if test="address != null">address = #{address},</if>
<if test="type != null">type = #{type},</if>
<if test="area != null">area = #{area},</if>
<if test="capacity != null">capacity = #{capacity},</if>
<if test="managementUnit != null">management_unit = #{managementUnit},</if>
<if test="custodian != null">custodian = #{custodian},</if>
<if test="custodianPhone != null">custodian_phone = #{custodianPhone},</if>
<if test="dropTime != null">drop_time = #{dropTime},</if>
<if test="dropPointNo != null">drop_point_no = #{dropPointNo},</if>
<if test="operatingUnit != null">operating_unit = #{operatingUnit},</if>
<if test="transportUnit != null">transport_unit = #{transportUnit},</if>
<if test="coordinatePoint != null">coordinate_point = #{coordinatePoint},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="plot != null">plot = #{plot},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDropPointInfoById" parameterType="Long">
delete from drop_point_info where id = #{id}
</delete>
<delete id="deleteDropPointInfoByIds" parameterType="String">
delete from drop_point_info where id in
<foreach item="id" collection="array" open="(" separator=","
close=")">
#{id}
</foreach>
</delete>
</mapper>