Merge branch 'master' of https://gitee.com/xiaochen991015/xizang
| | |
| | | return R.ok(faultAreaDicService.pageList(query)); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:faultArea:list')") |
| | | @ApiOperation(value = "获取故障区域列表") |
| | | @PostMapping(value = "/list") |
| | | public R<List<TFaultAreaDic>> list() { |
| | |
| | | /** |
| | | * 获取维修物品分类管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:itemType:list')") |
| | | @ApiOperation(value = "获取维修物品分类列表") |
| | | @PostMapping(value = "/list") |
| | | public R<List<TItemType>> list() { |
| | |
| | | //注入创建时间 |
| | | if ("createTime".equals(field.getName())) { |
| | | field.setAccessible(true); |
| | | field.set(parameter, LocalDateTime.now()); |
| | | // field.set(parameter, LocalDateTime.now()); |
| | | field.setAccessible(false); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | } |
| | | if ("updateTime".equals(field.getName())) { |
| | | field.setAccessible(true); |
| | | field.set(parameter, new Date()); |
| | | // field.set(parameter, new Date()); |
| | | field.setAccessible(false); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); |
| | | } |
| | | user.setCreateBy(getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setPassword(SecurityUtils.encryptPassword("123456")); |
| | | userService.insertUser(user); |
| | | return AjaxResult.success(); |
| | | } |
| | |
| | | accessPath: /file/ |
| | | allowExt: .jpg|.png|.gif|.jpeg|.doc|.docx|.apk|.MP4|.mp4|.pdf|.PDF |
| | | wx: |
| | | config: |
| | | appId: wxc3985a05da7d86dc |
| | | secret: 5cca42633c25439613b328c08ef20cc9 |
| | | conf: |
| | | appId: wxe91f1af7638aa5dd |
| | | secretId: a787e1a462715604e0c9528b6d8960d1 |
| | | #OSS及短信配置 |
| | | code: |
| | | config: |
| | |
| | | @ApiOperation(value = "缴费账单查询分页列表") |
| | | @PostMapping("list") |
| | | public R<PageInfo<TBillDto>> list(@RequestBody TBillQuery query){ |
| | | if (StringUtils.isEmpty(query.getUserId())){ |
| | | throw new ServiceException("用户ID不能为空"); |
| | | } |
| | | String userId = tokenService.getLoginUserApplet().getUserId(); |
| | | query.setUserId(userId); |
| | | PageInfo<TBillDto> pageInfo = tBillService.queryPage(query); |
| | | return R.ok(pageInfo); |
| | | } |
| | |
| | | @ApiOperation(value = "缴费账单查询列表") |
| | | @PostMapping("/getBillIds") |
| | | public R<List<String>> getBillIds(@RequestBody TBillQuery query){ |
| | | if (StringUtils.isEmpty(query.getUserId())){ |
| | | throw new ServiceException("用户ID不能为空"); |
| | | } |
| | | String userId = tokenService.getLoginUserApplet().getUserId(); |
| | | query.setUserId(userId); |
| | | List<String> billIds = tBillService.getBillIds(query); |
| | | return R.ok(billIds); |
| | | } |
| | |
| | | @PostMapping(value = "/invoiceList") |
| | | public R<PageInfo<TBillDto>> invoiceList(@RequestBody TBillQuery query) { |
| | | |
| | | // Long userId = tokenService.getLoginUser().getUserId(); |
| | | String userId = "1881967035070177281"; |
| | | String userId = tokenService.getLoginUserApplet().getUserId(); |
| | | query.setUserId(userId); |
| | | PageInfo<TBillDto> pageInfo = tBillService.invoiceList(query); |
| | | return R.ok(pageInfo); |
| | |
| | | if (tenant==null){ |
| | | // appUser.setTenantAttributes(); |
| | | // appUser.setTenantType(); |
| | | tenant = new TTenant(); |
| | | tenant.setPhone(appletUserDecodeData.getPhoneNumber()); |
| | | tenant.setAccount(appletUserDecodeData.getPhoneNumber()); |
| | | tenant.setPassword(SecurityUtils.encryptPassword(appletUserDecodeData.getPhoneNumber().substring(5))); |
| | | tenant.setOpenId(appletUserDecodeData.getOpenId()); |
| | | // 手机号中间四位替换为* |
| | | tenant.setResidentName(appletUserDecodeData.getPhoneNumber().replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2")); |
| | | tTenantService.save(tenant); |
| | | } |
| | | LoginUserApplet loginUserApplet = new LoginUserApplet(); |
| | | TTenantResp tTenantResp = new TTenantResp(); |
| | | BeanUtils.copyProperties(tenant, tTenantResp); |
| | | loginUserApplet.setUser(tTenantResp); |
| | | loginUserApplet.setUserId(Long.valueOf(tenant.getId())); |
| | | loginUserApplet.setUserId(tenant.getId()); |
| | | Map<String, Object> tokenInfos = new HashMap<>(); |
| | | tokenInfos.put("token",tokenService.createTokenApplet(loginUserApplet)); |
| | | tokenInfos.put("info",loginUserApplet); |
| | |
| | | //注入创建时间 |
| | | if ("createTime".equals(field.getName())) { |
| | | field.setAccessible(true); |
| | | field.set(parameter, new Date()); |
| | | // field.set(parameter, new Date()); |
| | | field.setAccessible(false); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | } |
| | | if ("updateTime".equals(field.getName())) { |
| | | field.setAccessible(true); |
| | | field.set(parameter, new Date()); |
| | | // field.set(parameter, new Date()); |
| | | field.setAccessible(false); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | accessPath: /file/ |
| | | allowExt: .jpg|.png|.gif|.jpeg|.doc|.docx|.apk|.MP4|.mp4|.pdf|.PDF |
| | | wx: |
| | | config: |
| | | appId: wxc3985a05da7d86dc |
| | | secret: 5cca42633c25439613b328c08ef20cc9 |
| | | conf: |
| | | appId: wxe91f1af7638aa5dd |
| | | secretId: a787e1a462715604e0c9528b6d8960d1 |
| | | #OSS及短信配置 |
| | | code: |
| | | config: |
| | |
| | | |
| | | @TableField(exist = false) |
| | | private String roleName; |
| | | |
| | | @TableField(exist = false) |
| | | private String deptName; |
| | | @ApiModelProperty(value = "部门id集合") |
| | | @TableField(exist = false) |
| | | private List<String> deptIds; |
| | | |
| | | public String getRoleName() { |
| | | return roleName; |
| | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | private Long userId; |
| | | private String userId; |
| | | |
| | | /** |
| | | * 部门ID |
| | |
| | | this.permissions = permissions; |
| | | } |
| | | |
| | | public LoginUserApplet(Long userId, Long deptId, TTenantResp user, Set<String> permissions) |
| | | public LoginUserApplet(String userId, Long deptId, TTenantResp user, Set<String> permissions) |
| | | { |
| | | this.userId = userId; |
| | | this.deptId = deptId; |
| | |
| | | this.permissions = permissions; |
| | | } |
| | | |
| | | public Long getUserId() |
| | | public String getUserId() |
| | | { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Long userId) |
| | | public void setUserId(String userId) |
| | | { |
| | | this.userId = userId; |
| | | } |
| | |
| | | "/applet/changepwd", "/captchaImage","/getCode","/loginCode", |
| | | "/operations/getBySingleNum/**", |
| | | "/user/getUserInfoByNumber/**", |
| | | "/wxLogin/**", |
| | | "/open/**" |
| | | ).permitAll() |
| | | // 静态资源,可匿名访问 |
| | |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ruoyi.common.core.domain.model.LoginUserApplet; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; |
| | | import org.springframework.security.core.context.SecurityContextHolder; |
| | |
| | | throws ServletException, IOException |
| | | { |
| | | LoginUser loginUser = tokenService.getLoginUser(request); |
| | | if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication())) |
| | | LoginUserApplet applet = tokenService.getLoginUserApplet(request); |
| | | if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication())|| |
| | | StringUtils.isNotNull(applet)) |
| | | { |
| | | tokenService.verifyToken(loginUser); |
| | | UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUser, null, loginUser.getAuthorities()); |
| | | authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); |
| | | SecurityContextHolder.getContext().setAuthentication(authenticationToken); |
| | | if (StringUtils.isNotNull(loginUser)){ |
| | | tokenService.verifyToken(loginUser); |
| | | UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUser, null, loginUser.getAuthorities()); |
| | | authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); |
| | | SecurityContextHolder.getContext().setAuthentication(authenticationToken); |
| | | } |
| | | if (StringUtils.isNotNull(applet)){ |
| | | tokenService.verifyTokenApplet(applet); |
| | | UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(applet, null, applet.getAuthorities()); |
| | | authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); |
| | | SecurityContextHolder.getContext().setAuthentication(authenticationToken); |
| | | } |
| | | } |
| | | chain.doFilter(request, response); |
| | | } |
| | |
| | | * |
| | | * @return 用户信息 |
| | | */ |
| | | public LoginUser getLoginUserApplet() |
| | | public LoginUserApplet getLoginUserApplet() |
| | | { |
| | | return getLoginUser(ServletUtils.getRequest()); |
| | | return getLoginUserApplet(ServletUtils.getRequest()); |
| | | } |
| | | /** |
| | | * 获取用户身份信息 |
| | |
| | | * |
| | | * @return 用户信息 |
| | | */ |
| | | public LoginUser getLoginUserApplet(HttpServletRequest request) |
| | | public LoginUserApplet getLoginUserApplet(HttpServletRequest request) |
| | | { |
| | | // 获取请求携带的令牌 |
| | | String token = getToken(request); |
| | |
| | | // 解析对应的权限以及用户信息 |
| | | String uuid = (String) claims.get(Constants.LOGIN_USER_APPLET_KEY); |
| | | String userKey = getTokenKey(uuid); |
| | | LoginUser user = redisCache.getCacheObject(userKey); |
| | | LoginUserApplet user = redisCache.getCacheObject(userKey); |
| | | return user; |
| | | } |
| | | catch (Exception e) |
| | |
| | | refreshToken(loginUser); |
| | | } |
| | | } |
| | | /** |
| | | * 小程序验证令牌有效期,相差不足20分钟,自动刷新缓存 |
| | | * |
| | | * @param loginUser |
| | | * @return 令牌 |
| | | */ |
| | | public void verifyTokenApplet(LoginUserApplet loginUser) |
| | | { |
| | | long expireTime = loginUser.getExpireTime(); |
| | | long currentTime = System.currentTimeMillis(); |
| | | if (expireTime - currentTime <= MILLIS_MINUTE_TEN) |
| | | { |
| | | refreshTokenApplet(loginUser); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 刷新令牌有效期 |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.system.model.TDeptToUser; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | |
| | | * @return 结果 |
| | | */ |
| | | public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds); |
| | | |
| | | void insertBatchUserDept(List<TDeptToUser> deptToUserList); |
| | | } |
| | |
| | | |
| | | import com.ruoyi.system.model.TDeptToUser; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2025-02-06 |
| | | */ |
| | | @Mapper |
| | | public interface TDeptToUserMapper extends BaseMapper<TDeptToUser> { |
| | | |
| | | /** |
| | | * 根据用户ID删除部门用户中间表 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return 删除结果 |
| | | **/ |
| | | int deleteUserDeptByUserId(Long userId); |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "账户列表query") |
| | | public class SysUserQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "姓名") |
| | | private String nickName; |
| | | private String nickNameAndPhone; |
| | | |
| | | @ApiModelProperty(value = "角色id") |
| | | private Integer roleId; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phonenumber; |
| | | @ApiModelProperty(value = "部门id集合") |
| | | private List<String> deptIds; |
| | | |
| | | @ApiModelProperty(value = "状态 0=正常 1=停用") |
| | | private String status; |
| | |
| | | import java.util.stream.Collectors; |
| | | import javax.validation.Validator; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.system.mapper.*; |
| | | import com.ruoyi.system.model.TDept; |
| | | import com.ruoyi.system.model.TDeptToUser; |
| | | import com.ruoyi.system.query.SysUserQuery; |
| | | import com.ruoyi.system.service.TDeptToUserService; |
| | | import com.ruoyi.system.vo.SysUserVO; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import com.ruoyi.system.domain.SysUserPost; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.mapper.SysPostMapper; |
| | | import com.ruoyi.system.mapper.SysRoleMapper; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.system.mapper.SysUserPostMapper; |
| | | import com.ruoyi.system.mapper.SysUserRoleMapper; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private SysUserPostMapper userPostMapper; |
| | | @Autowired |
| | | private TDeptToUserMapper deptToUserMapper; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | @Autowired |
| | | private TDeptMapper deptMapper; |
| | | |
| | | @Autowired |
| | | protected Validator validator; |
| | |
| | | // 新增用户信息 |
| | | int rows = userMapper.insertUser(user); |
| | | // 新增用户岗位关联 |
| | | // insertUserPost(user); |
| | | insertUserDept(user); |
| | | // 新增用户与角色管理 |
| | | insertUserRoleId(user); |
| | | return rows; |
| | |
| | | userRoleMapper.deleteUserRoleByUserId(userId); |
| | | // 新增用户与角色管理 |
| | | insertUserRoleId(user); |
| | | // 删除用户与岗位关联 |
| | | // userPostMapper.deleteUserPostByUserId(userId); |
| | | // 新增用户与岗位管理 |
| | | // insertUserPost(user); |
| | | // 删除用户与部门关联 |
| | | deptToUserMapper.deleteUserDeptByUserId(userId); |
| | | // 新增用户与部门管理 |
| | | insertUserDept(user); |
| | | return userMapper.updateUser(user); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 新增用户角色信息 |
| | | * |
| | | * @param user 用户对象 |
| | | */ |
| | | public void insertUserDept(SysUser user) |
| | | { |
| | | this.insertUserDept(user.getUserId(), user.getDeptIds()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增用户岗位信息 |
| | | * |
| | | * @param user 用户对象 |
| | |
| | | ur.setUserId(userId); |
| | | ur.setRoleId(roleId); |
| | | userRoleMapper.insertUserRole(ur); |
| | | } |
| | | } |
| | | /** |
| | | * 新增用户部门信息 |
| | | * |
| | | * @param userId 用户ID |
| | | * @param deptIds 部门id集合 |
| | | */ |
| | | public void insertUserDept(Long userId, List<String> deptIds) |
| | | { |
| | | if (Objects.nonNull(userId) && !CollectionUtils.isEmpty(deptIds)){ |
| | | List<TDeptToUser> deptToUserList = new ArrayList<>(); |
| | | for (String deptId : deptIds) { |
| | | // 新增用户与角色管理 |
| | | TDeptToUser deptToUser = new TDeptToUser(); |
| | | deptToUser.setUserId(userId); |
| | | deptToUser.setDeptId(deptId); |
| | | deptToUserList.add(deptToUser); |
| | | } |
| | | userRoleMapper.insertBatchUserDept(deptToUserList); |
| | | } |
| | | } |
| | | |
| | |
| | | public PageInfo<SysUserVO> pageList(SysUserQuery query) { |
| | | PageInfo<SysUserVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<SysUserVO> list = userMapper.pageList(query,pageInfo); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return pageInfo; |
| | | } |
| | | List<Long> userIds = list.stream().map(SysUserVO::getUserId).collect(Collectors.toList()); |
| | | // 查询所有部门 |
| | | List<TDept> depts = deptMapper.selectList(Wrappers.lambdaQuery(TDept.class)); |
| | | List<TDeptToUser> tDeptToUsers = deptToUserMapper.selectList(Wrappers.lambdaQuery(TDeptToUser.class) |
| | | .in(TDeptToUser::getUserId, userIds)); |
| | | for (SysUserVO sysUserVO : list) { |
| | | tDeptToUsers.stream().filter(tDeptToUser -> tDeptToUser.getUserId().equals(sysUserVO.getUserId())).forEach(tDeptToUser -> { |
| | | sysUserVO.setDeptList(depts.stream().filter(tDept -> tDept.getId().equals(tDeptToUser.getDeptId())).map(TDept::getDeptName).collect(Collectors.toList())); |
| | | }); |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.constant.DictConstants; |
| | | import com.ruoyi.common.utils.DictUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.mapper.TTenantMapper; |
| | | import com.ruoyi.system.model.TTenant; |
| | | import com.ruoyi.system.query.TTenantQuery; |
| | |
| | | PageInfo<TenantVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TenantVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | for (TenantVO tenantVO : list) { |
| | | tenantVO.setTenantAttributesName(DictUtils.getDictLabel(DictConstants.DICT_TYPE_TENANT_ATTRIBUTE,tenantVO.getTenantAttributes())); |
| | | tenantVO.setTenantTypeName(DictUtils.getDictLabel(DictConstants.DICT_TYPE_TENANT_TYPE,tenantVO.getTenantType())); |
| | | tenantVO.setTenantAttributesName(StringUtils.isNotBlank(tenantVO.getTenantAttributes())?DictUtils.getDictLabel(DictConstants.DICT_TYPE_TENANT_ATTRIBUTE,tenantVO.getTenantAttributes()):""); |
| | | tenantVO.setTenantTypeName(StringUtils.isNotBlank(tenantVO.getTenantType())?DictUtils.getDictLabel(DictConstants.DICT_TYPE_TENANT_TYPE,tenantVO.getTenantType()):""); |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "账户列表VO") |
| | | public class SysUserVO extends SysUser { |
| | |
| | | @ApiModelProperty(value = "单位名称") |
| | | private String companyName; |
| | | @ApiModelProperty(value = "部门") |
| | | private String deptName; |
| | | private List<String> deptList; |
| | | @ApiModelProperty(value = "角色") |
| | | private String roleName; |
| | | |
| | |
| | | sol.oper_time AS operTime, sol.cost_time AS costTime,sol.companyName AS companyName,sol.roleName AS roleName,sol.phonenumber AS phonenumber, |
| | | sol.userId AS userId,sol.nickName AS nickName |
| | | from sys_oper_log sol |
| | | <where> |
| | | <if test="query.companyName != null and query.companyName != ''"> |
| | | AND sol.companyName LIKE concat('%',#{query.companyName},'%') |
| | | </if> |
| | | <if test="query.roleName != null and query.roleName != ''"> |
| | | AND sol.roleName LIKE concat('%',#{query.roleName},'%') |
| | | </if> |
| | | <if test="query.nickName != null and query.nickName != ''"> |
| | | AND sol.nickName LIKE concat('%',#{query.nickName},'%') |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | AND DATE_FORMAT(sol.oper_time, '%Y-%m-%d %H:%i:%s') >= #{query.startTime} |
| | | AND DATE_FORMAT(sol.oper_time, '%Y-%m-%d %H:%i:%s') <= #{query.endTime} |
| | | </if> |
| | | </where> |
| | | ORDER BY sol.oper_time DESC |
| | | </select> |
| | | |
| | |
| | | from sys_user u |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | left join t_dept_to_user tdtu on u.user_id = tdtu.user_id |
| | | WHERE u.del_flag = 0 |
| | | <if test="query.nickName != null and query.nickName != ''"> |
| | | AND u.nick_name LIKE concat('%',#{query.nickName},'%') |
| | | <if test="query.nickNameAndPhone != null and query.nickNameAndPhone != ''"> |
| | | AND (u.nick_name LIKE concat('%',#{query.nickNameAndPhone},'%') |
| | | OR u.phonenumber LIKE concat('%',#{query.nickNameAndPhone},'%')) |
| | | </if> |
| | | <if test="query.roleId != null"> |
| | | AND r.role_id = #{query.roleId} |
| | | </if> |
| | | <if test="query.phonenumber != null and query.phonenumber != ''"> |
| | | AND u.phonenumber LIKE concat('%',#{query.phonenumber},'%') |
| | | </if> |
| | | <if test="query.status != null and query.status != ''"> |
| | | AND u.status = #{query.status} |
| | | </if> |
| | | <if test="query.deptIds != null and query.deptIds.size()>0"> |
| | | AND u.user_id IN (select DISTINCT user_id from t_dept_to_user where dept_id IN |
| | | <foreach collection="query.deptIds" close=")" open="(" item="deptId" separator=","> |
| | | #{deptId} |
| | | </foreach>) |
| | | </if> |
| | | ORDER BY u.create_time DESC |
| | | </select> |
| | | <select id="selectIdByPhone" resultType="java.lang.Long"> |
| | |
| | | <insert id="insertUserRole"> |
| | | insert into sys_user_role(user_id, role_id) values (#{userRole.userId},#{userRole.roleId}) |
| | | </insert> |
| | | <insert id="insertBatchUserDept"> |
| | | insert into sys_user_role(user_id, dept_id) values |
| | | <foreach item="item" index="index" collection="deptToUserList" separator=","> |
| | | (#{item.userId},#{item.deptId}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <delete id="deleteUserRoleInfo" parameterType="SysUserRole"> |
| | | delete from sys_user_role where user_id=#{userId} and role_id=#{roleId} |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, dept_id, user_id |
| | | </sql> |
| | | <delete id="deleteUserDeptByUserId"> |
| | | delete from t_dept_to_user where user_id=#{userId} |
| | | </delete> |
| | | |
| | | </mapper> |
| | |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TItemVO"> |
| | | select |
| | | t.id, t.type_id, t.item_name, t.sort_by, t.pictures, t.create_time, t.update_time, t.create_by, t.update_by, t.disabled |
| | | t.id, t.type_id, t.item_name, t.sort_by, t.pictures, t.create_time, t.update_time, t.create_by, t.update_by, t.disabled, |
| | | tt.type_name |
| | | from t_item t |
| | | left join t_item_type tt on t.type_id = tt.id |