|
|
|
@ -62,20 +62,20 @@
|
|
|
|
|
SELECT |
|
|
|
|
si.*, |
|
|
|
|
sc.NAME AS classifyName, |
|
|
|
|
t.加分, |
|
|
|
|
t.扣分 |
|
|
|
|
t.bonusPoin, |
|
|
|
|
t.deductionPoints |
|
|
|
|
FROM |
|
|
|
|
sup_indicators AS si |
|
|
|
|
LEFT JOIN sup_classify AS sc ON si.classify_id = sc.id |
|
|
|
|
LEFT JOIN (SELECT |
|
|
|
|
sum( CASE WHEN point < 0 THEN point ELSE 0 END ) AS 扣分, |
|
|
|
|
sum( CASE WHEN point > 0 THEN point ELSE 0 END ) AS 加分, |
|
|
|
|
sum( CASE WHEN point < 0 THEN point ELSE 0 END ) AS deductionPoints, |
|
|
|
|
sum( CASE WHEN point > 0 THEN point ELSE 0 END ) AS bonusPoin, |
|
|
|
|
id AS id, |
|
|
|
|
assess_dept AS assess_dept |
|
|
|
|
FROM |
|
|
|
|
sup_indicators WHERE |
|
|
|
|
assess_dept = #{deptId} AND DATE_FORMAT( create_time,'%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )) AS t ON t.id = si.id |
|
|
|
|
WHERE si.assess_dept = #{deptId} |
|
|
|
|
assess_dept = #{params.deptId} AND DATE_FORMAT( create_time,'%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )) AS t ON t.id = si.id |
|
|
|
|
WHERE si.assess_dept = #{params.deptId} |
|
|
|
|
<if test="params.startTime != null and params.startTime != ''" > |
|
|
|
|
AND date_format(si.create_time,'%y%m%d%') >= date_format(#{params.startTime},'%y%m%d%') |
|
|
|
|
</if> |
|
|
|
|