12345678910111213141516171819202122232425262728293031323334353637 |
- package ht
- import "eta/eta_mini_ht_api/models"
- type HTReport struct {
- Id int `gorm:"primary_key;auto_increment"`
- PlateId int `grom:"plate_id"`
- PlateName string `gorm:"column:plate_name"`
- PermissionName string `gorm:"column:permission_name"`
- PublishUserName string `gorm:"column:publish_user_name"`
- ReportName string `gorm:"column:report_name"`
- PublishTime int `gorm:"column:publish_time"`
- PublishedTime string `gorm:"column:published_time"`
- }
- func GetHTReports(id int) (reports []HTReport, err error) {
- db := models.HT()
- sql := "select tirtp.plate_id as plate_id, tip.plate_name as plate_name, t.id as id ,t.report_name as report_name,t.publish_user_name as publish_user_name,t.publish_time as publish_time from t_iirp_report_to_plate tirtp left join t_iirp_report_info t on t.id=tirtp.report_id left JOIN t_iirp_plate tip on tip.id=tirtp.plate_id where t.is_delete =0 and t.`status` =3 and t.report_file_path<>'' and t.id > ? order by t.id asc"
- err = db.Model(&HTReport{}).Raw(sql, id).Scan(&reports).Error
- return
- }
- func GetPDFUrl(id int) (url string, err error) {
- db := models.HT()
- sql := "select report_file_path from t_iirp_report_info where id=?"
- err = db.Model(&HTReport{}).Raw(sql, id).Scan(&url).Error
- return
- }
- type HtQuery struct {
- Plate string
- Permission string
- }
- func GetHTReportIdsByPermissionIds(query []HtQuery) (ids []int, err error) {
- return
- }
|