|
|
@ -3,6 +3,7 @@ package com.project.information.mapper; |
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|
|
import com.project.information.domain.dto.KnowledgePointDTO; |
|
|
import com.project.information.domain.dto.KnowledgePointDTO; |
|
|
|
|
|
import com.project.information.domain.dto.KnowledgePointStatisticsDTO; |
|
|
import com.project.information.domain.entity.KnowledgePointEntity; |
|
|
import com.project.information.domain.entity.KnowledgePointEntity; |
|
|
import org.apache.ibatis.annotations.Mapper; |
|
|
import org.apache.ibatis.annotations.Mapper; |
|
|
import org.apache.ibatis.annotations.Select; |
|
|
import org.apache.ibatis.annotations.Select; |
|
|
@ -12,11 +13,17 @@ import java.util.List; |
|
|
|
|
|
|
|
|
@Mapper |
|
|
@Mapper |
|
|
public interface KnowledgePointMapper extends BaseMapper<KnowledgePointEntity> { |
|
|
public interface KnowledgePointMapper extends BaseMapper<KnowledgePointEntity> { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 统计知识点数量 |
|
|
|
|
|
*/ |
|
|
@Select({ |
|
|
@Select({ |
|
|
"SELECT e.*" + |
|
|
"SELECT", |
|
|
"FROM evaluator_information e" + |
|
|
" SUM(CASE WHEN p.background_color = 0 THEN 1 ELSE 0 END) AS preciseSum,", |
|
|
"INNER JOIN evaluator_knowledge_point p ON p.information_id = e.id" + |
|
|
" SUM(CASE WHEN p.background_color = 1 THEN 1 ELSE 0 END) AS blurSum", |
|
|
"WHERE e.sub_line_id = #{subLineId};" |
|
|
"FROM evaluator_knowledge_point e", |
|
|
|
|
|
"INNER JOIN evaluator_knowledge_point p ON p.information_id = e.id", |
|
|
|
|
|
"WHERE e.sub_line_id = #{subLineId}" |
|
|
}) |
|
|
}) |
|
|
List<KnowledgePointDTO> selectBySubLineId(@Param("subLineId") Long subLineId); |
|
|
KnowledgePointStatisticsDTO selectBySubLineId(@Param("subLineId") Long subLineId); |
|
|
} |
|
|
} |
|
|
|