| | |
| | | /** |
| | | * 自定义用户列表 |
| | | */ |
| | | @GetMapping("/pages") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "account", value = "账号名", paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(name = "realName", value = "姓名", paramType = "query", dataType = "string") |
| | | }) |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "列表", notes = "传入account和realName") |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<IPage<UserVO>> pages(@ApiIgnore User user, Query query, Long deptId, BladeUser bladeUser) { |
| | | IPage<UserVO> pages = userService.selectUserPages(Condition.getPage(query), user, deptId, "000000"); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 自定义用户列表 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "account", value = "账号名", paramType = "query", dataType = "string"), |
| | |
| | | @ApiOperation(value = "列表", notes = "传入account和realName") |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<IPage<UserVO>> page(@ApiIgnore User user, Query query, Long deptId, BladeUser bladeUser) { |
| | | IPage<UserVO> pages = userService.selectUserPage(Condition.getPage(query), user, deptId, "000000"); |
| | | return R.data(pages); |
| | | IPage<User> pages = userService.selectUserPage(Condition.getPage(query), user, deptId, (bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : bladeUser.getTenantId())); |
| | | return R.data(UserWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | |
| | | public interface UserMapper extends BaseMapper<User> { |
| | | |
| | | /** |
| | | * 自定义分页,带坐标 |
| | | * |
| | | * @param page |
| | | * @param user |
| | | * @param deptIdList |
| | | * @param tenantId |
| | | * @return |
| | | */ |
| | | List<UserVO> selectUserPages(IPage<UserVO> page, @Param("user") User user, @Param("deptIdList") List<Long> deptIdList, @Param("tenantId") String tenantId); |
| | | |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | |
| | | * @param tenantId |
| | | * @return |
| | | */ |
| | | List<UserVO> selectUserPage(IPage<UserVO> page, @Param("user") User user, @Param("deptIdList") List<Long> deptIdList, @Param("tenantId") String tenantId); |
| | | List<User> selectUserPage(IPage<User> page, @Param("user") User user, @Param("deptIdList") List<Long> deptIdList, @Param("tenantId") String tenantId); |
| | | |
| | | /** |
| | | * 获取用户 |
| | |
| | | <result column="birthtime" property="birthtime"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectUserPage" resultMap="userResultMap"> |
| | | <!--带坐标--> |
| | | <select id="selectUserPages" resultMap="userResultMap"> |
| | | select |
| | | bu.*, |
| | | sll.longitude,sll.latitude, |
| | |
| | | ORDER BY bu.id |
| | | </select> |
| | | |
| | | <select id="selectUserPage" resultMap="userResultMap"> |
| | | select * from blade_user where is_deleted = 0 |
| | | <if test="user.tenantId!=null and user.tenantId != ''"> |
| | | and tenant_id = #{user.tenantId} |
| | | </if> |
| | | <if test="user.account!=null and user.account != ''"> |
| | | and account != #{user.account} |
| | | </if> |
| | | <if test="user.realName!=null and user.realName != ''"> |
| | | and real_name like concat(concat('%', #{user.realName}),'%') |
| | | </if> |
| | | <if test="user.deptId!=null and user.deptId != ''"> |
| | | and dept_id like concat(concat('%', #{user.deptId}),'%') |
| | | </if> |
| | | <if test="user.userType!=null and user.userType != ''"> |
| | | and user_type = #{user.userType} |
| | | </if> |
| | | <if test="user.nativeplace!=null and user.nativeplace != ''"> |
| | | and nativeplace = #{user.nativeplace} |
| | | </if> |
| | | <if test="user.sex!=null and user.sex != ''"> |
| | | and sex = #{user.sex} |
| | | </if> |
| | | <if test="user.status!=null and user.status != ''"> |
| | | and status = #{user.status} |
| | | </if> |
| | | <if test="user.hold!=null and user.hold != ''"> |
| | | and hold = #{user.hold} |
| | | </if> <if test="user.jurisdiction!=null and user.jurisdiction != ''"> |
| | | and jurisdiction = #{user.jurisdiction} |
| | | </if> |
| | | <if test="user.securitynumber!=null and user.securitynumber != ''"> |
| | | and securitynumber = #{user.securitynumber} |
| | | </if> |
| | | <if test="deptIdList!=null and deptIdList.size>0"> |
| | | and id in ( |
| | | SELECT |
| | | user_id |
| | | FROM |
| | | blade_user_dept |
| | | WHERE |
| | | dept_id IN |
| | | <foreach collection="deptIdList" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | ORDER BY id |
| | | </select> |
| | | |
| | | <select id="getUser" resultMap="userResultMap"> |
| | | SELECT * |
| | | FROM blade_user |
| | |
| | | * @param tenantId |
| | | * @return |
| | | */ |
| | | IPage<UserVO> selectUserPage(IPage<UserVO> page, User user, Long deptId, String tenantId); |
| | | IPage<UserVO> selectUserPages(IPage<UserVO> page, User user, Long deptId, String tenantId); |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param user |
| | | * @param deptId |
| | | * @param tenantId |
| | | * @return |
| | | */ |
| | | IPage<User> selectUserPage(IPage<User> page, User user, Long deptId, String tenantId); |
| | | |
| | | /** |
| | | * 自定义分页 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<UserVO> selectUserPage(IPage<UserVO> page, User user, Long deptId, String tenantId) { |
| | | public IPage<UserVO> selectUserPages(IPage<UserVO> page, User user, Long deptId, String tenantId) { |
| | | List<Long> deptIdList = SysCache.getDeptChildIds(deptId); |
| | | return page.setRecords(baseMapper.selectUserPages(page, user, deptIdList, tenantId)); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<User> selectUserPage(IPage<User> page, User user, Long deptId, String tenantId) { |
| | | List<Long> deptIdList = SysCache.getDeptChildIds(deptId); |
| | | return page.setRecords(baseMapper.selectUserPage(page, user, deptIdList, tenantId)); |
| | | } |