SELECT
    count(*) total
{{if .group_by }}
        ,check_state
{{end}}
FROM
    i2bill_acquirer_student
WHERE
    del_flag = 0
    {{if .user_id}}
        and user_id = '{{.user_id}}'
    {{end}}
    {{if  .create_time_sta }}
        and create_time >= "{{.create_time_sta}}"
    {{end}}
    {{if .create_time_end }}
        and create_time between '0000-00-00 00:00:00' and "{{.create_time_end}}"
    {{end}}
{{if .group_by }}
GROUP BY   {{.group_by}}
{{end}}
