Browse Source

工作人员调动

dev
zhaoqifeng 5 years ago
parent
commit
2f19956326
  1. 13
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  2. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  3. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java
  4. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java
  5. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java
  6. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java
  7. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml
  8. 6
      epmet-module/gov-org/gov-org-server/pom.xml
  9. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java
  10. 18
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  11. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java
  12. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  13. 24
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java
  14. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  15. 52
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
  16. 5
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml
  17. 17
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

13
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java

@ -2,9 +2,11 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.form.CommonCustomerFormDTO; import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallback; import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -28,4 +30,15 @@ public interface EpmetHeartOpenFeignClient {
**/ **/
@PostMapping("/heart/resi/volunteer/volunteeruserids") @PostMapping("/heart/resi/volunteer/volunteeruserids")
Result<List<String>> volunteerUserIds(@RequestBody CommonCustomerFormDTO customerFormDTO); Result<List<String>> volunteerUserIds(@RequestBody CommonCustomerFormDTO customerFormDTO);
/**
* 查询用户创建的未结束的活动
*
* @author zhaoqifeng
* @date 2020/8/28 14:38
* @param staffId
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.ActInfoDTO>>
*/
@PostMapping("/heart/resi/act/published/{staffId}")
Result<List<ActInfoDTO>> getPublishedAct(@PathVariable String staffId);
} }

6
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java

@ -3,6 +3,7 @@ package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.form.CommonCustomerFormDTO; import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.feign.EpmetHeartOpenFeignClient; import com.epmet.feign.EpmetHeartOpenFeignClient;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -29,4 +30,9 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
public Result<List<String>> volunteerUserIds(CommonCustomerFormDTO customerFormDTO) { public Result<List<String>> volunteerUserIds(CommonCustomerFormDTO customerFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "volunteerUserIds", customerFormDTO); return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "volunteerUserIds", customerFormDTO);
} }
@Override
public Result<List<ActInfoDTO>> getPublishedAct(String staffId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "getPublishedAct", staffId);
}
} }

13
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java

@ -3,6 +3,7 @@ package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.form.resi.*; import com.epmet.dto.form.resi.*;
import com.epmet.dto.result.resi.*; import com.epmet.dto.result.resi.*;
import com.epmet.service.*; import com.epmet.service.*;
@ -331,4 +332,16 @@ public class ResiActListController {
ValidatorUtils.validateEntity(formDTO, ResiActContentFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, ResiActContentFormDTO.AddUserInternalGroup.class);
return actInfoService.checkSignInTime(formDTO); return actInfoService.checkSignInTime(formDTO);
} }
/**
* 查询用户创建的未结束的活动
* @author zhaoqifeng
* @date 2020/8/28 14:37
* @param staffId
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.ActInfoDTO>>
*/
@PostMapping("published/{staffId}")
public Result<List<ActInfoDTO>> getPublishedAct(@PathVariable String staffId) {
return new Result<List<ActInfoDTO>>().ok(actInfoService.getPublishedAct(staffId));
}
} }

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java

@ -310,4 +310,13 @@ public interface ActInfoDao extends BaseDao<ActInfoEntity> {
* @Date 11:00 2020-07-20 * @Date 11:00 2020-07-20
**/ **/
List<ResiLookBackActResultDTO> selectListLookBackActAssembly(ResiLatestActFormDTO formDTO); List<ResiLookBackActResultDTO> selectListLookBackActAssembly(ResiLatestActFormDTO formDTO);
/**
* 查询用户创建的未结束的活动
* @author zhaoqifeng
* @date 2020/8/28 14:27
* @param staffId
* @return java.util.List<com.epmet.dto.ActInfoDTO>
*/
List<ActInfoDTO> selectPublishedAct(@Param("staffId") String staffId);
} }

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java

@ -245,4 +245,13 @@ public interface ActInfoService extends BaseService<ActInfoEntity> {
* @Date 15:03 2020-08-05 * @Date 15:03 2020-08-05
**/ **/
Result<ResiActRegistrationResultDTO> checkSignInTime(ResiActContentFormDTO formDTO); Result<ResiActRegistrationResultDTO> checkSignInTime(ResiActContentFormDTO formDTO);
/**
* 查询用户创建的未结束的活动
* @author zhaoqifeng
* @date 2020/8/28 14:32
* @param staffId
* @return java.util.List<com.epmet.dto.ActInfoDTO>
*/
List<ActInfoDTO> getPublishedAct(String staffId);
} }

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java

