linwei
2024-02-22 7bcd0d2d7510cb2ba67099cd768e1b2b6d047dc2
投票人员查询优化
7 files modified
72 ■■■■■ changed files
src/main/java/org/springblade/modules/article/mapper/ArticleMapper.xml 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/article/service/impl/ArticleServiceImpl.java 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/UserController.java 9 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.java 15 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml 32 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/IUserService.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java 7 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/article/mapper/ArticleMapper.xml
@@ -115,6 +115,12 @@
                and (ja.article_range like concat('%',#{article.districtId},'%')
                or ja.article_range is null)
            </if>
            <if test="article.userId != null">
                and (jpd.appoint_user like concat('%',#{article.userId},'%')
                or ja.appoint_user is null)
            </if>
            <if test="article.building != null and article.building != ''">
                and (ja.building = #{article.building}
                or ja.building is null)
src/main/java/org/springblade/modules/article/service/impl/ArticleServiceImpl.java
@@ -94,6 +94,7 @@
        // 查询用户小区的id
        String districId = baseMapper.getDistrictId(article.getHouseCode());
        article.setDistrictId(districId);
        article.setUserId(AuthUtil.getUserId());
        List<ArticleVO> articleVOS = baseMapper.selectArticlePageByApp(page, article);
        return page.setRecords(articleVOS);
    }
src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -407,6 +407,15 @@
        return R.data(userService.getUserInfoByDistrictId(districtId, building));
    }
    /**
     * 通过小区id查询物业人员/网格人员
     */
    @GetMapping("/getUserInfoByDistrictIds")
    @ApiOperation(value = "查询物业人员By小区id", notes = "houseCode")
    public R getUserInfoByDistrictIds(@RequestParam("districtIds") String districtIds) {
        return R.data(userService.getUserInfoByDistrictIds(districtIds));
    }
    /**
     * 通过机构查询物业公司人员
src/main/java/org/springblade/modules/system/mapper/UserMapper.java
@@ -66,6 +66,7 @@
    /**
     * 按条件查询用户信息
     *
     * @param user
     * @return
     */
@@ -73,6 +74,7 @@
    /**
     * 通过小区Id搜索用户
     *
     * @param districtId
     * @return
     */
@@ -80,6 +82,7 @@
    /**
     * 根据手机号查询对应账号和手机号的用户信息
     *
     * @param phoneNumber
     * @return
     */
@@ -87,6 +90,7 @@
    /**
     * 用户详情接口
     *
     * @param userId
     * @return
     */
@@ -102,11 +106,20 @@
    /**
     * 查询没有匹配的数据
     *
     * @return
     */
    List<User> getNotBindUserDept();
    List<User> getUserListByDeptIds(@Param("deptIds") String receiveDept);
    List<User> getUserInfoByPropertyId(String deptId,String roleId);
    List<User> getUserInfoByPropertyId(String deptId, String roleId);
    /**
     *
     * 多个小区id查询用户
     * @param list
     * @return
     */
    List<UserEntity> getUserInfoByDistrictIds(@Param("list") List<String> list);
}
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -182,11 +182,11 @@
        LEFT JOIN jczz_house jhe ON jhe.house_code = jh.house_code
        LEFT JOIN jczz_district jd on jd.aoi_code=jhe.district_code
        <where>
            <if test="districtId != nuu and districtId != ''">
            <if test="districtId != null and districtId != ''">
                and jd.id = #{districtId}
                and bu.is_deleted = 0
            </if>
            <if test="building != nuu and building != ''">
            <if test="building != null and building != ''">
                and jhe.building=#{building}
            </if>
@@ -229,6 +229,34 @@
            )
    </select>
    <select id="getUserInfoByDistrictIds" resultType="org.flowable.idm.engine.impl.persistence.entity.UserEntity"
            parameterType="java.util.List">
        SELECT
        bu.id,
        bu.tenant_id,
        bu.code,
        bu.user_type,
        bu.account,
        bu.name,
        bu.real_name,
        bu.avatar,
        bu.email,
        bu.phone,
        bu.birthday
        FROM
        blade_user bu
        LEFT JOIN jczz_household jh ON bu.id = jh.associated_user_id
        LEFT JOIN jczz_house jhe ON jhe.house_code = jh.house_code
        LEFT JOIN jczz_district jd on jd.aoi_code=jhe.district_code
        <where>
            and jd.id = in
            <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
            and bu.is_deleted = 0
        </where>
    </select>
</mapper>
src/main/java/org/springblade/modules/system/service/IUserService.java
@@ -267,4 +267,6 @@
     * @param data
     */
    void importPoliceUser(List<PoliceUserExcel> data);
    List<UserEntity> getUserInfoByDistrictIds(String districtIds);
}
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
@@ -17,6 +17,7 @@
package org.springblade.modules.system.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -609,6 +610,12 @@
        return baseMapper.getUserInfoByDistrictId(districtId, building);
    }
    @Override
    public List<UserEntity> getUserInfoByDistrictIds(String districtIds) {
        List<String> list = JSON.parseArray(districtIds).toJavaList(String.class);
        return baseMapper.getUserInfoByDistrictIds(list);
    }
    /**
     * 处理漏绑定的user_dept
     */