<?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">

    <!-- 字段和属性映射 -->
    <resultMap type="com.mortals.xhx.module.perform.model.vo.AppealInfo" id="AppealInfo-Map">
        <result property="staffName" column="staffName" />
        <result property="deptName" column="deptName" />
        <result property="ruleName" column="ruleName" />
        <result property="number" column="number" />
        </resultMap>

    <!-- 获取统计列表 -->
    <select id="getStatList" parameterType="paramDto" resultMap="AppealInfo-Map">
        select
        <!-- 获取分组字段 -->
        <if test="groupList != null and !groupList.isEmpty()">
            <foreach collection="groupList" open="" close="" index="index" item="item">
                ${item},
            </foreach>
        </if>
        count(IFNULL(a.id,0)) number
        from mortals_xhx_perform_attend_appeal as a
        <trim suffixOverrides="where" suffix="">
            where
            <trim prefixOverrides="and" prefix="">
                <include refid="_condition_"/>
            </trim>
        </trim>
        <include refid="_group_by_"/>
        <include refid="_orderCols_"/>
    </select>
</mapper>