@ -416,4 +416,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
} }
return new Result<ResiActRegistrationResultDTO>().ok(resultDTO); return new Result<ResiActRegistrationResultDTO>().ok(resultDTO);
} }
@Override
public List<ActInfoDTO> getPublishedAct(String staffId) {
return baseDao.selectPublishedAct(staffId);
}
} }

8
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml

@ -758,4 +758,12 @@
ORDER BY a.CREATED_TIME DESC ORDER BY a.CREATED_TIME DESC
LIMIT 0, #{num} LIMIT 0, #{num}
</select> </select>
<select id="selectPublishedAct" resultType="com.epmet.dto.ActInfoDTO">
SELECT ID,
TITLE
FROM act_info
WHERE DEL_FLAG = '0'
AND ACT_STATUS = 'published'
AND CREATED_BY = #{staffId}
</select>
</mapper> </mapper>

6
epmet-module/gov-org/gov-org-server/pom.xml

@ -89,6 +89,12 @@
<version>2.0.0</version> <version>2.0.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-heart-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java

@ -84,4 +84,13 @@ public interface CustomerDepartmentDao extends BaseDao<CustomerDepartmentEntity>
* @Description 查询机关下部门列表信息 * @Description 查询机关下部门列表信息
**/ **/
List<AgencyDeptList> selectAgencyDeptMsgList(@Param("agencyId") String agencyId); List<AgencyDeptList> selectAgencyDeptMsgList(@Param("agencyId") String agencyId);
/**
* 删除工作人员与部门关联
* @author zhaoqifeng
* @date 2020/8/28 15:12
* @param staffId
* @return void
*/
void deleteStaffDep(@Param("staffId") String staffId);
} }

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

@ -224,4 +224,22 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
* @date 2020/8/12 5:10 下午 * @date 2020/8/12 5:10 下午
*/ */
Integer selectGridCount(@Param("customerId")String customerId); Integer selectGridCount(@Param("customerId")String customerId);
/**
* 删除工作人员与网格关联
* @author zhaoqifeng
* @date 2020/8/28 15:32
* @param staffId
* @return void
*/
void deleteGridStaff(@Param("staffId") String staffId);
/**
* 查询工作人员所在网格
* @author zhaoqifeng
* @date 2020/8/28 15:41
* @param staffId
* @return java.util.List<com.epmet.entity.CustomerGridEntity>
*/
List<CustomerGridEntity> selectGridByStaff(@Param("staffId") String staffId);
} }

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java

@ -92,4 +92,14 @@ public interface CustomerDepartmentService extends BaseService<CustomerDepartmen
* @date 2020-04-20 * @date 2020-04-20
*/ */
void delete(String[] ids); void delete(String[] ids);
/**
* 更新部门工作人员关系
*
* @author zhaoqifeng
* @date 2020/8/28 15:20
* @param staffId
* @return void
*/
void updateDepartment(String staffId);
} }

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

@ -259,4 +259,13 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
* @date 2020/8/14 9:31 上午 * @date 2020/8/14 9:31 上午
*/ */
CustomerGridCountResultDTO selectGridCount( CustomerIdFormDTO customerIdFormDTO); CustomerGridCountResultDTO selectGridCount( CustomerIdFormDTO customerIdFormDTO);
/**
* 更新网格工作人员关系
* @author zhaoqifeng
* @date 2020/8/28 15:36
* @param staffId
* @return void
*/
void updateGrid(String staffId);
} }

24
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java

