2024-09-06 17:37:31 +08:00
|
|
|
package com.gunshi.project.xyt.mapper;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.gunshi.project.xyt.entity.so.AssessTaskPageSo;
|
2024-09-10 15:08:27 +08:00
|
|
|
import com.gunshi.project.xyt.entity.vo.AssessResultVo;
|
2024-09-09 14:14:31 +08:00
|
|
|
import com.gunshi.project.xyt.model.AssessObject;
|
2024-09-06 17:37:31 +08:00
|
|
|
import com.gunshi.project.xyt.model.AssessTask;
|
|
|
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 描述: 考核任务
|
|
|
|
|
* author: xusan
|
|
|
|
|
* date: 2024-09-05 14:19:04
|
|
|
|
|
*/
|
|
|
|
|
@Mapper
|
|
|
|
|
public interface AssessTaskMapper extends BaseMapper<AssessTask> {
|
|
|
|
|
|
|
|
|
|
@Select("""
|
|
|
|
|
<script>
|
|
|
|
|
select t1.indicator_id from public.assess_template_indicator_rel t1
|
|
|
|
|
where t1.template_id = #{templateId}
|
|
|
|
|
</script>
|
|
|
|
|
""")
|
|
|
|
|
List<Long> queryIndicators(@Param("templateId") Long templateId);
|
|
|
|
|
|
|
|
|
|
@Select("""
|
|
|
|
|
<script>
|
2024-09-10 15:08:27 +08:00
|
|
|
select t.* from public.assess_task t where t.status != 4 and t.id in
|
2024-09-09 14:14:31 +08:00
|
|
|
(select distinct(task_id) from public.assess_team where team_user_id = #{obj.userId}
|
2024-09-11 14:03:44 +08:00
|
|
|
and status in (1,9)
|
2024-09-09 14:14:31 +08:00
|
|
|
)
|
2024-09-06 17:37:31 +08:00
|
|
|
<if test="obj.taskName != null and obj.taskName != ''">
|
|
|
|
|
and t.task_name like concat('%', #{obj.taskName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="obj.dateRangeSo != null and obj.dateRangeSo.start != null">
|
|
|
|
|
and t.start_date <![CDATA[>=]]> #{obj.dateRangeSo.start}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="obj.dateRangeSo != null and obj.dateRangeSo.end != null">
|
2024-09-10 09:27:05 +08:00
|
|
|
and t.start_date <![CDATA[<=]]> #{obj.dateRangeSo.end}
|
2024-09-06 17:37:31 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="obj.status != null">
|
|
|
|
|
and t.status = #{obj.status}
|
|
|
|
|
</if>
|
|
|
|
|
</script>
|
|
|
|
|
""")
|
2024-09-11 14:03:44 +08:00
|
|
|
Page<AssessTask> myTodo(Page<AssessTask> page,@Param("obj") AssessTaskPageSo page1);
|
|
|
|
|
|
|
|
|
|
@Select("""
|
|
|
|
|
<script>
|
|
|
|
|
select t.* from public.assess_task t where t.status != 4 and t.id in
|
|
|
|
|
<foreach collection="taskIds" item="id" separator="," open="(" close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
<if test="obj.taskName != null and obj.taskName != ''">
|
|
|
|
|
and t.task_name like concat('%', #{obj.taskName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="obj.dateRangeSo != null and obj.dateRangeSo.start != null">
|
|
|
|
|
and t.start_date <![CDATA[>=]]> #{obj.dateRangeSo.start}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="obj.dateRangeSo != null and obj.dateRangeSo.end != null">
|
|
|
|
|
and t.start_date <![CDATA[<=]]> #{obj.dateRangeSo.end}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="obj.status != null">
|
|
|
|
|
and t.status = #{obj.status}
|
|
|
|
|
</if>
|
|
|
|
|
</script>
|
|
|
|
|
""")
|
|
|
|
|
Page<AssessTask> myDone(Page<AssessTask> page,@Param("obj") AssessTaskPageSo page1,@Param("taskIds") List<Long> taskIds);
|
2024-09-09 14:14:31 +08:00
|
|
|
|
|
|
|
|
@Select("""
|
|
|
|
|
<script>
|
|
|
|
|
select t.object_user_id,t.object_user_name,s.id,s.standard_score,s.assess_score,s.assess_level,s.status from public.assess_object t
|
|
|
|
|
left join public.assess_team s on t.id = s.object_id
|
|
|
|
|
where t.task_id = #{taskId} and s.team_user_id = #{userId}
|
|
|
|
|
</script>
|
|
|
|
|
""")
|
|
|
|
|
List<AssessObject> selectObject(@Param("taskId") Long id,@Param("userId") Long userId);
|
|
|
|
|
|
2024-09-10 15:08:27 +08:00
|
|
|
@Select("""
|
|
|
|
|
<script>
|
|
|
|
|
select t.object_id,t.indicator_id,t.standard_score,t.assess_score,s.object_user_name,s.assess_score as resScore,m.indicator_name,n.name as categoryName from public.assess_object_rating t
|
|
|
|
|
left join public.assess_object s on t.object_id = s.id
|
|
|
|
|
left join public.assess_indicator m on t.indicator_id = m.id
|
|
|
|
|
left join public.assess_category n on m.category_id = n.id
|
|
|
|
|
where s.task_id = #{taskId}
|
|
|
|
|
</script>
|
|
|
|
|
""")
|
|
|
|
|
List<AssessResultVo> result(@Param("taskId") Long id);
|
2024-09-11 14:03:44 +08:00
|
|
|
|
|
|
|
|
@Select("""
|
|
|
|
|
<script>
|
|
|
|
|
select m.task_id from (
|
|
|
|
|
select task_id,count(task_id) as count1,count(status = 2 or null) as count2
|
|
|
|
|
from assess_team where team_user_id =#{userId} group by task_id ) m where m.count1 = m.count2
|
|
|
|
|
</script>
|
|
|
|
|
""")
|
|
|
|
|
List<Long> myDoneTask(@Param("userId") Long userId);
|
2024-09-06 17:37:31 +08:00
|
|
|
}
|