role.template 513 B

123456789
  1. #insert
  2. {{- range $index,$row := $.param}}
  3. INSERT INTO `role` (`role_name`, `status`, `system_type`, `permis_codes`, `data_permis_code`, `is_default`, `is_shown`)
  4. VALUES ('{{$row.Name}}', 1, {{$row.SystemType}}, '{{$row.PermisCodesStr}}', '{{$row.DataPermisCode}}', 1, 1);
  5. {{- end }}
  6. #update
  7. {{- range $index,$row := $.param}}
  8. update role set permis_codes='{{$row.PermisCodesStr}}',data_permis_code='{{$row.DataPermisCode}}' where role_name='{{$row.Name}}' and system_type=1 and is_default = 1;
  9. {{- end }}