|
@@ -40,6 +40,7 @@
|
|
|
<result property="last_login_uuid" column="last_login_uuid" />
|
|
|
<result property="last_login_time" column="last_login_time" />
|
|
|
<result property="is_super" column="is_super" javaType="java.lang.Integer" />
|
|
|
+ <result property="integral" column="integral" javaType="java.lang.Integer" />
|
|
|
<result property="point_balance" column="point_balance" javaType="java.lang.Float" />
|
|
|
<result property="invite_code" column="invite_code" />
|
|
|
<result property="status" column="status" javaType="java.lang.Integer"/>
|
|
@@ -54,43 +55,29 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="selectUserList" resultMap="resultMapUserList">
|
|
|
- SELECT <include refid="includeUser" />, urr.role_id role_id
|
|
|
+ SELECT
|
|
|
+ <include refid="includeUser" />,
|
|
|
+ urr.role_id role_id,
|
|
|
+ COALESCE(ui.integral, 0) integral
|
|
|
FROM sys_user_info uf
|
|
|
LEFT JOIN sys_user u ON u.id = uf.user_id
|
|
|
LEFT JOIN sys_user_role_relation urr ON uf.user_id = urr.user_id
|
|
|
+ LEFT JOIN sys_user_integral ui ON uf.user_id = ui.user_id
|
|
|
<where>
|
|
|
AND u.id != 1
|
|
|
AND uf.del_flag != 1
|
|
|
- <if test="username != null and username != ''">
|
|
|
- AND u.username LIKE CONCAT('%', #{username}, '%')
|
|
|
- </if>
|
|
|
- <if test="phone != null and phone != ''">
|
|
|
- AND u.phone LIKE CONCAT('%', #{phone}, '%')
|
|
|
- </if>
|
|
|
- <if test="phone_area_code != null and phone_area_code != ''">
|
|
|
- AND u.phone_area_code = #{phone_area_code}
|
|
|
- </if>
|
|
|
- <if test="nickname != null and nickname != ''">
|
|
|
- AND uf.nickname LIKE CONCAT('%', #{nickname}, '%')
|
|
|
- </if>
|
|
|
- <if test="email != null and email != ''">
|
|
|
- AND uf.email LIKE CONCAT('%', #{email}, '%')
|
|
|
- </if>
|
|
|
- <if test="status != null and status != ''">
|
|
|
- AND uf.status = #{status}
|
|
|
- </if>
|
|
|
- <if test="audit_status != null and audit_status != ''">
|
|
|
- AND uf.audit_status = #{audit_status}
|
|
|
- </if>
|
|
|
+ <if test="username != null and username != ''">AND u.username LIKE CONCAT('%', #{username}, '%')</if>
|
|
|
+ <if test="phone != null and phone != ''">AND u.phone LIKE CONCAT('%', #{phone}, '%')</if>
|
|
|
+ <if test="phone_area_code != null and phone_area_code != ''">AND u.phone_area_code = #{phone_area_code}</if>
|
|
|
+ <if test="nickname != null and nickname != ''">AND uf.nickname LIKE CONCAT('%', #{nickname}, '%')</if>
|
|
|
+ <if test="email != null and email != ''">AND uf.email LIKE CONCAT('%', #{email}, '%')</if>
|
|
|
+ <if test="status != null and status != ''">AND uf.status = #{status}</if>
|
|
|
+ <if test="audit_status != null and audit_status != ''">AND uf.audit_status = #{audit_status}</if>
|
|
|
<if test="role_id != null and role_id != ''">
|
|
|
AND urr.role_id IN
|
|
|
- <foreach collection="role_id" item="role" open="(" separator="," close=")">
|
|
|
- #{role}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="is_super != null and is_super != ''">
|
|
|
- AND uf.is_super = #{is_super}
|
|
|
+ <foreach collection="role_id" item="role" open="(" separator="," close=")">#{role}</foreach>
|
|
|
</if>
|
|
|
+ <if test="is_super != null and is_super != ''">AND uf.is_super = #{is_super}</if>
|
|
|
</where>
|
|
|
ORDER BY uf.create_time DESC
|
|
|
</select>
|