@ -20,11 +20,13 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.CustomerDepartmentDao; import com.epmet.dao.CustomerDepartmentDao;
import com.epmet.dto.CustomerDepartmentDTO; import com.epmet.dto.CustomerDepartmentDTO;
import com.epmet.dto.result.DepartmentListResultDTO;
import com.epmet.entity.CustomerDepartmentEntity; import com.epmet.entity.CustomerDepartmentEntity;
import com.epmet.redis.CustomerDepartmentRedis; import com.epmet.redis.CustomerDepartmentRedis;
import com.epmet.service.CustomerDepartmentService; import com.epmet.service.CustomerDepartmentService;
@ -33,6 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -101,4 +104,25 @@ public class CustomerDepartmentServiceImpl extends BaseServiceImpl<CustomerDepar
baseDao.deleteBatchIds(Arrays.asList(ids)); baseDao.deleteBatchIds(Arrays.asList(ids));
} }
@Override
@Transactional(rollbackFor = Exception.class)
public void updateDepartment(String staffId) {
//获取工作人员所在部门及部门总人数
List<DepartmentListResultDTO> list = baseDao.listDepartmentListByStaffId(staffId);
if (null != list && list.size() > NumConstant.ZERO) {
List<CustomerDepartmentEntity> entityList = new ArrayList<>();
for (DepartmentListResultDTO dto : list) {
CustomerDepartmentEntity entity = new CustomerDepartmentEntity();
entity.setId(dto.getDepartmentId());
entity.setTotalUser(dto.getTotalUser() - NumConstant.ONE);
entityList.add(entity);
}
//更新部门总人数
updateBatchById(entityList);
//删除工作人员与部门关联
baseDao.deleteStaffDep(staffId);
}
}
} }

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

@ -649,4 +649,17 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
return customerGridCount; return customerGridCount;
} }
@Override
@Transactional(rollbackFor = Exception.class)
public void updateGrid(String staffId) {
List<CustomerGridEntity> gridList = baseDao.selectGridByStaff(staffId);
if(null != gridList && gridList.size() > NumConstant.ZERO) {
gridList.forEach(entity -> {
entity.setTotalUser(entity.getTotalUser() - 1);
});
updateBatchById(gridList);
baseDao.deleteGridStaff(staffId);
}
}
} }

52
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java

@ -5,19 +5,16 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.*;
import com.epmet.dto.CustomerStaffAgencyDTO;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.CustomerStaffAgencyEntity; import com.epmet.entity.CustomerStaffAgencyEntity;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.GovProjectOpenFeignClient; import com.epmet.feign.GovProjectOpenFeignClient;
import com.epmet.feign.OperCrmFeignClient; import com.epmet.feign.OperCrmFeignClient;
import com.epmet.service.CustomerAgencyService; import com.epmet.service.*;
import com.epmet.service.CustomerStaffAgencyService;
import com.epmet.service.StaffService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -43,6 +40,14 @@ public class StaffServiceImpl implements StaffService {
private CustomerStaffAgencyService customerStaffAgencyService; private CustomerStaffAgencyService customerStaffAgencyService;
@Autowired @Autowired
private GovProjectOpenFeignClient govProjectOpenFeignClient; private GovProjectOpenFeignClient govProjectOpenFeignClient;
@Autowired
private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient;
@Autowired
private CustomerDepartmentService customerDepartmentService;
@Autowired
private CustomerGridService customerGridService;
@Autowired
private StaffTransferRecordService staffTransferRecordService;
@Override @Override
public Result<StaffsInAgencyResultDTO> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { public Result<StaffsInAgencyResultDTO> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) {
@ -188,6 +193,7 @@ public class StaffServiceImpl implements StaffService {
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void staffTransfer(TokenDto tokenDto, StaffTransferFormDTO fromDTO) { public void staffTransfer(TokenDto tokenDto, StaffTransferFormDTO fromDTO) {
//1.获取工作人员与机关关系 //1.获取工作人员与机关关系
CustomerStaffAgencyDTO staffAgencyDTO = customerStaffAgencyService.getInfoByUserId(fromDTO.getStaffId()); CustomerStaffAgencyDTO staffAgencyDTO = customerStaffAgencyService.getInfoByUserId(fromDTO.getStaffId());
@ -206,11 +212,37 @@ public class StaffServiceImpl implements StaffService {
throw new RenException(EpmetErrorCode.EXIT_PEND_PROJECT.getCode()); throw new RenException(EpmetErrorCode.EXIT_PEND_PROJECT.getCode());
} }
//3.查询是否有活动未结束 //3.查询是否有活动未结束
Result<List<ActInfoDTO>> actInfoResult = epmetHeartOpenFeignClient.getPublishedAct(fromDTO.getStaffId());
if (!actInfoResult.success()) {
throw new RenException(actInfoResult.getCode(), actInfoResult.getMsg());
}
if (null != actInfoResult.getData() && actInfoResult.getData().size() > NumConstant.ZERO) {
throw new RenException(EpmetErrorCode.EXIT_PUBLISHED_ACTIVITY.getCode());
}
//4.修改人员所属组织 //4.修改人员所属组织
CustomerStaffAgencyDTO staffAgency = new CustomerStaffAgencyDTO();
//5.逻辑删除工作人员原组织加入的部门、网格,组织人员总数旧的减1新的加1,部门、网格总人数减1 staffAgency.setId(staffAgencyDTO.getId());
staffAgency.setAgencyId(fromDTO.getAgencyId());
customerStaffAgencyService.update(staffAgency);
//原来组织总人数减一
CustomerAgencyDTO oldAgencyDTO = customerAgencyService.get(oldAgency);
oldAgencyDTO.setTotalUser(oldAgencyDTO.getTotalUser() - NumConstant.ONE);
customerAgencyService.update(oldAgencyDTO);
//新组织总人数加一
CustomerAgencyDTO newAgencyDTO = customerAgencyService.get(fromDTO.getAgencyId());
newAgencyDTO.setTotalUser(newAgencyDTO.getTotalUser() - NumConstant.ONE);
customerAgencyService.update(newAgencyDTO);
//5.逻辑删除工作人员原组织加入的部门、网格,部门、网格总人数减1
customerDepartmentService.updateDepartment(fromDTO.getStaffId());
customerGridService.updateGrid(fromDTO.getStaffId());
//6.操作记录表新增调动记录 //6.操作记录表新增调动记录
StaffTransferRecordDTO staffTransferRecordDTO = new StaffTransferRecordDTO();
staffTransferRecordDTO.setCustomerId(tokenDto.getCustomerId());
staffTransferRecordDTO.setOperateStaffId(tokenDto.getUserId());
staffTransferRecordDTO.setOperatedStaffId(fromDTO.getStaffId());
staffTransferRecordDTO.setOldAgencyId(oldAgency);
staffTransferRecordDTO.setAgencyId(fromDTO.getAgencyId());
staffTransferRecordDTO.setRemarks(fromDTO.getRemarks());
staffTransferRecordService.save(staffTransferRecordDTO);
} }
} }

