SELECT
    *
FROM
    i2bill_acquirer_attendance_record
WHERE
    del_flag = 0
    {{if .user_id }}

     and user_id = '{{.user_id}}'
    {{end}}
    {{if  .date_sta }}
    and date >= "{{.date_sta}}"
    {{end}}
    {{if  .date_end }}
     and date between '0000-00-00 00:00:00' and "{{.date_end}}"
    {{end}}
LIMIT {{.rows}} OFFSET {{.offset}}
