IdentitylinkHistory.go 816 B

1234567891011121314151617181920212223
  1. package dao
  2. import (
  3. "gorm.io/gorm"
  4. "server/global"
  5. )
  6. // IdentitylinkHistory IdentitylinkHistory
  7. type IdentitylinkHistory struct {
  8. Identitylink
  9. }
  10. // CopyIdentitylinkToHistoryByProcInstID CopyIdentitylinkToHistoryByProcInstID
  11. func CopyIdentitylinkToHistoryByProcInstID(procInstID int, tx *gorm.DB) error {
  12. return tx.Exec("insert into identitylink_history select * from identitylink where proc_inst_id=?", procInstID).Error
  13. }
  14. // FindParticipantHistoryByProcInstID FindParticipantHistoryByProcInstID
  15. func FindParticipantHistoryByProcInstID(procInstID int) ([]*IdentitylinkHistory, error) {
  16. var datas []*IdentitylinkHistory
  17. err := global.GVA_DB.Select("id,user_id,step,comment").Where("proc_inst_id=? and type=?", procInstID, IdentityTypes[PARTICIPANT]).Order("id asc").Find(&datas).Error
  18. return datas, err
  19. }