123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.huiju.estateagents.center.taUser.mapper.TaUserMapper">
-
- <select id="getPageList" resultType="map">
- SELECT
- t.user_id AS userId,
- t.org_id AS orgId,
- t.user_name AS userName,
- t.login_name AS loginName,
- t.phone,
- t.avatar,
- t.create_date AS createDate,
- t.status,
- o.NAME AS orgName,
- o.address,
- o.logo,
- o.remark,
- m.miniapp_id AS miniappId,
- m.secret,
- m.token,
- m.NAME AS miniappName,
- m.qr_code AS qrCode,
- t.exp_date as expire_date,
- m.org_id
- FROM
- ta_user t
- LEFT JOIN ta_org o ON t.org_id = o.org_id
- LEFT JOIN ta_miniapp m ON o.org_id = m.org_id
- left join ta_channel_app_relation n on o.org_id = n.org_id
- left join ta_channel_proxy z on z.channel_id = n.channel_id
- WHERE
- t.is_admin =1
- <if test="channelId != null and channelId != ''">
- and n.channel_id = #{channelId}
- </if>
- </select>
-
- <select id="getTagsList" resultType="com.huiju.estateagents.center.taUser.entity.TaTags">
- SELECT
- t.*
- FROM
- ta_tag_user u
- LEFT JOIN ta_tags t ON u.tag_id = t.tag_id
- AND t.org_id = #{orgId}
- WHERE
- u.user_id = #{userId}
- </select>
-
- <select id="getUserList" resultType="com.huiju.estateagents.center.taUser.entity.TaUser">
- SELECT
- *
- FROM
- ta_user
- WHERE
- <if test="orgId != null and orgId != ''">
- org_id = #{orgId} and
- </if>
- (phone = #{phone}
- OR login_Name = #{loginName})
- </select>
- <select id="seleUserList" resultType="com.huiju.estateagents.center.taUser.entity.TaUser">
- SELECT
- t.*,
- b.building_id
- FROM
- ta_user t
- LEFT JOIN ta_person_building b ON t.user_id = b.user_id
- WHERE
- t.org_id = #{taUser.orgId}
- <if test="taUser.userName != null and taUser.userName != ''">
- and t.user_name like CONCAT('%', #{taUser.userName}, '%')
- </if>
- <if test="taUser.phone != null and taUser.phone != ''">
- and t.phone like CONCAT('%', #{taUser.phone}, '%')
- </if>
- <if test="taUser.status != null and taUser.status != ''">
- and t.status = #{taUser.status}
- </if>
- <if test="taUser.isConsultant != null and taUser.isConsultant != '' or taUser.isConsultant ==0">
- and t.is_consultant = #{taUser.isConsultant}
- </if>
- <if test="personBuildingList != null and personBuildingList.size > 0">
- AND b.building_id in
- <foreach collection="personBuildingList" item="personBuilding" open="(" close=")" separator=",">
- #{personBuilding.buildingId}
- </foreach>
- </if>
- GROUP BY user_id
- order by t.weight desc, create_date desc
- </select>
-
- <select id="validateWeight" resultType="integer">
- select count(*) from ta_user t
- LEFT JOIN ta_person_building a on t.user_id = a.user_id
- where 1=1
- <if test="weight != null and weight != ''">
- and t.weight = #{weight}
- </if>
- <if test="buildingIds != null and buildingIds.size() > 0 ">
- and a.building_id in
- <foreach collection="buildingIds" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="buildingId != null and buildingId != '' ">
- and a.building_id = #{buildingId}
- </if>
- <if test="userId != null and userId != ''">
- and t.user_id != #{userId}
- </if>
- </select>
-
- <select id="getAdminByAppID" resultType="com.huiju.estateagents.center.taUser.entity.TaUser">
- SELECT
- m.*
- FROM
- ta_miniapp t
- JOIN ta_user m USING (org_id)
- WHERE
- t.miniapp_id = #{appid}
- AND m.is_admin = 1
- </select>
-
- </mapper>
|