2025-01-16 16:02:08 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
|
|
|
<mapper namespace="com.bonus.gs.sub.evaluate.evaluate.dao.EvalSummaryDao">
|
|
|
|
|
|
|
|
|
|
<insert id="addEvalSummary">
|
|
|
|
|
insert into pj_offline(type, file_path, evaluate_title, year_and_month, upload_time, update_time)
|
|
|
|
|
values (#{evaluateDept}, #{pathName}, #{evaluateTitle}, #{evaluateMonth}, now(),now())
|
|
|
|
|
</insert>
|
|
|
|
|
<select id="getEvalSummaryList" resultType="com.bonus.gs.sub.evaluate.evaluate.beans.OutSourceBean">
|
|
|
|
|
select
|
|
|
|
|
per.evaluate_id as id,
|
|
|
|
|
ped.details_id as detailsId,
|
|
|
|
|
per.template_id as templateId,
|
|
|
|
|
poi.name as evaluateDept,
|
|
|
|
|
per.evaluate_name as evaluateTitle,
|
|
|
|
|
per.year_and_month as evaluateMonth,
|
|
|
|
|
per.create_time as createTime,
|
|
|
|
|
r.proNum as projectNum,
|
|
|
|
|
r.subNum as outsourcerNum,
|
|
|
|
|
ifnull(GROUP_CONCAT(ped.post_id),'') as deptId,
|
|
|
|
|
check_one as isApprove,
|
|
|
|
|
IF(rr.num > 0,1,if(rr.num = 0 and rr.failNum = 0,0,2)) as isAudit,
|
|
|
|
|
if(m.num = m.total,1,if(m.num > 0,2,0)) as status,
|
|
|
|
|
rr.rejectReason as rejectReason
|
|
|
|
|
from pj_evaluate_record per
|
|
|
|
|
left join (
|
|
|
|
|
select
|
|
|
|
|
evaluate_id,
|
|
|
|
|
count(distinct sub_id) as subNum,
|
|
|
|
|
count(distinct pro_id) as proNum
|
|
|
|
|
from pj_evaluate_sub pes where pes.is_active = 1
|
|
|
|
|
group by evaluate_id
|
|
|
|
|
)r on per.evaluate_id = r.evaluate_id
|
|
|
|
|
left join pj_template_config pt on pt.config_id = per.template_id and pt.is_active = 1
|
|
|
|
|
left join pm_org_info poi on per.dept_id = poi.id and poi.status = 1
|
|
|
|
|
left join pj_evaluate_details ped on ped.evaluate_id = per.evaluate_id
|
|
|
|
|
left join (
|
|
|
|
|
select
|
|
|
|
|
count(if(check_two > 0,1,null)) as num,
|
|
|
|
|
count(1) as total,
|
|
|
|
|
evaluate_id
|
|
|
|
|
from pj_evaluate_details
|
|
|
|
|
group by evaluate_id
|
|
|
|
|
) m on m.evaluate_id = per.evaluate_id
|
|
|
|
|
left join(
|
|
|
|
|
SELECT
|
|
|
|
|
count(IF(check_two is null or check_two = 0 or check_two = '',1,null)) as num,
|
|
|
|
|
GROUP_CONCAT(DISTINCT IF(reject_two is null or reject_two = '',null,reject_two)) as rejectReason,
|
|
|
|
|
count(if(check_two = 2,1,null)) as failNum,
|
|
|
|
|
evaluate_id
|
|
|
|
|
from pj_evaluate_result
|
|
|
|
|
GROUP BY evaluate_id
|
|
|
|
|
)rr on rr.evaluate_id = per.evaluate_id
|
|
|
|
|
where per.is_active = 1
|
|
|
|
|
<if test="evaluateDeptId != null and evaluateDeptId != ''">
|
|
|
|
|
and per.dept_id = #{evaluateDeptId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
|
|
and per.year_and_month = #{startDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="keyWord != null and keyWord != ''">
|
|
|
|
|
and per.evaluate_name like concat('%', #{keyWord}, '%' )
|
|
|
|
|
</if>
|
2025-01-21 14:50:36 +08:00
|
|
|
group by per.evaluate_id
|
2025-01-16 16:02:08 +08:00
|
|
|
<if test="status != null and status != ''">
|
|
|
|
|
having status = #{status}
|
|
|
|
|
</if>
|
|
|
|
|
order by MAX(per.create_time) desc
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|