Browse Source

Merge remote-tracking branch 'remotes/origin/dev_py_gridmember' into dev

dev
jianjun 4 years ago
parent
commit
5ed2ee17bf
  1. 5
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/PageFormDTO.java
  2. 1
      epmet-gateway/src/main/resources/bootstrap.yml
  3. 32
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridStaffResultDTO.java
  4. 32
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerStaffGridResultDTO.java
  5. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  6. 7
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  7. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
  8. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  9. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  10. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  11. 22
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  12. 56
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridStaffFormDTO.java
  13. 22
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java
  14. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java
  15. 76
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java
  16. 113
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java
  17. 29
      epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml

5
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/PageFormDTO.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* 分页通用类
@ -12,7 +13,9 @@ import javax.validation.constraints.NotNull;
* @date 2020/11/20 17:02
*/
@Data
public class PageFormDTO {
public class PageFormDTO implements Serializable {
private static final long serialVersionUID = -4145040961294503137L;
public interface AddUserInternalGroup {
}

1
epmet-gateway/src/main/resources/bootstrap.yml

@ -524,6 +524,7 @@ epmet:
- /third/private-epmet/push-component-access-token
- /data/stats/plugins/ofs/**
- /data/stats/plugins/workrecord/**
- /epmetuser/staffrole/getGridStaffList #py获取网格员 网格长
# 对外开放接口认证白名单

32
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridStaffResultDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* desc:客户下网格工作人员结果
* @Author zxc
* @DateTime 2021/6/8 3:23 下午
* @DESC
*/
@Data
public class CustomerGridStaffResultDTO implements Serializable {
private static final long serialVersionUID = -5910427385795368242L;
private String userId;
private String userName;
private String mobile;
private Integer gender;
private String gridId;
private String gridName;
private String agencyId;
}

32
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerStaffGridResultDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @author 在网格中的工作人员
* @dscription
* @date 2020/4/23 16:08
*/
@Data
public class CustomerStaffGridResultDTO implements Serializable {
private static final long serialVersionUID = 1301415104939403933L;
/**
* 用户ID
*/
private String userId;
/**
* 网格Id
*/
private String gridId;
/**
* 网格名称
*/
private String gridName;
/**
* 组织Id
*/
private String agencyId;
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -576,4 +576,9 @@ public interface GovOrgOpenFeignClient {
*/
@PostMapping("/gov/org/customeragency/configcustomerareacode")
Result configCustomerAreaCode(@RequestBody CustomerAreaCodeFormDTO formDTO);
@PostMapping("/gov/org/customergrid/getstaffgridlist")
Result<List<CustomerStaffGridResultDTO>> getStaffGridList(@RequestParam("customerId") String customerId,
@RequestParam("orgId") String orgId,
@RequestParam("orgType") String orgType);
}

7
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -362,11 +362,16 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
/**
* 运营端-客户管理修改客户信息调用gov-org服务修改组织区划开关修改根组织areaCode入参
*
* @param areaCodeFormDTO
* @param formDTO
* @return
*/
@Override
public Result configCustomerAreaCode(CustomerAreaCodeFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "configCustomerAreaCode", formDTO);
}
@Override
public Result<List<CustomerStaffGridResultDTO>> getStaffGridList(String customerId, String orgId, String orgType) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffGridList",customerId, orgId, orgType);
}
}

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java

@ -330,4 +330,17 @@ public class CustomerGridController {
return new Result<List<AgencyGridList>>().ok(customerGridService.gridListByAgencyId(agencyId));
}
/**
* @Description 获取工作人员所在的网格列表
* @author sun
**/
@PostMapping("getstaffgridlist")
Result<List<CustomerStaffGridResultDTO>> getStaffGridList(@RequestParam("customerId")String customerId,
@RequestParam("orgId")String orgId,
@RequestParam("orgType")String orgType) {
//tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc");
List<CustomerStaffGridResultDTO> staffGridList = customerGridService.getStaffGridList(customerId, orgId, orgType);
return new Result<List<CustomerStaffGridResultDTO>>().ok(staffGridList);
}
}

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java

