        select
            employee_code,
            employee_name,
            company_code,
            company_name,
            dept_code,
            dept_name,

            date_format(attendance_date, '%Y-%m') AS attendance_month,

            '21' AS attendance_days,
            sum(case when in_clock_time1 != 1 then 1 end) AS normal_days,
            sum(case when in_clock_time1 != 1 then 1 end) AS absence_days,
            sum(case when in_clock_time1 != 1 then 1 end) AS abnorrmal_days,
            sum(case when in_clock_time1 != 1 then 1 end) AS late_days,
            sum(case when out_clock_time1 != 1 then 1 end) AS leave_early_days,
            sum(case when in_clock_time1 != 1 then 1 end) AS abnorrmal_punch_frequency,
            sum(case when in_clock_time1 != 1 then 1 end) AS not_punch_frequency
        from
            yundu_attendance_record, 
        group by
            employee_code,
            employee_name,
            company_code,
            company_name,
            dept_code,
            dept_name,

            date_format(attendance_date, '%Y-%m')