Commit 4f9620d1 authored by unset's avatar unset

新增违章查询接口

parent 6b82b4d8
...@@ -74,6 +74,11 @@ public class AppUserManageDTO { ...@@ -74,6 +74,11 @@ public class AppUserManageDTO {
*/ */
private String realName; private String realName;
/**
* 昵称
*/
private String nickname;
/** /**
* 注册来源 * 注册来源
......
...@@ -41,11 +41,12 @@ ...@@ -41,11 +41,12 @@
<!-- 获取用户信息 --> <!-- 获取用户信息 -->
<select id="getUserInfo" resultMap="AppUserVoMap"> <select id="getUserInfo" resultMap="AppUserVoMap">
select l.im_userid,l.username,l.wx_openid,l.unionid,l.openid,l.status,l.id_number,l.certification_status,d.* from app_user_login l select l.im_userid,l.username,l.wx_openid,l.unionid,l.openid,l.status,l.id_number,l.certification_status,d.*
left join app_user_detail d from app_user_login l
on d.userid = l.id left join app_user_detail d
where d.userid = #{userId} limit 1 on d.userid = l.id
</select> where d.userid = #{userId} limit 1
</select>
<!-- 获取用户信息 --> <!-- 获取用户信息 -->
...@@ -71,8 +72,8 @@ ...@@ -71,8 +72,8 @@
<select id="getUserIdByUsername" resultType="java.lang.Integer" parameterType="java.lang.String"> <select id="getUserIdByUsername" resultType="java.lang.Integer" parameterType="java.lang.String">
select d.userid from app_user_login l select d.userid from app_user_login l
left join app_user_detail d left join app_user_detail d
on d.userid = l.id on d.userid = l.id
where d.realname like concat("%", #{keywords}, "%") or l.username like concat("%", #{keywords}, "%") where d.realname like concat("%", #{keywords}, "%") or l.username like concat("%", #{keywords}, "%")
</select> </select>
...@@ -80,78 +81,78 @@ ...@@ -80,78 +81,78 @@
<select id="selectAppUserManage" parameterType="Integer" <select id="selectAppUserManage" parameterType="Integer"
resultType="com.github.wxiaoqi.security.admin.vo.AppUserManageVo"> resultType="com.github.wxiaoqi.security.admin.vo.AppUserManageVo">
SELECT SELECT
l.id AS userid, l.id AS userid,
l.username, l.username,
l.certification_status AS certificationStatus, l.certification_status AS certificationStatus,
l.id_number AS idNumber, l.id_number AS idNumber,
l.createtime, l.createtime,
l.last_time AS lastTime, l.last_time AS lastTime,
l. STATUS, l. STATUS,
z.mark_name AS markName, z.mark_name AS markName,
d.channel, d.channel,
d.register_source, d.register_source,
d.is_member, d.is_member,
d.realname, d.realname,
d.nickname, d.nickname,
d.source, d.source,
d.province_code AS provinceCode, d.province_code AS provinceCode,
d.city_code AS cityCode, d.city_code AS cityCode,
d.sex, d.sex,
d.headimgurl, d.headimgurl,
d.email, d.email,
m.valid_time AS validTime, m.valid_time AS validTime,
m.buy_count AS buyCount, m.buy_count AS buyCount,
m.total_number AS totalNumber, m.total_number AS totalNumber,
m.rent_free_days AS rentFreeDays, m.rent_free_days AS rentFreeDays,
m.crt_time AS timeOfMembership, m.crt_time AS timeOfMembership,
m.recent_recharge AS recentRecharge, m.recent_recharge AS recentRecharge,
ml.NAME AS memberName, ml.NAME AS memberName,
m.member_type, m.member_type,
aup. NAME AS `positionName`, aup. NAME AS `positionName`,
ul.username AS inviter, ul.username AS inviter,
IFNULL(pd.realname, pd.nickname) AS nameOfSuperior, IFNULL(pd.realname, pd.nickname) AS nameOfSuperior,
pl.username AS superiorMobileNumber pl.username AS superiorMobileNumber
FROM FROM
app_user_login l app_user_login l
LEFT JOIN app_user_detail d ON d.userid = l.id LEFT JOIN app_user_detail d ON d.userid = l.id
LEFT JOIN app_user_login ul ON ul.id = d.inviter_account LEFT JOIN app_user_login ul ON ul.id = d.inviter_account
LEFT JOIN base_user_member m ON d.userid = m.user_id LEFT JOIN base_user_member m ON d.userid = m.user_id
LEFT JOIN chw_app.app_version_mark z ON z.mark = d.register_source LEFT JOIN chw_app.app_version_mark z ON z.mark = d.register_source
LEFT JOIN LEFT JOIN
( (
SELECT SELECT
LEVEL, LEVEL,
NAME NAME
FROM FROM
base_user_member_level base_user_member_level
WHERE WHERE
isdel = 0 isdel = 0
) ml ON m.member_level = ml. LEVEL ) ml ON m.member_level = ml. LEVEL
LEFT JOIN app_user_position aup ON aup.id = d.position_id LEFT JOIN app_user_position aup ON aup.id = d.position_id
LEFT JOIN LEFT JOIN
( (
SELECT SELECT
user_id, user_id,
parent_id parent_id
FROM FROM
app_user_relation app_user_relation
WHERE WHERE
is_del = 0 is_del = 0
) r ON l.id = r.user_id ) r ON l.id = r.user_id
LEFT JOIN app_user_login pl ON r.parent_id = pl.id LEFT JOIN app_user_login pl ON r.parent_id = pl.id
LEFT JOIN app_user_detail pd ON pl.id = pd.userid LEFT JOIN app_user_detail pd ON pl.id = pd.userid
WHERE WHERE
d.channel>0 d.channel>0
and and
l.id = #{userId} l.id = #{userId}
</select> </select>
<update id="updateUserMemberStatusByUserId"> <update id="updateUserMemberStatusByUserId">
update `app_user_detail` set `is_member`={status} where `userid`=#{userId} update `app_user_detail` set `is_member`={status} where `userid`=#{userId}
</update> </update>
<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" <select id="selectAppUser" parameterType="com.github.wxiaoqi.security.admin.dto.AppUserManageDTO"
resultType="com.github.wxiaoqi.security.admin.vo.AppUserManageVo"> resultType="com.github.wxiaoqi.security.admin.vo.AppUserManageVo">
...@@ -162,6 +163,7 @@ ...@@ -162,6 +163,7 @@
d.register_source, d.register_source,
d.source, d.source,
d.realname, d.realname,
d.nickname,
z.mark_name AS markName, z.mark_name AS markName,
ml. NAME AS memberName, ml. NAME AS memberName,
aup. NAME AS positionName, aup. NAME AS positionName,
...@@ -215,6 +217,7 @@ ...@@ -215,6 +217,7 @@
<if test="memberLevel == -1"> <if test="memberLevel == -1">
and m.member_level in (select level from base_user_member_level) and m.member_level in (select level from base_user_member_level)
</if> </if>
<if test="registrationTimeBegin !=null "> <if test="registrationTimeBegin !=null ">
and l.createtime &gt;= #{registrationTimeBegin} and l.createtime &gt;= #{registrationTimeBegin}
</if> </if>
...@@ -240,6 +243,9 @@ ...@@ -240,6 +243,9 @@
<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="nickname !=null and nickname != ''">
and d.nickname, like CONCAT('%',#{nickname},'%')
</if>
<if test="citySet != null and citySet.size > 0 "> <if test="citySet != null and citySet.size > 0 ">
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=")">
...@@ -251,10 +257,12 @@ ...@@ -251,10 +257,12 @@
<!--查询非普通用户--> <!--查询非普通用户-->
<select id="selectAllStaffs" resultType="com.github.wxiaoqi.security.admin.bo.UserStaffBo"> <select id="selectAllStaffs" resultType="com.github.wxiaoqi.security.admin.bo.UserStaffBo">
select aud.userid as `userId`,aud.realname as `realName`,aud.nickname as `nickName`,aul.username as `phone`,aud.position_id as `postionId`,aup.name as `postionName`,aupt.company_id as `companyId`,aupt.company_name as `companyName` select aud.userid as `userId`,aud.realname as `realName`,aud.nickname as `nickName`,aul.username as
from `app_user_detail` as `aud` left join `app_user_login` as `aul` on aul.id=aud.userid `phone`,aud.position_id as `postionId`,aup.name as `postionName`,aupt.company_id as
left join `app_user_position_temp` as `aupt` on aupt.user_id=aul.id `companyId`,aupt.company_name as `companyName`
left join `app_user_position` as `aup` on aup.id=aud.position_id from `app_user_detail` as `aud` left join `app_user_login` as `aul` on aul.id=aud.userid
left join `app_user_position_temp` as `aupt` on aupt.user_id=aul.id
left join `app_user_position` as `aup` on aup.id=aud.position_id
where <![CDATA[aud.position_id<>6]]> and aud.isdel=0 where <![CDATA[aud.position_id<>6]]> and aud.isdel=0
</select> </select>
<select id="getUserByUserIdList" resultMap="AppUserVoMap"> <select id="getUserByUserIdList" resultMap="AppUserVoMap">
...@@ -342,36 +350,42 @@ from `app_user_detail` as `aud` left join `app_user_login` as `aul` on aul.id= ...@@ -342,36 +350,42 @@ from `app_user_detail` as `aud` left join `app_user_login` as `aul` on aul.id=
order by sell.sellAmount desc order by sell.sellAmount desc
</select> </select>
<select id="getUser" resultMap="AppUserVoMap"> <select id="getUser" resultMap="AppUserVoMap">
select l.im_userid,l.username,l.wx_openid,l.unionid,l.openid,l.status,l.id_number,l.certification_status,d.* from app_user_login l select l.im_userid,l.username,l.wx_openid,l.unionid,l.openid,l.status,l.id_number,l.certification_status,d.*
left join app_user_detail d from app_user_login l
on d.userid = l.id left join app_user_detail d
where l.id = #{userId} limit 1 on d.userid = l.id
</select> where l.id = #{userId} limit 1
</select>
<select id="findUserBosByPhones" resultType="com.github.wxiaoqi.security.admin.bo.UserBo"> <select id="findUserBosByPhones" resultType="com.github.wxiaoqi.security.admin.bo.UserBo">
select aul.id as `userId`,aul.username as `phone`,IFNULL(aud.realname,aud.nickname) as `name` from (select `id`,`username` from `app_user_login` select aul.id as `userId`,aul.username as `phone`,IFNULL(aud.realname,aud.nickname) as `name` from (select
`id`,`username` from `app_user_login`
<if test="phones!=null and phones.size()>0"> <if test="phones!=null and phones.size()>0">
where username in where username in
<foreach collection="phones" item="phone" open="(" close=")" separator=","> <foreach collection="phones" item="phone" open="(" close=")" separator=",">
#{phone} #{phone}
</foreach> </foreach>
</if>) as aul inner join `app_user_detail` as aud on aud.userid=aul.id </if>
) as aul inner join `app_user_detail` as aud on aud.userid=aul.id
</select> </select>
<select id="selectAllWithNoProviinceCode" <select id="selectAllWithNoProviinceCode"
resultType="com.github.wxiaoqi.security.admin.entity.AppUserDetail"> resultType="com.github.wxiaoqi.security.admin.entity.AppUserDetail">
select `id`,`crt_host` from `app_user_detail` where crt_host is not null and ( province_code = 0 or province_code is null) select `id`,`crt_host` from `app_user_detail` where crt_host is not null and ( province_code = 0 or
province_code is null)
</select> </select>
<select id="selectUserByUserIds" resultType="com.github.wxiaoqi.security.admin.bo.UserBo"> <select id="selectUserByUserIds" resultType="com.github.wxiaoqi.security.admin.bo.UserBo">
select aud.userid as `userId`,case when length(aud.realname)>0 then aud.realname else aud.nickname end as `name`,aul.username as `phone` from `app_user_detail` as aud left join `app_user_login` as aul on aul.id=aud.userid select aud.userid as `userId`,case when length(aud.realname)>0 then aud.realname else aud.nickname end as
`name`,aul.username as `phone` from `app_user_detail` as aud left join `app_user_login` as aul on
aul.id=aud.userid
<where> <where>
<if test="userIds != null and userIds.size() != 0"> <if test="userIds != null and userIds.size() != 0">
userid in userid in
<foreach collection="userIds" item="userId" open="(" close=")" separator=","> <foreach collection="userIds" item="userId" open="(" close=")" separator=",">
#{userId} #{userId}
</foreach> </foreach>
</if> </if>
</where> </where>
</select> </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