@ -156,8 +156,8 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
List<AllGridsByUserIdResultDTO> selectGridByIds(@Param("gridIdList") List<String> gridIdList);
/**
* @Description 查询网格名 不限制是否同步条件 SYNC_FLAG
* @param gridIdList
* @Description 查询网格名 不限制是否同步条件 SYNC_FLAG
* @author zxc
* @date 2022/1/12 9:42 上午
*/
@ -364,4 +364,5 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
@Param("agencyId") String agencyId,
@Param("operateUserId") String operateUserId);
List<CustomerStaffGridResultDTO> getStaffGridList(@Param("customerId") String customerId, @Param("orgId") String orgId, @Param("orgType") String orgType);
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java

@ -362,4 +362,16 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
* @Description 查询组织直属网格列表
**/
List<AgencyGridList> gridListByAgencyId(String agencyId);
/**
* desc: 获取组织及网格下 工作人员网格关系列表
*
* @param customerId
* @param orgId
* @param orgType
* @return java.util.List<com.epmet.dto.result.CustomerStaffGridResultDTO>
* @author LiuJanJun
* @date 2022/1/17 3:50 下午
*/
List<CustomerStaffGridResultDTO> getStaffGridList(String customerId, String orgId, String orgType);
}

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -42,7 +42,6 @@ import com.epmet.dao.CustomerStaffGridDao;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.CustomerGridEntity;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetMessageOpenFeignClient;
@ -931,4 +930,9 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
return result;
}
@Override
public List<CustomerStaffGridResultDTO> getStaffGridList(String customerId, String orgId, String orgType) {
return baseDao.getStaffGridList(customerId,orgId,orgType);
}
}

