Commit 32459924 authored by cy's avatar cy

用户导出修改(连表查询数据重复)

parent 2be76777
......@@ -163,13 +163,14 @@
</select>
<select id="getListQuery" parameterType="map" resultMap="ExBaseResultMap">
SELECT u.id, u.user_name, u.PASSWORD, u.phone, u.uuid, u.head_image, u.sex, u.school, u.exam_type, u.source, u.is_delete, u.create_time,
u.update_time, u.is_vip, u.openid, u.vip_mobile,u.last_login_time,
s.culture_grade, s.major_grade, ul.usable_limit
SELECT ANY_VALUE(u.id), ANY_VALUE(u.user_name), ANY_VALUE(u.PASSWORD), ANY_VALUE(u.phone), ANY_VALUE(u.uuid),
ANY_VALUE(u.head_image), ANY_VALUE(u.sex), ANY_VALUE(u.school), ANY_VALUE(u.exam_type), ANY_VALUE(u.source),
ANY_VALUE(u.is_delete), ANY_VALUE(u.create_time),ANY_VALUE(u.update_time), ANY_VALUE(u.is_vip), ANY_VALUE(u.openid),
ANY_VALUE(u.vip_mobile),ANY_VALUE(u.last_login_time),ANY_VALUE(s.culture_grade), ANY_VALUE(s.major_grade), ANY_VALUE(ul.usable_limit)
FROM `user` u LEFT JOIN score s ON s.user_id = u.id
LEFT JOIN user_limit ul ON ul.user_id = u.id
<where>
is_delete=0 and is_vip = 2
u.is_delete=0 and u.is_vip = 2
<if test="startTime != null">
and u.create_time
between #{startTime}
......@@ -177,7 +178,8 @@
<if test="endTime != null">and #{endTime}</if>
<if test="userName != null and userName !=''">and user_name like ('%' #{userName} '%')</if>
<if test="phone != null and phone !=''">and phone like ('%' #{phone} '%')</if>
order by create_time desc
GROUP BY u.id
order by u.create_time desc
<if test="pageNo != null">
limit #{pageNo},#{pageSize}
</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment