i2bill_acquirer_student_total_check_select.tpl 463 B

123456789101112131415161718192021
  1. SELECT
  2. count(*) total
  3. {{if .group_by }}
  4. ,check_state
  5. {{end}}
  6. FROM
  7. i2bill_acquirer_student
  8. WHERE
  9. del_flag = 0
  10. {{if .user_id}}
  11. and user_id = '{{.user_id}}'
  12. {{end}}
  13. {{if .create_time_sta }}
  14. and create_time >= "{{.create_time_sta}}"
  15. {{end}}
  16. {{if .create_time_end }}
  17. and create_time between '0000-00-00 00:00:00' and "{{.create_time_end}}"
  18. {{end}}
  19. {{if .group_by }}
  20. GROUP BY {{.group_by}}
  21. {{end}}