| | |
| | | |
| | | <select id="selectCheckScoreMap" resultType="com.ycl.platform.domain.entity.CheckScore"> |
| | | SELECT |
| | | id, |
| | | tcs.dept_id, |
| | | examine_category, |
| | | ROUND(AVG(score), 2) AS score, |
| | | #{startDate} AS startDate, |
| | | #{endDate} AS endDate, |
| | | ANY_VALUE(tcs.create_time) AS createTime |
| | | ROUND(AVG(score) OVER(PARTITION BY tcs.dept_id, examine_category), 2) AS score, |
| | | 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 |
| | | AND DATE_FORMAT(tcs.create_time, '%Y-%m') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m') AND DATE_FORMAT(#{endDate}, '%Y-%m') |
| | | </select> |
| | | |
| | | </mapper> |