<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.perform.dao.ibatis.PerformAttendAppealDaoImpl">

    <!-- 申述分布情况统计 -->
    <select id="getAppealSummaryList" parameterType="com.mortals.xhx.module.perform.model.vo.AppealSummaryQuery" resultType="com.mortals.xhx.module.perform.model.PerformAttendAppealEntity">
        SELECT
            performType,
            SUM(score) AS score
        FROM
            mortals_xhx_perform_attend_appeal
        WHERE
            processStatus = 2
        AND appealResult = 1
        <if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
        <if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
        GROUP BY
            performType
    </select>
</mapper>