5
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml

@ -2,6 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.CustomerDepartmentDao"> <mapper namespace="com.epmet.dao.CustomerDepartmentDao">
<delete id="deleteStaffDep">
UPDATE customer_staff_department SET DEL_FLAG = '1'
WHERE USER_ID = #{staffId} AND DEL_FLAG = '0'
</delete>
<select id="selectDepartmentListByAgencyId" resultType="com.epmet.dto.result.DepartmentListResultDTO"> <select id="selectDepartmentListByAgencyId" resultType="com.epmet.dto.result.DepartmentListResultDTO">
SELECT SELECT
@ -32,6 +36,7 @@
from customer_staff_department csd from customer_staff_department csd
inner join customer_department cd on (csd.DEPARTMENT_ID = cd.ID) inner join customer_department cd on (csd.DEPARTMENT_ID = cd.ID)
where csd.USER_ID = #{staffId} where csd.USER_ID = #{staffId}
and csd.DEL_FLAG = '0'
</select> </select>
<!-- 根据部门id查询customerId --> <!-- 根据部门id查询customerId -->

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

@ -2,6 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.CustomerGridDao"> <mapper namespace="com.epmet.dao.CustomerGridDao">
<delete id="deleteGridStaff">
UPDATE customer_staff_grid SET DEL_FLAG = '1'
WHERE USER_ID = #{staffId} AND DEL_FLAG = '0'
</delete>
<select id="getCustomerGridByGridId" parameterType="com.epmet.dto.form.CustomerGridFormDTO" <select id="getCustomerGridByGridId" parameterType="com.epmet.dto.form.CustomerGridFormDTO"
resultType="com.epmet.dto.CustomerGridDTO"> resultType="com.epmet.dto.CustomerGridDTO">
SELECT SELECT
@ -473,4 +477,17 @@
del_flag = '0' del_flag = '0'
AND customer_id = #{customerId} AND customer_id = #{customerId}
</select> </select>
<select id="selectGridByStaff" resultType="com.epmet.entity.CustomerGridEntity">
SELECT
g.ID,
g.GRID_NAME,
g.TOTAL_USER
FROM
customer_staff_grid sg
INNER JOIN customer_grid g ON ( sg.GRID_ID = g.ID )
WHERE
sg.DEL_FLAG = '0'
AND g.DEL_FLAG = '0'
AND sg.USER_ID = #{staffId}
</select>
</mapper> </mapper>
Loading…
Cancel
Save