Compare commits
2 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
01c82605f0 | |
|
|
8c5a5863bd |
|
|
@ -1,2 +0,0 @@
|
|||
-- 考评组配置增加考评是否结束开关
|
||||
ALTER TABLE evaluation_corp ADD COLUMN evaluation_closed TINYINT DEFAULT 0 COMMENT '考评是否结束 0=未结束 1=已结束';
|
||||
|
|
@ -55,19 +55,6 @@ public class EvaluationConfigController {
|
|||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("考评结束开关")
|
||||
@PostMapping("/toggleEvalClosed")
|
||||
public SingleResponse toggleEvalClosed(@RequestBody ToggleEvalClosedCmd cmd) {
|
||||
evaluationConfigService.toggleEvalClosed(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("查询考评结束状态")
|
||||
@GetMapping("/getEvalClosedStatus")
|
||||
public SingleResponse<Integer> getEvalClosedStatus() {
|
||||
return SingleResponse.of(evaluationConfigService.getEvalClosedStatus());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import com.alibaba.cola.exception.BizException;
|
|||
import com.zcloud.hidden.evaluation.domain.gateway.EvaluationCorpGateway;
|
||||
import com.zcloud.hidden.evaluation.domain.model.EvaluationCorpE;
|
||||
import com.zcloud.hidden.evaluation.dto.EvaluationCorpUpdateCmd;
|
||||
import com.zcloud.hidden.evaluation.dto.ToggleEvalClosedCmd;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -31,19 +30,5 @@ public class EvaluationCorpUpdateExe {
|
|||
throw new BizException("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void toggleEvalClosed(ToggleEvalClosedCmd cmd) {
|
||||
EvaluationCorpE evaluationCorpE = new EvaluationCorpE();
|
||||
BeanUtils.copyProperties(cmd, evaluationCorpE);
|
||||
boolean res = evaluationCorpGateway.toggleEvalClosed(evaluationCorpE);
|
||||
if (!res) {
|
||||
throw new BizException("配置失败");
|
||||
}
|
||||
}
|
||||
|
||||
public Integer getEvalClosedStatus() {
|
||||
return evaluationCorpGateway.getEvalClosedStatus();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import com.zcloud.hidden.evaluation.api.EvaluationConfigServiceI;
|
|||
import com.zcloud.hidden.evaluation.command.EvaluationConfigAddExe;
|
||||
import com.zcloud.hidden.evaluation.command.EvaluationConfigRemoveExe;
|
||||
import com.zcloud.hidden.evaluation.command.EvaluationConfigUpdateExe;
|
||||
import com.zcloud.hidden.evaluation.command.EvaluationCorpUpdateExe;
|
||||
import com.zcloud.hidden.evaluation.command.query.EvaluationConfigQueryExe;
|
||||
import com.zcloud.hidden.evaluation.dto.*;
|
||||
import com.zcloud.hidden.evaluation.dto.clientobject.CorpEvaluationConfigCO;
|
||||
|
|
@ -30,7 +29,6 @@ public class EvaluationConfigServiceImpl implements EvaluationConfigServiceI {
|
|||
private final EvaluationConfigUpdateExe evaluationConfigUpdateExe;
|
||||
private final EvaluationConfigRemoveExe evaluationConfigRemoveExe;
|
||||
private final EvaluationConfigQueryExe evaluationConfigQueryExe;
|
||||
private final EvaluationCorpUpdateExe evaluationCorpUpdateExe;
|
||||
|
||||
@Override
|
||||
public PageResponse<CorpEvaluationConfigCO> listPage(EvaluationConfigPageQry qry) {
|
||||
|
|
@ -69,15 +67,5 @@ public class EvaluationConfigServiceImpl implements EvaluationConfigServiceI {
|
|||
public void editBath(EvaluationConfigBathUpdateCmd evaluationConfigBathUpdateCmd) {
|
||||
evaluationConfigUpdateExe.editBath(evaluationConfigBathUpdateCmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toggleEvalClosed(ToggleEvalClosedCmd cmd) {
|
||||
evaluationCorpUpdateExe.toggleEvalClosed(cmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getEvalClosedStatus() {
|
||||
return evaluationCorpUpdateExe.getEvalClosedStatus();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,9 +29,5 @@ public interface EvaluationConfigServiceI {
|
|||
List<EvaluationConfigCO> listAll(EvaluationConfigQry qry);
|
||||
|
||||
void editBath(EvaluationConfigBathUpdateCmd evaluationConfigBathUpdateCmd);
|
||||
|
||||
void toggleEvalClosed(ToggleEvalClosedCmd cmd);
|
||||
|
||||
Integer getEvalClosedStatus();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
package com.zcloud.hidden.evaluation.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 考评结束开关命令
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2026-06-09
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ToggleEvalClosedCmd implements Serializable {
|
||||
@ApiModelProperty(value = "企业id", required = true)
|
||||
private Long corpinfoId;
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束(开始考评) 1=已结束(结束考评)", required = true)
|
||||
private Integer evaluationClosed;
|
||||
}
|
||||
|
|
@ -35,9 +35,6 @@ public class CorpEvalCO implements Serializable {
|
|||
private Integer exchangeScoreCount;
|
||||
@ApiModelProperty(value = "待兑换积分数")
|
||||
private Integer unExchangeScoreCount;
|
||||
//考评是否结束 0=未结束 1=已结束
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束 1=已结束")
|
||||
private Integer evaluationClosed;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -34,8 +34,5 @@ public class CorpEvalStatisticsCO implements Serializable {
|
|||
private String safeEvaluationMember;
|
||||
@ApiModelProperty(value = "环保类考评组成员")
|
||||
private String envEvaluationMember;
|
||||
//考评是否结束 0=未结束 1=已结束
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束 1=已结束")
|
||||
private Integer evaluationClosed;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,9 +31,6 @@ public class CorpEvaluationConfigCO implements Serializable {
|
|||
private String envEvaluationConfigStatus;
|
||||
@ApiModelProperty(value = "环保类考评组成员")
|
||||
private String envEvaluationMember;
|
||||
//考评是否结束 0=未结束 1=已结束
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束 1=已结束")
|
||||
private Integer evaluationClosed;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,8 +67,5 @@ public class CorpHiddenStatisticsCO implements Serializable {
|
|||
|
||||
@ApiModelProperty(value = "考评组成员")
|
||||
private String evaluationMembers;
|
||||
//考评是否结束 0=未结束 1=已结束
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束 1=已结束")
|
||||
private Integer evaluationClosed;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,8 +29,6 @@ public class UserEvalStatisticsCO implements Serializable {
|
|||
private String departmentName;
|
||||
@ApiModelProperty(value = "岗位")
|
||||
private String postName;
|
||||
@ApiModelProperty(value = "考评类型,1:安全类,2:环保类")
|
||||
private String evaluationType;
|
||||
@ApiModelProperty(value = "奖励总得分")
|
||||
private Integer totalScore;
|
||||
@ApiModelProperty(value = "已兑换分数")
|
||||
|
|
|
|||
|
|
@ -20,16 +20,6 @@ public interface EvaluationCorpGateway {
|
|||
*/
|
||||
Boolean update(EvaluationCorpE evaluationCorpE);
|
||||
|
||||
/**
|
||||
* 开关配置
|
||||
*/
|
||||
Boolean toggleEvalClosed(EvaluationCorpE evaluationCorpE);
|
||||
|
||||
/**
|
||||
* 查询考评结束状态
|
||||
*/
|
||||
Integer getEvalClosedStatus();
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -43,7 +43,5 @@ public class EvaluationCorpE extends BaseE {
|
|||
private Long orgId;
|
||||
//环境
|
||||
private String env;
|
||||
//考评是否结束 0=未结束(开始考评) 1=已结束(结束考评)
|
||||
private Integer evaluationClosed;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import org.springframework.beans.BeanUtils;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
|
|
@ -43,25 +42,6 @@ public class EvaluationCorpGatewayImpl implements EvaluationCorpGateway {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean toggleEvalClosed(EvaluationCorpE evaluationCorpE) {
|
||||
evaluationCorpRepository.list().forEach(corp -> {
|
||||
corp.setEvaluationClosed(evaluationCorpE.getEvaluationClosed());
|
||||
evaluationCorpRepository.updateById(corp);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getEvalClosedStatus() {
|
||||
List<EvaluationCorpDO> list = evaluationCorpRepository.list();
|
||||
if (list.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
Integer closed = list.get(0).getEvaluationClosed();
|
||||
return closed != null ? closed : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deletedEvaluationCorpById(Long id) {
|
||||
return evaluationCorpRepository.removeById(id);
|
||||
|
|
|
|||
|
|
@ -33,9 +33,6 @@ public class CorpEvalDO implements Serializable {
|
|||
private Integer exchangeScoreCount;
|
||||
@ApiModelProperty(value = "待兑换积分数")
|
||||
private Integer unExchangeScoreCount;
|
||||
//考评是否结束 0=未结束 1=已结束
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束 1=已结束")
|
||||
private Integer evaluationClosed;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -32,8 +32,5 @@ public class CorpEvalStatisticsDO implements Serializable {
|
|||
private String safeEvaluationMember;
|
||||
@ApiModelProperty(value = "环保类考评组成员")
|
||||
private String envEvaluationMember;
|
||||
//考评是否结束 0=未结束 1=已结束
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束 1=已结束")
|
||||
private Integer evaluationClosed;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,9 +29,6 @@ public class CorpEvaluationConfigDO implements Serializable {
|
|||
private String envEvaluationConfigStatus;
|
||||
@ApiModelProperty(value = "环保类考评组成员")
|
||||
private String envEvaluationMember;
|
||||
//考评是否结束 0=未结束 1=已结束
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束 1=已结束")
|
||||
private Integer evaluationClosed;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,8 +64,5 @@ public class CorpHiddenStatisticsDO implements Serializable {
|
|||
|
||||
@ApiModelProperty(value = "考评组成员")
|
||||
private String evaluationMembers;
|
||||
//考评是否结束 0=未结束 1=已结束
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束 1=已结束")
|
||||
private Integer evaluationClosed;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,9 +24,6 @@ public class EvaluationCorpDO extends BaseDO {
|
|||
//企业id
|
||||
@ApiModelProperty(value = "企业id")
|
||||
private Long corpinfoId;
|
||||
//考评是否结束 0=未结束 1=已结束
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束 1=已结束")
|
||||
private Integer evaluationClosed;
|
||||
|
||||
public EvaluationCorpDO(String evaluationCorpId) {
|
||||
this.evaluationCorpId = evaluationCorpId;
|
||||
|
|
|
|||
|
|
@ -29,8 +29,6 @@ public class UserEvalStatisticsDO implements Serializable {
|
|||
private String departmentName;
|
||||
@ApiModelProperty(value = "岗位")
|
||||
private String postName;
|
||||
@ApiModelProperty(value = "考评类型,1:安全类,2:环保类")
|
||||
private String evaluationType;
|
||||
@ApiModelProperty(value = "奖励总得分")
|
||||
private Integer totalScore;
|
||||
@ApiModelProperty(value = "已兑换分数")
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import java.util.Map;
|
|||
@DataScopes({
|
||||
@DataScope(method = "corpHidddenPage", menuPerms = ""),
|
||||
@DataScope(method = "corpEvalStatisticsPage", menuPerms = ""),
|
||||
@DataScope(method = "userEvalStatisticsPage", menuPerms = ""),
|
||||
@DataScope(method = "corpEvalPage", menuPerms = ""),
|
||||
})
|
||||
public interface HiddenEvaluationRecordMapper extends BaseMapper<HiddenEvaluationRecordDO> {
|
||||
|
|
@ -31,8 +32,6 @@ public interface HiddenEvaluationRecordMapper extends BaseMapper<HiddenEvaluatio
|
|||
|
||||
IPage<UserEvalStatisticsDO> userEvalStatisticsPage(IPage<UserEvalStatisticsDO> iPage, Map<String, Object> params, String menuPerms);
|
||||
|
||||
Long userEvalStatisticsPageCount(Map<String, Object> params, String menuPerms);
|
||||
|
||||
IPage<HiddenEvalDO> hiddenEvalPage(IPage<HiddenEvalDO> iPage, Map<String, Object> params);
|
||||
|
||||
IPage<CorpEvalDO> corpEvalPage(IPage<CorpEvalDO> iPage, Map<String, Object> params, String menuPerms);
|
||||
|
|
|
|||
|
|
@ -80,14 +80,11 @@ public class HiddenEvaluationRecordRepositoryImpl extends BaseRepositoryImpl<Hid
|
|||
@Override
|
||||
public PageResponse<UserEvalStatisticsDO> userEvalStatisticsPage(Map<String, Object> params) {
|
||||
IPage<UserEvalStatisticsDO> iPage = new Query<UserEvalStatisticsDO>().getPage(params);
|
||||
((com.baomidou.mybatisplus.extension.plugins.pagination.Page<?>) iPage).setSearchCount(false);
|
||||
String menuPerms = "";
|
||||
if (!org.springframework.util.ObjectUtils.isEmpty(params.get("menuPath"))){
|
||||
menuPerms = MenuEnum.getMenuKeyByPath(params.get("menuPath").toString());
|
||||
}
|
||||
IPage<UserEvalStatisticsDO> result = hiddenEvaluationRecordMapper.userEvalStatisticsPage(iPage, params,menuPerms);
|
||||
Long total = hiddenEvaluationRecordMapper.userEvalStatisticsPageCount(params, menuPerms);
|
||||
result.setTotal(total != null ? total : 0);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@
|
|||
CASE WHEN ec_safe.id IS NOT NULL THEN '已分配' ELSE '未分配' END AS safeEvaluationConfigStatus,
|
||||
COALESCE(ec_safe.members, '') AS safeEvaluationMember,
|
||||
CASE WHEN ec_env.id IS NOT NULL THEN '已分配' ELSE '未分配' END AS envEvaluationConfigStatus,
|
||||
COALESCE(ec_env.members, '') AS envEvaluationMember,
|
||||
COALESCE((SELECT e.evaluation_closed FROM evaluation_corp e WHERE e.delete_enum = 'FALSE' LIMIT 1), 0) AS evaluationClosed
|
||||
COALESCE(ec_env.members, '') AS envEvaluationMember
|
||||
FROM evaluation_corp ec left join corp_info ci on ec.corpinfo_id = ci.id
|
||||
LEFT JOIN (SELECT ec.id,ec.corpinfo_id,
|
||||
GROUP_CONCAT(CONCAT(d.name, '-', u.name) SEPARATOR ',') AS members
|
||||
|
|
|
|||
|
|
@ -4,39 +4,6 @@
|
|||
|
||||
<mapper namespace="com.zcloud.hidden.evaluation.persistence.mapper.HiddenEvaluationRecordMapper">
|
||||
|
||||
<sql id="baseUserQuery">
|
||||
SELECT DISTINCT
|
||||
u_inner.id AS userId,
|
||||
u_inner.username AS userName,
|
||||
u_inner.name,
|
||||
u_inner.department_id AS departmentId,
|
||||
u_inner.corpinfo_id AS corpinfoId,
|
||||
d_inner.name AS departmentName,
|
||||
p_inner.post_name AS postName
|
||||
FROM hidden h_inner
|
||||
INNER JOIN user u_inner ON h_inner.creator_id = u_inner.id
|
||||
LEFT JOIN department d_inner ON u_inner.department_id = d_inner.id
|
||||
LEFT JOIN post p_inner ON u_inner.post_id = p_inner.id
|
||||
WHERE h_inner.delete_enum = 'FALSE'
|
||||
AND h_inner.state = 301
|
||||
AND ((h_inner.source IN (4,5) AND h_inner.final_check = 1) OR h_inner.source NOT IN (4,5))
|
||||
<if test="params.corpinfoId != null">
|
||||
AND u_inner.corpinfo_id = #{params.corpinfoId}
|
||||
</if>
|
||||
<if test="params.departmentId != null">
|
||||
AND d_inner.id = #{params.departmentId}
|
||||
</if>
|
||||
<if test="params.userName != null and params.userName != ''">
|
||||
AND u_inner.name LIKE CONCAT('%', #{params.userName}, '%')
|
||||
</if>
|
||||
<if test="params.userIdList != null and params.userIdList.size() > 0">
|
||||
AND u_inner.id IN
|
||||
<foreach collection="params.userIdList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="corpHidddenPage" resultType="com.zcloud.hidden.evaluation.persistence.dataobject.CorpHiddenStatisticsDO" >
|
||||
SELECT ec.corpinfo_id as corpinfoId,
|
||||
ci.corp_name AS corpinfoName,
|
||||
|
|
@ -61,8 +28,7 @@
|
|||
COUNT(DISTINCT CASE WHEN h.source = 6 THEN h.hidden_id END) as fireCheckTotalCount,
|
||||
COUNT(DISTINCT CASE WHEN h.source = 7 AND her.evaluation_result != 1 THEN h.hidden_id END) as videoPatrolEvalCount,
|
||||
COUNT(DISTINCT CASE WHEN h.source = 7 THEN h.hidden_id END) as videoPatrolTotalCount,
|
||||
IFNULL(ec_all.evaluationMembers, '') AS evaluationMembers,
|
||||
COALESCE((SELECT e.evaluation_closed FROM evaluation_corp e WHERE e.delete_enum = 'FALSE' LIMIT 1), 0) AS evaluationClosed
|
||||
IFNULL(ec_all.evaluationMembers, '') AS evaluationMembers
|
||||
FROM evaluation_config ec
|
||||
left join evaluation_corp ecorp ON ecorp.corpinfo_id = ec.corpinfo_id AND ecorp.delete_enum = 'FALSE'
|
||||
LEFT JOIN corp_info ci ON ci.id = ec.corpinfo_id AND ci.delete_enum = 'FALSE'
|
||||
|
|
@ -302,8 +268,7 @@
|
|||
LEFT JOIN user usr ON ec.user_id = usr.id
|
||||
WHERE ec.corpinfo_id = ci.id
|
||||
AND ec.delete_enum = 'FALSE'
|
||||
AND ec.evaluation_type = 2) AS envEvaluationMember,
|
||||
COALESCE((SELECT e.evaluation_closed FROM evaluation_corp e WHERE e.delete_enum = 'FALSE' LIMIT 1), 0) AS evaluationClosed
|
||||
AND ec.evaluation_type = 2) AS envEvaluationMember
|
||||
FROM corp_info ci
|
||||
LEFT JOIN user hu ON hu.corpinfo_id = ci.id
|
||||
LEFT JOIN hidden h ON hu.id = h.creator_id AND h.delete_enum = 'FALSE' AND h.state = 301 AND
|
||||
|
|
@ -335,36 +300,27 @@
|
|||
|
||||
<select id="userEvalStatisticsPage" resultType="com.zcloud.hidden.evaluation.persistence.dataobject.UserEvalStatisticsDO">
|
||||
SELECT
|
||||
ci.corp_name AS corpinfoName,
|
||||
u.id AS userId,
|
||||
ci.corp_name as corpinfoName,
|
||||
h.creator_id as userId,
|
||||
u.username AS userName,
|
||||
u.name,
|
||||
u.department_id AS departmentId,
|
||||
u.name AS name,
|
||||
u.department_id as departmentId,
|
||||
d.name AS departmentName,
|
||||
p.post_name AS postName,
|
||||
1 AS evaluationType,
|
||||
COUNT(DISTINCT CASE WHEN her.evaluation_result =2 THEN h.id END) AS totalScore,
|
||||
COUNT(DISTINCT CASE WHEN her.exchange_flag = 1 THEN h.id END) AS exchangedScore,
|
||||
COUNT(DISTINCT CASE WHEN her.exchange_flag = 0 AND her.evaluation_result = 2 THEN h.id END) AS notExchangedScore
|
||||
FROM user u
|
||||
COUNT(DISTINCT CASE WHEN her.exchange_flag = 0 and her.evaluation_result=2 THEN h.id END) AS notExchangedScore
|
||||
FROM hidden h left join evaluation_corp ecorp on ecorp.corpinfo_id = h.corp_id
|
||||
inner JOIN user u ON h.creator_id = u.id
|
||||
LEFT JOIN department d ON u.department_id = d.id
|
||||
LEFT JOIN post p ON u.post_id = p.id
|
||||
LEFT JOIN corp_info ci ON u.corpinfo_id = ci.id AND ci.delete_enum = 'FALSE'
|
||||
LEFT JOIN hidden h ON h.creator_id = u.id
|
||||
AND h.delete_enum = 'FALSE'
|
||||
left join post p ON u.post_id = p.id
|
||||
left join corp_info ci ON h.corp_id = ci.id AND ci.delete_enum = 'FALSE'
|
||||
LEFT JOIN hidden_evaluation_record her ON h.hidden_id = her.hidden_id AND her.delete_enum = 'FALSE'
|
||||
WHERE h.delete_enum = 'FALSE'
|
||||
AND h.state = 301
|
||||
AND ((h.source IN (4,5) AND h.final_check = 1) OR h.source NOT IN (4,5))
|
||||
AND h.hidden_type IN ('aqyh','rdbaqys','wzcz','wzzh','grfhyp','wdbaqzt','jxsb','hcl','dqsb','gsj','aqbhzz','ss','xf','tzsb','hjdbaqys','zmjdgyxbj','aqbzbs','gkkd','zykjxzzl','eltq','gldqx','wzdhzdlsbdw','wfacs','jypx','aqyh-qt')
|
||||
LEFT JOIN hidden_evaluation_record her ON h.hidden_id = her.hidden_id
|
||||
AND her.evaluation_type = 1
|
||||
AND her.delete_enum = 'FALSE'
|
||||
WHERE u.delete_enum = 'FALSE'
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM hidden h_exist
|
||||
WHERE h_exist.creator_id = u.id
|
||||
AND h_exist.delete_enum = 'FALSE'
|
||||
AND h_exist.state = 301
|
||||
AND ((h_exist.source IN (4,5) AND h_exist.final_check = 1) OR h_exist.source NOT IN (4,5))
|
||||
AND (
|
||||
(h.source IN (4,5) AND h.final_check = 1)
|
||||
OR h.source NOT IN (4,5)
|
||||
)
|
||||
<if test="params.corpinfoId != null">
|
||||
AND u.corpinfo_id= #{params.corpinfoId}
|
||||
|
|
@ -375,124 +331,15 @@
|
|||
<if test="params.userName != null and params.userName != ''">
|
||||
AND u.name LIKE CONCAT('%', #{params.userName}, '%')
|
||||
</if>
|
||||
|
||||
<if test="params.userIdList != null and params.userIdList.size() > 0">
|
||||
AND u.id IN
|
||||
and h.creator_id in
|
||||
<foreach collection="params.userIdList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY u.id, u.username, u.name, u.department_id, d.name, p.post_name, ci.corp_name
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT
|
||||
ci.corp_name AS corpinfoName,
|
||||
u.id AS userId,
|
||||
u.username AS userName,
|
||||
u.name,
|
||||
u.department_id AS departmentId,
|
||||
d.name AS departmentName,
|
||||
p.post_name AS postName,
|
||||
2 AS evaluationType,
|
||||
COUNT(DISTINCT CASE WHEN her.evaluation_result = 2 THEN h.id END) AS totalScore,
|
||||
COUNT(DISTINCT CASE WHEN her.exchange_flag = 1 THEN h.id END) AS exchangedScore,
|
||||
COUNT(DISTINCT CASE WHEN her.exchange_flag = 0 AND her.evaluation_result = 2 THEN h.id END) AS notExchangedScore
|
||||
FROM user u
|
||||
LEFT JOIN department d ON u.department_id = d.id
|
||||
LEFT JOIN post p ON u.post_id = p.id
|
||||
LEFT JOIN corp_info ci ON u.corpinfo_id = ci.id AND ci.delete_enum = 'FALSE'
|
||||
LEFT JOIN hidden h ON h.creator_id = u.id
|
||||
AND h.delete_enum = 'FALSE'
|
||||
AND h.state = 301
|
||||
AND ((h.source IN (4,5) AND h.final_check = 1) OR h.source NOT IN (4,5))
|
||||
AND h.hidden_type IN ('wshb','hjwr','ws','dq','zs','gf','hjwsjlh','yqfk','wshb-qt')
|
||||
LEFT JOIN hidden_evaluation_record her ON h.hidden_id = her.hidden_id
|
||||
AND her.evaluation_type = 2
|
||||
AND her.delete_enum = 'FALSE'
|
||||
WHERE u.delete_enum = 'FALSE'
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM hidden h_exist
|
||||
WHERE h_exist.creator_id = u.id
|
||||
AND h_exist.delete_enum = 'FALSE'
|
||||
AND h_exist.state = 301
|
||||
AND ((h_exist.source IN (4,5) AND h_exist.final_check = 1) OR h_exist.source NOT IN (4,5))
|
||||
)
|
||||
<if test="params.corpinfoId != null">
|
||||
AND u.corpinfo_id = #{params.corpinfoId}
|
||||
</if>
|
||||
<if test="params.departmentId != null ">
|
||||
AND d.id = #{params.departmentId}
|
||||
</if>
|
||||
<if test="params.userName != null and params.userName != ''">
|
||||
AND u.name LIKE CONCAT('%', #{params.userName}, '%')
|
||||
</if>
|
||||
<if test="params.userIdList != null and params.userIdList.size() > 0">
|
||||
AND u.id IN
|
||||
<foreach collection="params.userIdList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY u.id, u.username, u.name, u.department_id, d.name, p.post_name, ci.corp_name
|
||||
|
||||
ORDER BY userId ASC
|
||||
</select>
|
||||
|
||||
<select id="userEvalStatisticsPageCount" resultType="java.lang.Long">
|
||||
SELECT COUNT(*) FROM (
|
||||
SELECT u.id
|
||||
FROM user u
|
||||
LEFT JOIN hidden h ON h.creator_id = u.id
|
||||
AND h.delete_enum = 'FALSE'
|
||||
AND h.state = 301
|
||||
AND ((h.source IN (4,5) AND h.final_check = 1) OR h.source NOT IN (4,5))
|
||||
AND h.hidden_type IN ('aqyh','rdbaqys','wzcz','wzzh','grfhyp','wdbaqzt','jxsb','hcl','dqsb','gsj','aqbhzz','ss','xf','tzsb','hjdbaqys','zmjdgyxbj','aqbzbs','gkkd','zykjxzzl','eltq','gldqx','wzdhzdlsbdw','wfacs','jypx','aqyh-qt')
|
||||
WHERE u.delete_enum = 'FALSE'
|
||||
AND h.id IS NOT NULL
|
||||
<if test="params.corpinfoId != null">
|
||||
AND u.corpinfo_id = #{params.corpinfoId}
|
||||
</if>
|
||||
<if test="params.departmentId != null ">
|
||||
AND u.department_id = #{params.departmentId}
|
||||
</if>
|
||||
<if test="params.userName != null and params.userName != ''">
|
||||
AND u.name LIKE CONCAT('%', #{params.userName}, '%')
|
||||
</if>
|
||||
<if test="params.userIdList != null and params.userIdList.size() > 0">
|
||||
AND u.id IN
|
||||
<foreach collection="params.userIdList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY u.id
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT u.id
|
||||
FROM user u
|
||||
LEFT JOIN hidden h ON h.creator_id = u.id
|
||||
AND h.delete_enum = 'FALSE'
|
||||
AND h.state = 301
|
||||
AND ((h.source IN (4,5) AND h.final_check = 1) OR h.source NOT IN (4,5))
|
||||
AND h.hidden_type IN ('wshb','hjwr','ws','dq','zs','gf','hjwsjlh','yqfk','wshb-qt')
|
||||
WHERE u.delete_enum = 'FALSE'
|
||||
AND h.id IS NOT NULL
|
||||
<if test="params.corpinfoId != null">
|
||||
AND u.corpinfo_id = #{params.corpinfoId}
|
||||
</if>
|
||||
<if test="params.departmentId != null ">
|
||||
AND u.department_id = #{params.departmentId}
|
||||
</if>
|
||||
<if test="params.userName != null and params.userName != ''">
|
||||
AND u.name LIKE CONCAT('%', #{params.userName}, '%')
|
||||
</if>
|
||||
<if test="params.userIdList != null and params.userIdList.size() > 0">
|
||||
AND u.id IN
|
||||
<foreach collection="params.userIdList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY u.id
|
||||
) total_count
|
||||
GROUP BY h.creator_id
|
||||
ORDER BY u.sort ,u.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="hiddenEvalPage" resultType="com.zcloud.hidden.evaluation.persistence.dataobject.HiddenEvalDO">
|
||||
|
|
@ -591,8 +438,7 @@
|
|||
THEN h.id END) AS exchangeScoreCount,
|
||||
COUNT(DISTINCT CASE
|
||||
WHEN her.evaluation_result = 2 AND her.exchange_flag = 0 AND u.corpinfo_id = ecorp.corpinfo_id
|
||||
THEN h.id END) AS unExchangeScoreCount,
|
||||
COALESCE((SELECT e.evaluation_closed FROM evaluation_corp e WHERE e.delete_enum = 'FALSE' LIMIT 1), 0) AS evaluationClosed
|
||||
THEN h.id END) AS unExchangeScoreCount
|
||||
FROM evaluation_corp ecorp
|
||||
LEFT JOIN evaluation_config ec on ecorp.corpinfo_id = ec.corpinfo_id AND ecorp.delete_enum = 'FALSE'
|
||||
LEFT JOIN corp_info ci
|
||||
|
|
|
|||
Loading…
Reference in New Issue