| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.AppUserMapper"> |
| | | |
| | | |
| | | |
| | | <select id="searchIntermediaryList" |
| | | resultType="com.stylefeng.guns.modular.system.warpper.res.SearchIntermediaryListRes"> |
| | | select t1.id,t1.profile_photo as profilePhoto,t1.nickname as nickname,t1.company_name as companyName, |
| | | t1.company_address as companyAddress,t1.introduce as introduce,t1.phone as phone, |
| | | COUNT(t2.id) AS houseCount |
| | | from t_app_user t1 |
| | | left join t_house_resource t2 on t1.id = t2.insert_user_id |
| | | <where> |
| | | <if test="null != req.name and '' != req.name"> |
| | | and t1.nickname = CONCAT('%', #{req.name}, '%') |
| | | </if> |
| | | <if test="null != cityIds"> |
| | | and t1.city_id in |
| | | <foreach collection="cityIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != districtIds"> |
| | | and t1.district_id in |
| | | <foreach collection="districtIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | and t1.audit_status = 2 |
| | | and t1.status = 1 |
| | | and t1.user_type = 3 |
| | | and t2.auth_status = 2 |
| | | and t2.is_delete = 0 |
| | | and t2.status = 1 |
| | | and t2.type=2 |
| | | </where> |
| | | group by t1.id |
| | | order by houseCount desc |
| | | </select> |
| | | </mapper> |