22
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -783,5 +783,27 @@
where customer_id=#{customerId}
AND pids LIKE concat('%',#{agencyId}, '%' )
</update>
<select id="getStaffGridList" resultType="com.epmet.dto.result.CustomerStaffGridResultDTO">
SELECT
csg.USER_ID,
csg.GRID_ID,
cg.GRID_NAME,
cg.PID agencyId
from customer_staff_grid csg
INNER JOIN customer_grid cg ON cg.ID = csg.GRID_ID
WHERE cg.DEL_FLAG = '0'
AND csg.DEL_FLAG = '0'
AND cg.CUSTOMER_ID = #{customerId}
<if test="orgType != null and orgType != ''">
<choose>
<when test="orgType == 'grid'">
AND cg.ID = #{orgId}
</when>
<otherwise>
AND cg.PIDS like concat('%', #{orgId},'%')
</otherwise>
</choose>
</if>
</select>
</mapper>

56
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridStaffFormDTO.java

@ -0,0 +1,56 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.util.List;
/**
* DESC:网格下的工作人员 查询
* @author liujianjun
*/
@Data
public class GridStaffFormDTO extends PageFormDTO {
/**
* 客户Id
*/
@NotBlank(message = "客户Id不能为空", groups = {DefaultGroup.class})
private String customerId;
/**
* 工作人员Id
*/
private String userId;
/**
* 工作人员姓名
*/
private String userName;
/**
* 手机号
*/
private String mobile;
/**
* 角色key
*/
@NotEmpty(message = "角色Key不能为空", groups = {DefaultGroup.class})
private List<String> roleKeyList;
/**
* 组织ID
*/
@NotBlank(message = "组织ID不能为空", groups = {DefaultGroup.class})
private String orgId;
/**
* 组织类型 agency or grid
*/
@NotBlank(message = "组织类型不能为空", groups = {DefaultGroup.class})
private String orgType;
}

22
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java

@ -2,8 +2,10 @@ package com.epmet.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.epmet.commons.mybatis.entity.DataScope;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.StaffRoleDTO;
import com.epmet.dto.form.*;
@ -11,6 +13,7 @@ import com.epmet.dto.result.*;
import com.epmet.entity.GovStaffRoleEntity;
import com.epmet.service.GovStaffRoleService;
import com.epmet.service.StaffRoleService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -195,4 +198,23 @@ public class StaffRoleController {
ValidatorUtils.validateEntity(formDTO,RoleStaffIdFormDTO.AddUserInternalGroup.class);
return new Result<Set<String>>().ok(staffRoleService.queryRoleStaffIds(formDTO));
}
/**
* desc: 根据角色用户名手机号 组织获取网格下的工作人员 精确匹配
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.Set<java.lang.String>>
* @author LiuJanJun
* @date 2022/1/17 2:26 下午
*/
@PostMapping("getGridStaffList")
Result<PageData<CustomerGridStaffResultDTO>> getGridStaffList(@RequestHeader(value = "customerId",required = false) String customerId, @RequestBody GridStaffFormDTO formDTO){
//tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc");
if (StringUtils.isBlank(formDTO.getCustomerId())){
formDTO.setCustomerId(customerId);
}
ValidatorUtils.validateEntity(formDTO, DefaultGroup.class);
return new Result<PageData<CustomerGridStaffResultDTO>>().ok(staffRoleService.getGridStaffList(formDTO));
}
}

11
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java

@ -23,6 +23,7 @@ import com.epmet.dto.StaffRoleDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.CustomerStaffRoleListFormDTO;
import com.epmet.dto.form.GetRoleKeyListFormDTO;
import com.epmet.dto.form.GridStaffFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.StaffRoleEntity;
import org.apache.ibatis.annotations.Mapper;
@ -169,4 +170,14 @@ public interface StaffRoleDao extends BaseDao<StaffRoleEntity> {
* @Description 事件网格员服务电话
**/
List<GridMobileListResultDTO.Role> staffRoleList(@Param("staffIds") List<String> staffIds);
/**
* desc: 条件获取工作人员list
*
* @param formDTO
* @return java.util.List<com.epmet.dto.result.CustomerStaffResultDTO>
* @author LiuJanJun
* @date 2022/1/17 2:45 下午
*/
List<CustomerGridStaffResultDTO> getStaffList(GridStaffFormDTO formDTO);
}

76
epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java

@ -22,15 +22,11 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StaffRoleDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.CustomerStaffRoleListFormDTO;
import com.epmet.dto.form.RoleStaffIdFormDTO;
import com.epmet.dto.form.RolesUsersListFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.StaffRoleEntity;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
@ -41,66 +37,6 @@ import java.util.Set;
*/
public interface StaffRoleService extends BaseService<StaffRoleEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<StaffRoleDTO>
* @author generator
* @date 2020-04-22
*/
PageData<StaffRoleDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<StaffRoleDTO>
* @author generator
* @date 2020-04-22
*/
List<StaffRoleDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return StaffRoleDTO
* @author generator
* @date 2020-04-22
*/
StaffRoleDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-04-22
*/
void save(StaffRoleDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-04-22
*/
void update(StaffRoleDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-04-22
*/
void delete(String[] ids);
/**
* 查询具有某角色的staff列表
* @param roleKey
@ -176,4 +112,14 @@ public interface StaffRoleService extends BaseService<StaffRoleEntity> {
* @date 2021/8/19 11:14 上午
*/
Set<String> queryRoleStaffIds(RoleStaffIdFormDTO formDTO);
/**
* desc: 条件获取 网格工作人员信息
*
* @param formDTO
* @return com.epmet.commons.tools.page.PageData<com.epmet.dto.result.CustomerStaffResultDTO>
* @author LiuJanJun
* @date 2022/1/17 2:37 下午
*/
PageData<CustomerGridStaffResultDTO> getGridStaffList(GridStaffFormDTO formDTO);
}

113
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java

@ -17,30 +17,29 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.mybatis.entity.DataScope;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.StaffRoleDao;
import com.epmet.dto.StaffRoleDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.CustomerStaffRoleListFormDTO;
import com.epmet.dto.form.RoleStaffIdFormDTO;
import com.epmet.dto.form.RolesUsersListFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.StaffRoleEntity;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.StaffRoleService;
import org.apache.commons.lang3.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
* 工作人员-角色关系表
@ -48,61 +47,12 @@ import java.util.*;
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-22
*/
@Slf4j
@Service
public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRoleEntity> implements StaffRoleService {
@Override
public PageData<StaffRoleDTO> page(Map<String, Object> params) {
IPage<StaffRoleEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, StaffRoleDTO.class);
}
@Override
public List<StaffRoleDTO> list(Map<String, Object> params) {
List<StaffRoleEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, StaffRoleDTO.class);
}
private QueryWrapper<StaffRoleEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<StaffRoleEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public StaffRoleDTO get(String id) {
StaffRoleEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, StaffRoleDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(StaffRoleDTO dto) {
StaffRoleEntity entity = ConvertUtils.sourceToTarget(dto, StaffRoleEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(StaffRoleDTO dto) {
StaffRoleEntity entity = ConvertUtils.sourceToTarget(dto, StaffRoleEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
/**
* 查询具有某角色的staff列表
* @param roleKey
@ -209,4 +159,47 @@ public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRol
return baseDao.selectRoleStaffIds(formDTO.getCustomerId(),formDTO.getRoleIds());
}
@Override
public PageData<CustomerGridStaffResultDTO> getGridStaffList(GridStaffFormDTO formDTO) {
//有这些条件 优先查询用户信息
List<CustomerGridStaffResultDTO> staffList = baseDao.getStaffList(formDTO);
if (CollectionUtils.isEmpty(staffList)){
log.warn("getGridStaffList getStaffList return empty,param:{}", JSON.toJSONString(formDTO));
return new PageData<>(null,NumConstant.ZERO);
}
//继续查询 在网格里的人
Result<List<CustomerStaffGridResultDTO>> staffGridResult = govOrgOpenFeignClient.getStaffGridList(formDTO.getCustomerId(),formDTO.getOrgId(),formDTO.getOrgType());
if (staffGridResult == null || !staffGridResult.success() || CollectionUtils.isEmpty(staffGridResult.getData())){
log.warn("getGridStaffList getStaffGridList return empty,param orgId:{},orgType:{}",formDTO.getOrgId(),formDTO.getOrgType());
return new PageData<>(null,NumConstant.ZERO);
}
Map<String, List<CustomerStaffGridResultDTO>> userGridListMap = staffGridResult.getData().stream()
.collect(Collectors.groupingBy(CustomerStaffGridResultDTO::getUserId));
List<CustomerGridStaffResultDTO> result = new ArrayList<>();
Integer offset = formDTO.getOffset();
Integer pageSize = formDTO.getPageSize();
AtomicInteger count = new AtomicInteger();
staffList.forEach(staff->{
List<CustomerStaffGridResultDTO> dtoList = userGridListMap.get(staff.getUserId());
if (dtoList == null){
return;
}
dtoList.forEach(grid-> {
CustomerGridStaffResultDTO staffNew = ConvertUtils.sourceToTarget(staff, CustomerGridStaffResultDTO.class);
staffNew.setGridId(grid.getGridId());
staffNew.setGridName(grid.getGridName());
staffNew.setAgencyId(grid.getAgencyId());
if (count.intValue() >= offset && result.size() < pageSize) {
result.add(staffNew);
}
count.getAndIncrement();
});
});
return new PageData<>(result,result.size());
}
}

29
epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml

@ -271,5 +271,34 @@
</foreach>
ORDER BY sr.staff_id, gsr.role_key
</select>
<select id="getStaffList" resultType="com.epmet.dto.result.CustomerGridStaffResultDTO">
SELECT
cs.USER_ID,
cs.REAL_NAME userName,
cs.MOBILE,
cs.GENDER
FROM
customer_staff cs
INNER JOIN staff_role sr ON sr.STAFF_ID = cs.USER_ID
INNER JOIN gov_staff_role gsr ON sr.role_id = gsr.id
WHERE 1=1
<if test="userId != null and userId != ''">
AND cs.USER_ID = #{userId}
</if>
<if test="userName != null and userName != ''">
AND cs.REAL_NAME = #{userName}
</if>
<if test="mobile != null and mobile != ''">
AND cs.mobile = #{mobile}
</if>
AND gsr.role_key IN
<foreach collection="roleKeyList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
AND cs.DEL_FLAG = '0'
AND sr.del_flag = '0'
AND gsr.del_flag = '0'
ORDER BY cs.CREATED_TIME DESC
</select>
</mapper>

Loading…
Cancel
Save