Commit 56a325c0 authored by hanfeng's avatar hanfeng

修改用户列表

parent 436702b8
...@@ -23,4 +23,7 @@ public interface AppUserDetailMapper extends Mapper<AppUserDetail> { ...@@ -23,4 +23,7 @@ public interface AppUserDetailMapper extends Mapper<AppUserDetail> {
List<Integer> getUserIdByUsername(@Param("keywords") String keywords); List<Integer> getUserIdByUsername(@Param("keywords") String keywords);
List<AppUserVo> getUserVo(@Param("list") List<Integer> ids); List<AppUserVo> getUserVo(@Param("list") List<Integer> ids);
List<AppUserManageVo> selectAppUser(AppUserManageDTO appUserManageDTO);
} }
\ No newline at end of file
...@@ -49,23 +49,24 @@ ...@@ -49,23 +49,24 @@
<!-- 获取用户信息 --> <!-- 获取用户信息 -->
<select id="getUserVo" resultMap="AppUserVoMap"> <select id="getUserVo" resultMap="AppUserVoMap">
select l.im_userid,l.username,l.wx_openid,l.unionid,l.openid,l.status,l.id_number,l.certification_status,d.*,p.name as jobTitle,buml.name as memberName from app_user_login l select
left join app_user_detail d l.im_userid,l.username,l.wx_openid,l.unionid,l.openid,l.status,l.id_number,l.certification_status,d.*,p.name as
on d.userid = l.id jobTitle,buml.name as memberName from app_user_login l
left join base_user_member bum left join app_user_detail d
on bum.user_id=l.id on d.userid = l.id
left join (select level, name from base_user_member_level level where isdel = 0) buml left join base_user_member bum
on bum.member_level = buml.level on bum.user_id=l.id
left join (select id, name from app_user_position where is_del=0) p left join (select level, name from base_user_member_level level where isdel = 0) buml
on d.position_id=p.id on bum.member_level = buml.level
where left join (select id, name from app_user_position where is_del=0) p
d.userid in on d.position_id=p.id
where
<foreach collection="list" item="userId" index="index" open="(" separator="," close=")" > d.userid in
#{userId} <foreach collection="list" item="userId" index="index" open="(" separator="," close=")">
</foreach> #{userId}
</foreach>
</select> </select>
<select id="getUserIdByUsername" resultType="java.lang.Integer" parameterType="java.lang.String"> <select id="getUserIdByUsername" resultType="java.lang.Integer" parameterType="java.lang.String">
...@@ -190,15 +191,15 @@ ...@@ -190,15 +191,15 @@
and d.source = #{source} and d.source = #{source}
</if> </if>
<if test="userId!=null"> <if test="userId!=null">
and l.id=#{userId} and l.id=#{userId}
</if> </if>
<if test="realName !=null and realName != ''"> <if test="realName !=null and realName != ''">
and d.realname like CONCAT('%',#{realName},'%') and d.realname like CONCAT('%',#{realName},'%')
</if> </if>
<if test="citySet != null "> <if test="citySet != null ">
and d.city_code in and d.city_code in
<foreach collection="citySet" item="item" index="index" open="(" separator="," close=")" > <foreach collection="citySet" item="item" index="index" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
order by l.id ASC order by l.id ASC
...@@ -210,4 +211,77 @@ ...@@ -210,4 +211,77 @@
<update id="updateUserPositionByUserId"> <update id="updateUserPositionByUserId">
update `app_user_detail` set `position_id`=#{positionId} where `userid`=#{userId} update `app_user_detail` set `position_id`=#{positionId} where `userid`=#{userId}
</update> </update>
<select id="selectAppUser" parameterType="com.github.wxiaoqi.security.admin.dto.AppUserManageDTO"
resultType="com.github.wxiaoqi.security.admin.vo.AppUserManageVo">
select
-- l.id As userid,
-- l.username,
-- d.channel,
-- d.source,
-- d.realname,
-- ml.name as memberName,
-- aup.name as positionName,
-- IFNULL(pd.realname,pd.nickname) as nameOfSuperior,
-- pl.username AS superiorMobileNumber,
-- m.crt_time as timeOfMembership,
-- m.total_number as totalNumber,
-- m.rent_free_days as rentFreeDays
*
from
app_user_login l
LEFT JOIN app_user_detail on d.userid = l.id
LEFT JOIN base_user_member m ON l.id = m.user_id
-- LEFT JOIN (select * from base_user_member_level where ml.isdel=0 ) ml ON ml.level = m.member_level
-- LEFT JOIN app_user_position aup ON aup.id = d.position_id
-- LEFT JOIN (select * from app_user_relation where is_del=0) r ON l.id=r.user_id
-- LEFT JOIN (select * from app_user_login where isdel = 0) pl ON r.parent_id = l.id
-- LEFT JOIN app_user_detail pd ON pl.id = pd.userid
where l.isdel = 0
<if test="mobile !=null and mobile !='' ">
and l.username like CONCAT('%',#{mobile},'%')
</if>
<if test="channel !=null ">
and d.channel=#{channel}
</if>
<if test="memberLevel !=null and memberLevel != -1">
and m.member_level = #{memberLevel}
</if>
<if test="memberLevel == -1">
and m.member_level in (select level from base_user_member_level)
</if>
<if test="registrationTimeBegin !=null ">
and l.createtime &gt;= #{registrationTimeBegin}
</if>
<if test="registrationTimeEnd !=null ">
and l.createtime &lt;= #{registrationTimeEnd}
</if>
<if test="source !=null ">
and d.source = #{source}
</if>
<if test="userId!=null">
and l.id=#{userId}
</if>
<if test="postionState != null">
<choose>
<when test="postionState == 6">
and d.position_id =#{postionState}
</when>
<otherwise>
and <![CDATA[d.`position_id`<>6]]>
</otherwise>
</choose>
</if>
<if test="realName !=null and realName != ''">
and d.realname like CONCAT('%',#{realName},'%')
</if>
<if test="citySet != null ">
and d.city_code in
<foreach collection="citySet" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
order by l.id ASC
</select>
</mapper> </mapper>
\ No newline at end of file
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