<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="org.springblade.modules.performance.mapper.PerformanceMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="performanceResultMap" type="org.springblade.modules.performance.entity.Performance">
|
<id column="id" property="id"/>
|
<result column="securityId" property="securityid"/>
|
<result column="workingAttitude" property="workingattitude"/>
|
<result column="workingAbility" property="workingability"/>
|
<result column="Achievements" property="achievements"/>
|
<result column="score" property="score"/>
|
<result column="time" property="time"/>
|
<result column="departmentid" property="departmentid"/>
|
<result column="jurisdiction" property="jurisdiction"/>
|
<result column="departmentName" property="departmentName"/>
|
<result column="cardid" property="cardid"/>
|
</resultMap>
|
|
|
<select id="selectPerformancePage" resultMap="performanceResultMap">
|
select * from sys_performance where securityId = #{performance.securityid}
|
</select>
|
|
<!--查询本年所有月份的表现差的数量-->
|
<select id="queryYearPer" resultType="java.util.HashMap">
|
SELECT COUNT
|
( CASE WHEN MONTH ( s.time ) = 1 THEN s.score END ) AS '1',
|
COUNT ( CASE WHEN MONTH ( s.time ) = 2 THEN s.score END ) AS '2',
|
COUNT ( CASE WHEN MONTH ( s.time ) = 3 THEN s.score END ) AS '3',
|
COUNT ( CASE WHEN MONTH ( s.time ) = 4 THEN s.score END ) AS '4',
|
COUNT ( CASE WHEN MONTH ( s.time ) = 5 THEN s.score END ) AS '5',
|
COUNT ( CASE WHEN MONTH ( s.time ) = 6 THEN s.score END ) AS '6',
|
COUNT ( CASE WHEN MONTH ( s.time ) = 7 THEN s.score END ) AS '7',
|
COUNT ( CASE WHEN MONTH ( s.time ) = 8 THEN s.score END ) AS '8',
|
COUNT ( CASE WHEN MONTH ( s.time ) = 9 THEN s.score END ) AS '9',
|
COUNT ( CASE WHEN MONTH ( s.time ) = 10 THEN s.score END ) AS '10',
|
COUNT ( CASE WHEN MONTH ( s.time ) = 11 THEN s.score END ) AS '11',
|
COUNT (CASE WHEN MONTH ( s.time ) = 12 THEN s.score END ) AS '12'
|
FROM
|
sys_performance AS s
|
WHERE
|
YEAR ( s.time ) = #{year} AND score=3
|
</select>
|
</mapper>
|