|
@@ -16,6 +16,9 @@
|
16
|
16
|
<result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
|
17
|
17
|
<result column="update_user" property="updateUser" jdbcType="INTEGER" />
|
18
|
18
|
<result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
|
|
19
|
+ <result column="province" property="province" jdbcType="VARCHAR" />
|
|
20
|
+ <result column="city" property="city" jdbcType="VARCHAR" />
|
|
21
|
+ <result column="district" property="district" jdbcType="VARCHAR" />
|
19
|
22
|
</resultMap>
|
20
|
23
|
<sql id="Base_Column_List" >
|
21
|
24
|
id, community_name, community_alias, province_id, city_id, district_id, longitude,
|
|
@@ -72,6 +75,18 @@
|
72
|
75
|
<if test="loginName != null" >
|
73
|
76
|
login_name,
|
74
|
77
|
</if>
|
|
78
|
+ <if test="createUser != null" >
|
|
79
|
+ create_user,
|
|
80
|
+ </if>
|
|
81
|
+ <if test="createDate != null" >
|
|
82
|
+ create_date,
|
|
83
|
+ </if>
|
|
84
|
+ <if test="updateUser != null" >
|
|
85
|
+ update_user,
|
|
86
|
+ </if>
|
|
87
|
+ <if test="updateDate != null" >
|
|
88
|
+ update_date,
|
|
89
|
+ </if>
|
75
|
90
|
</trim>
|
76
|
91
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
77
|
92
|
<if test="id != null" >
|
|
@@ -104,6 +119,18 @@
|
104
|
119
|
<if test="loginName != null" >
|
105
|
120
|
#{loginName,jdbcType=VARCHAR},
|
106
|
121
|
</if>
|
|
122
|
+ <if test="createUser != null" >
|
|
123
|
+ #{createUser,jdbcType=INTEGER},
|
|
124
|
+ </if>
|
|
125
|
+ <if test="createDate != null" >
|
|
126
|
+ #{createDate,jdbcType=TIMESTAMP},
|
|
127
|
+ </if>
|
|
128
|
+ <if test="updateUser != null" >
|
|
129
|
+ #{updateUser,jdbcType=INTEGER},
|
|
130
|
+ </if>
|
|
131
|
+ <if test="updateDate != null" >
|
|
132
|
+ #{updateDate,jdbcType=TIMESTAMP},
|
|
133
|
+ </if>
|
107
|
134
|
</trim>
|
108
|
135
|
</insert>
|
109
|
136
|
<update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.ToCommunities" >
|
|
@@ -152,25 +179,45 @@
|
152
|
179
|
</update>
|
153
|
180
|
|
154
|
181
|
<select id="selectByCommunityName" resultMap="BaseResultMap" parameterType="com.community.huiju.model.ToCommunities" >
|
155
|
|
- select
|
156
|
|
- <include refid="Base_Column_List" />
|
157
|
|
- from to_communities
|
|
182
|
+ SELECT
|
|
183
|
+ c.id,
|
|
184
|
+ c.community_name,
|
|
185
|
+ c.community_alias,
|
|
186
|
+ c.province_id,
|
|
187
|
+ c.city_id,
|
|
188
|
+ c.district_id,
|
|
189
|
+ c.longitude,
|
|
190
|
+ c.latitude,
|
|
191
|
+ c.user_name,
|
|
192
|
+ c.login_name,
|
|
193
|
+ c.create_user,
|
|
194
|
+ c.create_date,
|
|
195
|
+ c.update_user,
|
|
196
|
+ c.update_date,
|
|
197
|
+ n.province,
|
|
198
|
+ a.city,
|
|
199
|
+ t.district
|
|
200
|
+ FROM
|
|
201
|
+ to_communities c
|
|
202
|
+ LEFT JOIN sys_nation n ON c.province_id = n.id
|
|
203
|
+ LEFT JOIN sys_nation a ON c.city_id = a.id
|
|
204
|
+ LEFT JOIN sys_nation t ON c.district_id = t.id
|
158
|
205
|
where 1=1
|
159
|
206
|
<if test="communityName != null and communityName != ''" >
|
160
|
|
- and community_name like concat('%',#{communityName,jdbcType=VARCHAR},'%')
|
|
207
|
+ and c.community_name like concat('%',#{communityName,jdbcType=VARCHAR},'%')
|
161
|
208
|
</if>
|
162
|
209
|
<if test="id != null and id != ''" >
|
163
|
|
- and id like concat('%',#{id,jdbcType=INTEGER},'%')
|
|
210
|
+ and c.id like concat('%',#{id,jdbcType=INTEGER},'%')
|
164
|
211
|
</if>
|
165
|
212
|
<if test="provinceId != null and provinceId != ''" >
|
166
|
|
- and province_id = #{provinceId,jdbcType=INTEGER}
|
|
213
|
+ and c.province_id = #{provinceId,jdbcType=INTEGER}
|
167
|
214
|
</if>
|
168
|
215
|
<if test="cityId != null and cityId != ''" >
|
169
|
|
- and city_id = #{cityId,jdbcType=INTEGER}
|
|
216
|
+ and c.city_id = #{cityId,jdbcType=INTEGER}
|
170
|
217
|
</if>
|
171
|
218
|
<if test="districtId != null and districtId != ''" >
|
172
|
|
- and district_id = #{districtId,jdbcType=INTEGER}
|
|
219
|
+ and c.district_id = #{districtId,jdbcType=INTEGER}
|
173
|
220
|
</if>
|
174
|
|
- order by create_date desc
|
|
221
|
+ order by c.create_date desc
|
175
|
222
|
</select>
|
176
|
223
|
</mapper>
|