gunshi-project-ss/src/main/java/com/gunshi/project/xyt/mapper/AssessTaskMapper.java

66 lines
2.6 KiB
Java
Raw Normal View History

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;
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>
select t.* from public.assess_task t where t.id in
(select distinct(task_id) from public.assess_team where team_user_id = #{obj.userId}
<if test="type == 1">
and status in (1,9)
</if>
<if test="type == 2">
and status = 2
</if>
)
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>
""")
Page<AssessTask> myTodo(Page<AssessTask> page,@Param("obj") AssessTaskPageSo page1,@Param("type") Integer type);
@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-06 17:37:31 +08:00
}