fuliqi
2024-07-31 71e6dc7824780c223e594add97c09773335e8af1
ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml
@@ -35,7 +35,6 @@
            <if test="deptId != null "> and tcs.dept_id = #{deptId}</if>
            ${params.dataScope}
        </where>
        order by create_time desc
    </select>
    
    <select id="selectCheckScoreById" parameterType="Long" resultMap="CheckScoreResult">
@@ -115,4 +114,24 @@
        (#{score.score},#{score.deptId},#{score.templateId},#{score.examineTag},#{score.examineCategory},#{score.createTime})
    </foreach>
    </insert>
    <select id="selectCheckScoreMap" resultType="com.ycl.platform.domain.entity.CheckScore">
        SELECT
            tcs.dept_id,
            examine_category,
            ROUND(AVG(score), 2) AS score,
            #{startDate} AS startDate,
            #{endDate} AS endDate,
            ANY_VALUE(tcs.create_time) AS createTime
        FROM
            t_check_score tcs
                LEFT JOIN sys_dept d ON tcs.dept_id = d.dept_id
        WHERE
            examine_tag = #{examineTag}
          AND tcs.create_time BETWEEN #{startDate} AND #{endDate}
        GROUP BY
            tcs.dept_id,
            examine_category
    </select>
</mapper>