数据查询 数据库名调整为动态注入

This commit is contained in:
dxfeng 2025-07-11 16:43:48 +08:00
parent 3339821988
commit 972a751328
11 changed files with 131 additions and 101 deletions

View File

@ -0,0 +1,19 @@
package com.weaver.seconddev.portal.entity.param;
import lombok.Data;
/**
* @author:dxfeng
* @createTime: 2025/07/11
* @version: 1.0
*/
@Data
public class BaseParam {
private String e10_common = "e10_common";
private String e10_core_business = "e10_core_business";
private String e10_other_business = "e10_other_business";
private String ec_secondev = "ec_secondev";
private String eteams = "eteams";
private String table_dept_cus = "ft_1154218872715993098";
}

View File

@ -1,6 +1,7 @@
package com.weaver.seconddev.portal.entity.param;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Set;
@ -10,7 +11,8 @@ import java.util.Set;
* @version: 1.0
*/
@Data
public class BasicPersonnelParam {
@EqualsAndHashCode(callSuper = false)
public class BasicPersonnelParam extends BaseParam{
private Set<Long> departmentIdList;
private String searchType;
private String startDate;

View File

@ -1,6 +1,7 @@
package com.weaver.seconddev.portal.entity.param;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Set;
@ -10,7 +11,8 @@ import java.util.Set;
* @version: 1.0
*/
@Data
public class HrbpParam {
@EqualsAndHashCode(callSuper = false)
public class HrbpParam extends BaseParam{
private String tenantKey;
private Set<Long> departmentIdList;
}

View File

@ -1,6 +1,7 @@
package com.weaver.seconddev.portal.entity.param;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Set;
@ -10,7 +11,8 @@ import java.util.Set;
* @version: 1.0
*/
@Data
public class SearchConditionParam {
@EqualsAndHashCode(callSuper = false)
public class SearchConditionParam extends BaseParam{
private String tenantKey;
private String departmentId;
private Set<Long> departmentIdList;

View File

@ -37,79 +37,79 @@ public interface LeaderCockpitMapper {
/**
* 查询入职人数
*
* @param tenantKey
* @param param
* @param departmentIdList
* @param startDate
* @param endDate
* @return
*/
int getEmploymentCount(@Param("tenantKey") String tenantKey, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
int getEmploymentCount(@Param("param") SearchConditionParam param, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
/**
* 查询入职人数列表
*
* @param tenantKey
* @param param
* @param departmentIdList
* @param startDate
* @param endDate
* @return
*/
List<PortalPO> getEmploymentListByPosition(@Param("tenantKey") String tenantKey, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
List<PortalPO> getEmploymentListByPosition(@Param("param") SearchConditionParam param, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
/**
* 查询关键入职人数
*
* @param tenantKey
* @param param
* @param departmentIdList
* @param startDate
* @param endDate
* @return
*/
int getKeyEmploymentCount(@Param("tenantKey") String tenantKey, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
int getKeyEmploymentCount(@Param("param") SearchConditionParam param, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
/**
* 查询离职人数
*
* @param tenantKey
* @param param
* @param departmentIdList
* @param startDate
* @param endDate
* @return
*/
int getResignCount(@Param("tenantKey") String tenantKey, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
int getResignCount(@Param("param") SearchConditionParam param, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
/**
* 查询关键离职人数
*
* @param tenantKey
* @param param
* @param departmentIdList
* @param startDate
* @param endDate
* @return
*/
int getKeyResignCount(@Param("tenantKey") String tenantKey, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
int getKeyResignCount(@Param("param") SearchConditionParam param, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
/**
* 查询离职人数列表
*
* @param tenantKey
* @param param
* @param departmentIdList
* @param startDate
* @param endDate
* @return
*/
List<PortalPO> getResignListByPosition(@Param("tenantKey") String tenantKey, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
List<PortalPO> getResignListByPosition(@Param("param") SearchConditionParam param, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startDate") String startDate, @Param("endDate") String endDate);
Position getPositionById(@Param("tenantKey") String tenantKey, @Param("positionId") String positionId);
Position getPositionById(@Param("param") SearchConditionParam param, @Param("positionId") String positionId);
/**
* 获取顶级部门id列表
*
* @param tenantKey
* @param param
* @return
*/
Set<Long> getTopDepartmentIds(@Param("tenantKey") String tenantKey);
Set<Long> getTopDepartmentIds(@Param("param") SearchConditionParam param);
}

View File

@ -59,11 +59,11 @@ public interface ManagerPortalMapper {
/**
* 获取所负责的顶级部门
*
* @param tenantKey
* @param param
* @param emdId
* @return
*/
List<Long> getManageDeptIds(@Param("tenantKey") String tenantKey, @Param("empId") Long emdId);
List<Long> getManageDeptIds(@Param("param") BasicPersonnelParam param, @Param("empId") Long emdId);
/**
* 获取生日人数
@ -101,24 +101,24 @@ public interface ManagerPortalMapper {
/**
* 获取年龄统计数据
*
* @param tenantKey
* @param param
* @param departmentIdList
* @param startIndex
* @param endIndex
* @return
*/
Integer getAgeCount(@Param("tenantKey") String tenantKey, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startIndex") Integer startIndex, @Param("endIndex") Integer endIndex);
Integer getAgeCount(@Param("param") BasicPersonnelParam param, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startIndex") Integer startIndex, @Param("endIndex") Integer endIndex);
/**
* 获取司龄统计数据
*
* @param tenantKey
* @param param
* @param departmentIdList
* @param startIndex
* @param endIndex
* @return
*/
Integer getComapnyCount(@Param("tenantKey") String tenantKey, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startIndex") Integer startIndex, @Param("endIndex") Integer endIndex);
Integer getComapnyCount(@Param("param") BasicPersonnelParam param, @Param("departmentIdList") Collection<Long> departmentIdList, @Param("startIndex") Integer startIndex, @Param("endIndex") Integer endIndex);
/**
* 饼状图配置信息

View File

@ -62,9 +62,9 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
// 查询范围内在职人员
int onJobCount = leaderCockpitMapper.getOnJobCount(searchConditionParam);
// 查询范围内离职人员
int resignCount = leaderCockpitMapper.getResignCount(searchConditionParam.getTenantKey(), searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
int resignCount = leaderCockpitMapper.getResignCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
// 查询关键离职率
int keyResignCount = leaderCockpitMapper.getKeyResignCount(searchConditionParam.getTenantKey(), searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
int keyResignCount = leaderCockpitMapper.getKeyResignCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
// 计算离职率
double turnoverRate = calculateRate(keyResignCount, onJobCount);
//TODO 计算关键离职率
@ -101,15 +101,15 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
String month = DateUtil.formatToYearMonth_ZH(localDate);
Map<String, Integer> allDataMap = new LinkedHashMap<>(3);
Map<String, Integer> keyDataMap = new LinkedHashMap<>(3);
allDataMap.put(month, leaderCockpitMapper.getEmploymentCount(searchConditionParam.getTenantKey(), searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate()));
keyDataMap.put(month, leaderCockpitMapper.getKeyEmploymentCount(searchConditionParam.getTenantKey(), searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate()));
allDataMap.put(month, leaderCockpitMapper.getEmploymentCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate()));
keyDataMap.put(month, leaderCockpitMapper.getKeyEmploymentCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate()));
String firstDayOfMonthStr = DateUtil.getFirstDayOfPreviousMonthStr(searchConditionParam.getStartDate());
String lastDayOfMonthStr = DateUtil.getLastDayOfPreviousMonthStr(searchConditionParam.getEndDate());
// 前面5个月
for (int i = 1; i < 7; i++) {
allDataMap.put(DateUtil.formatToYearMonth_ZH(firstDayOfMonthStr), leaderCockpitMapper.getEmploymentCount(searchConditionParam.getTenantKey(), searchConditionParam.getDepartmentIdList(), firstDayOfMonthStr, lastDayOfMonthStr));
keyDataMap.put(DateUtil.formatToYearMonth_ZH(firstDayOfMonthStr), leaderCockpitMapper.getKeyEmploymentCount(searchConditionParam.getTenantKey(), searchConditionParam.getDepartmentIdList(), firstDayOfMonthStr, lastDayOfMonthStr));
allDataMap.put(DateUtil.formatToYearMonth_ZH(firstDayOfMonthStr), leaderCockpitMapper.getEmploymentCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), firstDayOfMonthStr, lastDayOfMonthStr));
keyDataMap.put(DateUtil.formatToYearMonth_ZH(firstDayOfMonthStr), leaderCockpitMapper.getKeyEmploymentCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), firstDayOfMonthStr, lastDayOfMonthStr));
firstDayOfMonthStr = DateUtil.getFirstDayOfPreviousMonthStr(searchConditionParam.getStartDate(), i);
lastDayOfMonthStr = DateUtil.getLastDayOfPreviousMonthStr(searchConditionParam.getEndDate(), i);
}
@ -121,7 +121,7 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
log.error("selectDepartmentId===" + JSON.toJSONString(selectDepartmentId));
if (CollectionUtils.isEmpty(selectDepartmentId)) {
// 未选择部门查询所有一级部门数据
selectDepartmentId = leaderCockpitMapper.getTopDepartmentIds(searchConditionParam.getTenantKey());
selectDepartmentId = leaderCockpitMapper.getTopDepartmentIds(searchConditionParam);
log.error("topDepartmentId===" + JSON.toJSONString(selectDepartmentId));
}
@ -135,9 +135,9 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
portalData.setDate(currentMonth);
portalData.setDepart(departMentById.getDepartMentName());
// 关键
int keyEmploymentCount = leaderCockpitMapper.getKeyEmploymentCount(searchConditionParam.getTenantKey(), beLongDeps, searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
int keyEmploymentCount = leaderCockpitMapper.getKeyEmploymentCount(searchConditionParam, beLongDeps, searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
// 非关键
int employmentCount = leaderCockpitMapper.getEmploymentCount(searchConditionParam.getTenantKey(), beLongDeps, searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
int employmentCount = leaderCockpitMapper.getEmploymentCount(searchConditionParam, beLongDeps, searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
portalData.setKey(keyEmploymentCount);
portalData.setAll(employmentCount);
portalList.add(portalData);
@ -168,15 +168,15 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
String month = DateUtil.formatToYearMonth_ZH(localDate);
Map<String, Integer> allDataMap = new LinkedHashMap<>(3);
Map<String, Integer> keyDataMap = new LinkedHashMap<>(3);
allDataMap.put(month, leaderCockpitMapper.getResignCount(searchConditionParam.getTenantKey(), searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate()));
keyDataMap.put(month, leaderCockpitMapper.getKeyResignCount(searchConditionParam.getTenantKey(), searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate()));
allDataMap.put(month, leaderCockpitMapper.getResignCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate()));
keyDataMap.put(month, leaderCockpitMapper.getKeyResignCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), searchConditionParam.getStartDate(), searchConditionParam.getEndDate()));
String firstDayOfMonthStr = DateUtil.getFirstDayOfPreviousMonthStr(searchConditionParam.getStartDate());
String lastDayOfMonthStr = DateUtil.getLastDayOfPreviousMonthStr(searchConditionParam.getEndDate());
// 前两个月
for (int i = 1; i < 7; i++) {
allDataMap.put(DateUtil.formatToYearMonth_ZH(firstDayOfMonthStr), leaderCockpitMapper.getResignCount(searchConditionParam.getTenantKey(), searchConditionParam.getDepartmentIdList(), firstDayOfMonthStr, lastDayOfMonthStr));
keyDataMap.put(DateUtil.formatToYearMonth_ZH(firstDayOfMonthStr), leaderCockpitMapper.getKeyResignCount(searchConditionParam.getTenantKey(), searchConditionParam.getDepartmentIdList(), firstDayOfMonthStr, lastDayOfMonthStr));
allDataMap.put(DateUtil.formatToYearMonth_ZH(firstDayOfMonthStr), leaderCockpitMapper.getResignCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), firstDayOfMonthStr, lastDayOfMonthStr));
keyDataMap.put(DateUtil.formatToYearMonth_ZH(firstDayOfMonthStr), leaderCockpitMapper.getKeyResignCount(searchConditionParam, searchConditionParam.getDepartmentIdList(), firstDayOfMonthStr, lastDayOfMonthStr));
firstDayOfMonthStr = DateUtil.getFirstDayOfPreviousMonthStr(searchConditionParam.getStartDate(), i);
lastDayOfMonthStr = DateUtil.getLastDayOfPreviousMonthStr(searchConditionParam.getEndDate(), i);
@ -188,7 +188,7 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
log.error("selectDepartmentId===" + JSON.toJSONString(selectDepartmentId));
if (CollectionUtils.isEmpty(selectDepartmentId)) {
// 未选择部门查询所有一级部门数据
selectDepartmentId = leaderCockpitMapper.getTopDepartmentIds(searchConditionParam.getTenantKey());
selectDepartmentId = leaderCockpitMapper.getTopDepartmentIds(searchConditionParam);
log.error("topDepartmentId===" + JSON.toJSONString(selectDepartmentId));
}
// 查询每个部门 时间范围内的离职人数
@ -201,9 +201,9 @@ public class LeaderCockpitServiceImpl implements LeaderCockpitService {
portalData.setDate(currentMonth);
portalData.setDepart(departMentById.getDepartMentName());
// 关键
int keyEmploymentCount = leaderCockpitMapper.getKeyResignCount(searchConditionParam.getTenantKey(), beLongDeps, searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
int keyEmploymentCount = leaderCockpitMapper.getKeyResignCount(searchConditionParam, beLongDeps, searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
// 非关键
int employmentCount = leaderCockpitMapper.getResignCount(searchConditionParam.getTenantKey(), beLongDeps, searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
int employmentCount = leaderCockpitMapper.getResignCount(searchConditionParam, beLongDeps, searchConditionParam.getStartDate(), searchConditionParam.getEndDate());
portalData.setKey(keyEmploymentCount);
portalData.setAll(employmentCount);
portalList.add(portalData);

View File

@ -56,7 +56,9 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
@Override
public WeaResult<Map<String, Object>> getMangerInfo(Map<String, String> params) {
User currentUser = UserContext.getCurrentUser();
Set<Long> allDepartmentIds = getAllDepartmentIdList(currentUser);
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
Set<Long> allDepartmentIds = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
List<HrmDepartmentComInfo> departmentList = hrmComInfoCacheHandler.getCacheList(HrmDepartmentComInfo.class, allDepartmentIds);
// 获取顶级部门
List<HrmDepartmentComInfo> topDepartmentList = departmentList.stream()
@ -84,9 +86,10 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
String searchDate = params.get("searchDate");
User currentUser = UserContext.getCurrentUser();
Set<Long> allDepartmentIdList = getAllDepartmentIdList(currentUser);
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
Set<Long> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
// 设置部门范围ID集合
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
@ -146,9 +149,10 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
@Override
public WeaResult<Map<String, Object>> getTeamMemorialDay(Map<String, String> params) {
User currentUser = UserContext.getCurrentUser();
Set<Long> allDepartmentIdList = getAllDepartmentIdList(currentUser);
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
Set<Long> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
// 设置部门范围ID集合
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
int birthdayNum = managerPortalMapper.getBirthdayNum(basicPersonnelParam);
@ -186,9 +190,9 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
type = "education";
}
User currentUser = UserContext.getCurrentUser();
Set<Long> allDepartmentIdList = getAllDepartmentIdList(currentUser);
BasicPersonnelParam basicPersonnelParam = new BasicPersonnelParam();
basicPersonnelParam.setTenantKey(currentUser.getTenantKey());
Set<Long> allDepartmentIdList = getAllDepartmentIdList(basicPersonnelParam, currentUser.getEmployeeId());
// 设置部门范围ID集合
basicPersonnelParam.setDepartmentIdList(allDepartmentIdList);
basicPersonnelParam.setPieType(type);
@ -269,7 +273,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
PortalPO portalPO = new PortalPO();
portalPO.setName(pieChartConfig.getName());
// 查询时间段内的数据
Integer ageCount = managerPortalMapper.getAgeCount(basicPersonnelParam.getTenantKey(), basicPersonnelParam.getDepartmentIdList(), pieChartConfig.getStartIndex(), pieChartConfig.getEndIndex());
Integer ageCount = managerPortalMapper.getAgeCount(basicPersonnelParam, basicPersonnelParam.getDepartmentIdList(), pieChartConfig.getStartIndex(), pieChartConfig.getEndIndex());
portalPO.setValue(String.valueOf(ageCount));
returnList.add(portalPO);
}
@ -288,7 +292,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
PortalPO portalPO = new PortalPO();
portalPO.setName(pieChartConfig.getName());
// 查询时间段内的数据
Integer ageCount = managerPortalMapper.getComapnyCount(basicPersonnelParam.getTenantKey(), basicPersonnelParam.getDepartmentIdList(), pieChartConfig.getStartIndex(), pieChartConfig.getEndIndex());
Integer ageCount = managerPortalMapper.getComapnyCount(basicPersonnelParam, basicPersonnelParam.getDepartmentIdList(), pieChartConfig.getStartIndex(), pieChartConfig.getEndIndex());
portalPO.setValue(String.valueOf(ageCount));
returnList.add(portalPO);
}
@ -300,9 +304,9 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
*
* @return
*/
private Set<Long> getAllDepartmentIdList(User currentUser) {
private Set<Long> getAllDepartmentIdList(BasicPersonnelParam basicPersonnelParam, Long employeeId) {
// 查询所负责的部门
List<Long> manageDeptIds = managerPortalMapper.getManageDeptIds(currentUser.getTenantKey(), currentUser.getEmployeeId());
List<Long> manageDeptIds = managerPortalMapper.getManageDeptIds(basicPersonnelParam, employeeId);
// 查询所有的部门子部门信息
Set<WeaDepartMent> allDepartmentList = new HashSet<>();
for (Long manageDeptId : manageDeptIds) {

View File

@ -3,7 +3,7 @@
<mapper namespace="com.weaver.seconddev.portal.mapper.HrbpPortalMapper">
<select id="getToEntryCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_rzgl t
select count(t.id) from ${e10_common}.uf_jcl_rzgl t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.rzzt = 0
<if test="departmentIdList != null and departmentIdList.size() > 0">
@ -16,7 +16,7 @@
</select>
<select id="getToRegularCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
select count(t.id) from ${e10_common}.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status in(1,3)
<if test="departmentIdList != null and departmentIdList.size() > 0">
@ -28,7 +28,7 @@
</select>
<select id="getToLeaveCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_lzsq t
select count(t.id) from ${e10_common}.uf_jcl_lzsq t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.flow_status in (1, 2, 3)
and (t.zhgzr is null or t.zhgzr = '' or zhgzr >current_date())
@ -45,58 +45,58 @@
</select>
<select id="getAllEmployeeCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
select count(t.id) from ${e10_common}.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status not in (5,6)
</select>
<select id="getFormalEmployeeCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
select count(t.id) from ${e10_common}.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status not in (5,6)
and t.yglx=1109770887364624394
</select>
<select id="getInternEmployeeCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
select count(t.id) from ${e10_common}.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status not in (5,6)
and t.yglx=1109772927499255817
</select>
<select id="getOutsourcingCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
select count(t.id) from ${e10_common}.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status not in (5,6)
and t.yglx=1109775968260603906
</select>
<select id="getLaborCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
select count(t.id) from ${e10_common}.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status not in (5,6)
and t.yglx=1109776092848209920
</select>
<select id="getProbationCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
select count(t.id) from ${e10_common}.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status = 1
</select>
<select id="getFormalCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
select count(t.id) from ${e10_common}.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status = 2
</select>
<select id="getInternCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
select count(t.id) from ${e10_common}.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status = 4
</select>
<select id="getLeaveCount" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_employee_information t
select count(t.id) from ${e10_common}.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.personnel_status = 5
</select>

View File

@ -4,8 +4,8 @@
<select id="getOnJobNumber" resultType="com.weaver.seconddev.portal.entity.po.PortalPO">
select count(t.id) as value ,b.yglxmc as name from e10_common.uf_jcl_employee_information t
inner join e10_common.uf_jcl_yglx b on t.yglx = b.id
select count(t.id) as value ,b.yglxmc as name from ${e10_common}.uf_jcl_employee_information t
inner join ${e10_common}.uf_jcl_yglx b on t.yglx = b.id
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
@ -21,7 +21,7 @@
</select>
<select id="getOnJobCount" resultType="java.lang.Integer">
select count(t.id) as value from e10_common.uf_jcl_employee_information t
select count(t.id) as value from ${e10_common}.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
@ -36,8 +36,8 @@
</select>
<select id="getResignCount" resultType="java.lang.Integer">
select count(id) as value from e10_common.uf_jcl_lzxxjl t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
select count(id) as value from ${param.e10_common}.uf_jcl_lzxxjl t
where t.delete_type = 0 and t.tenant_key = #{param.tenantKey}
and t.lzzt = 1
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.lzqbm IN
@ -50,8 +50,8 @@
</select>
<select id="getKeyResignCount" resultType="java.lang.Integer">
select count(id) as value from e10_common.uf_jcl_lzxxjl t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
select count(id) as value from ${param.e10_common}.uf_jcl_lzxxjl t
where t.delete_type = 0 and t.tenant_key = #{param.tenantKey}
and t.lzzt = 1
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.lzqbm IN
@ -64,8 +64,8 @@
and t.zhgzr &lt;= #{endDate}
</select>
<select id="getEmploymentCount" resultType="java.lang.Integer">
select count(id) as value from e10_common.uf_jcl_rzgl t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
select count(id) as value from ${param.e10_common}.uf_jcl_rzgl t
where t.delete_type = 0 and t.tenant_key = #{param.tenantKey}
and t.rzzt = 1
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
@ -77,8 +77,8 @@
and t.hiredate &lt;= #{endDate}
</select>
<select id="getKeyEmploymentCount" resultType="java.lang.Integer">
select count(id) as value from e10_common.uf_jcl_rzgl t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
select count(id) as value from ${param.e10_common}.uf_jcl_rzgl t
where t.delete_type = 0 and t.tenant_key = #{param.tenantKey}
and t.rzzt = 1
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
@ -92,8 +92,8 @@
</select>
<select id="getEmploymentListByPosition" resultType="com.weaver.seconddev.portal.entity.po.PortalPO">
select count(id) as name,position as value from e10_common.uf_jcl_rzgl t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
select count(id) as name,position as value from ${param.e10_common}.uf_jcl_rzgl t
where t.delete_type = 0 and t.tenant_key = #{param.tenantKey}
and t.rzzt = 1
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
@ -111,15 +111,16 @@
select p.id as position_id, p.name as position_name,
d.id as department_id, d.name as department_name,
g.id as grade_id, g.name as grade_name
from eteams.position p
left join eteams.department d on p.department = d.id
left join eteams.grade g on p.grade_id = g.id
where p.id = #{positionId} and p.delete_type = 0 and p.tenant_key = #{tenantKey} limit 1
from ${param.eteams}.position p
left join ${param.eteams}.department d on p.department = d.id
left join ${param.eteams}.grade g on p.grade_id = g.id
where p.id = #{positionId} and p.delete_type = 0
and p.tenant_key = #{param.tenantKey} limit 1
</select>
<select id="getResignListByPosition" resultType="com.weaver.seconddev.portal.entity.po.PortalPO">
select count(id) as name,lzqgw as value from e10_common.uf_jcl_lzxxjl t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
select count(id) as name,lzqgw as value from ${param.e10_common}.uf_jcl_lzxxjl t
where t.delete_type = 0 and t.tenant_key = #{param.tenantKey}
and t.lzzt = 1
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.lzqbm IN
@ -134,15 +135,15 @@
</select>
<select id="getTopDepartmentIds" resultType="java.lang.Long">
select t.id
from eteams.department t
inner join eteams.department t1 on t.parent = t1.id
from ${param.eteams}.department t
inner join ${param.eteams}.department t1 on t.parent = t1.id
where t.type = 'department'
and t1.type = 'subcompany'
and t.delete_type = 0
and t.status = 1
and t.tenant_key = #{tenantKey}
and t.tenant_key = #{param.tenantKey}
and t1.delete_type = 0
and t1.status = 1
and t1.tenant_key = #{tenantKey}
and t1.tenant_key = #{param.tenantKey}
</select>
</mapper>

View File

@ -4,7 +4,7 @@
<select id="getOnJobNum" resultType="java.lang.Integer">
SELECT COUNT(t.id) AS value
FROM e10_common.uf_jcl_employee_information t
FROM ${e10_common}.uf_jcl_employee_information t
WHERE t.delete_type = 0
AND t.tenant_key = #{tenantKey}
<if test="departmentIdList != null and departmentIdList.size() > 0">
@ -22,7 +22,7 @@
</select>
<select id="getResignNumber" resultType="java.lang.Integer">
select count(id) as value from e10_common.uf_jcl_lzxxjl t
select count(id) as value from ${e10_common}.uf_jcl_lzxxjl t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.lzzt = 1
<if test="departmentIdList != null and departmentIdList.size() > 0">
@ -37,7 +37,7 @@
</select>
<select id="getResigningNumber" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_lzsq t
select count(t.id) from ${e10_common}.uf_jcl_lzsq t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
<!--审批中-->
and t.flow_status in (0,1,2)
@ -47,7 +47,7 @@
</select>
<select id="getEntryingNumber" resultType="java.lang.Integer">
select count(t.id) from e10_common.uf_jcl_rzsq t
select count(t.id) from ${e10_common}.uf_jcl_rzsq t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
<!--审批中-->
and t.flow_status in (0,1,2)
@ -58,7 +58,7 @@
<select id="getEntryNumber" resultType="java.lang.Integer">
select count(id) as value from e10_common.uf_jcl_rzgl t
select count(id) as value from ${e10_common}.uf_jcl_rzgl t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.rzzt = 1
<if test="departmentIdList != null and departmentIdList.size() > 0">
@ -73,20 +73,20 @@
<select id="getManageDeptIds" resultType="java.lang.Long">
select t.id
from eteams.department t
inner join eteams.ft_1154218872715993098 t2 on t.formdata = t2.id
from ${param.eteams}.department t
inner join ${param.eteams}.${param.table_dept_cus} t2 on t.formdata = t2.id
where t.type = 'department'
and t.delete_type = 0
and t.status = 1
and t.tenant_key = #{tenantKey}
and t2.tenant_key = #{tenantKey}
and t.tenant_key = #{param.tenantKey}
and t2.tenant_key = #{param.tenantKey}
and t2.delete_type = 0
and t2.bmfzr = #{empId}
</select>
<select id="getBirthdayNum" resultType="java.lang.Integer">
SELECT COUNT(t.id) AS value
FROM e10_common.uf_jcl_employee_information t
FROM ${e10_common}.uf_jcl_employee_information t
WHERE t.delete_type = 0
AND t.tenant_key = #{tenantKey}
<if test="departmentIdList != null and departmentIdList.size() > 0">
@ -111,7 +111,7 @@
</select>
<select id="getRegularEmployeeNum" resultType="java.lang.Integer">
SELECT COUNT(t.id) AS value
FROM e10_common.uf_jcl_employee_information t
FROM ${e10_common}.uf_jcl_employee_information t
WHERE t.delete_type = 0
AND t.tenant_key = #{tenantKey}
<if test="departmentIdList != null and departmentIdList.size() > 0">
@ -130,7 +130,7 @@
</select>
<select id="getEmploymentAnniversary" resultType="java.lang.Integer">
SELECT COUNT(t.id) AS value
FROM e10_common.uf_jcl_employee_information t
FROM ${e10_common}.uf_jcl_employee_information t
WHERE t.delete_type = 0
AND t.tenant_key = #{tenantKey}
<if test="departmentIdList != null and departmentIdList.size() > 0">
@ -157,7 +157,7 @@
<select id="getEducationInfo" resultType="com.weaver.seconddev.portal.entity.po.PortalPO">
select count(t.id) as value , t.education as id
from e10_common.uf_jcl_employee_information t
from ${e10_common}.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
@ -171,14 +171,14 @@
<select id="getPieTypeConfig" resultType="com.weaver.seconddev.portal.entity.po.PieChartConfig">
select t.lx as type,t.flmc as name,t.xlfl as educationIds,
t.qsw as startIndex,t.jzw as endIndex,t.zj as gradeIds,t.zssx as orderNum
from e10_common.uf_xlfb t
from ${e10_common}.uf_xlfb t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
and t.lx = #{pieType} order by t.zssx
</select>
<select id="getAgeCount" resultType="java.lang.Integer">
select count(t.id) as value from e10_common.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
select count(t.id) as value from ${param.e10_common}.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{param.tenantKey}
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
@ -190,8 +190,8 @@
</select>
<select id="getComapnyCount" resultType="java.lang.Integer">
select count(t.id) as value from e10_common.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
select count(t.id) as value from ${param.e10_common}.uf_jcl_employee_information t
where t.delete_type = 0 and t.tenant_key = #{param.tenantKey}
<if test="departmentIdList != null and departmentIdList.size() > 0">
AND t.department IN
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">