12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- package bi_dashboard
- import (
- "github.com/beego/beego/v2/client/orm"
- "time"
- )
- type BiDashboardDetail struct {
- BiDashboardDetailId int `orm:"column(bi_dashboard_detail_id);pk" `
- BiDashboardId int `gorm:"column:bi_dashboard_id" `
- Type int `gorm:"column:type" `
- UniqueCode string `gorm:"column:unique_code;size:32;not null" `
- Sort int `gorm:"column:sort" `
- CreateTime time.Time `gorm:"column:create_time" `
- ModifyTime time.Time `gorm:"column:modify_time" `
- }
- func (m *BiDashboardDetail) TableName() string {
- return "bi_dashboard_detail"
- }
- func GetBiDashboardDetailById(id int) (list []*BiDashboardDetail, err error) {
-
- o := orm.NewOrm()
- _, err = o.Raw("SELECT * FROM bi_dashboard_detail where bi_dashboard_id = ?", id).QueryRows(&list)
- return
- }
- func AddBiDashboardDetailMulti(items []*BiDashboardDetail) (err error) {
- o := orm.NewOrm()
- _, err = o.InsertMulti(len(items), items)
- return
- }
- func DeleteBiDashboardDetail(id int) (err error) {
- o := orm.NewOrm()
- _, err = o.Raw("DELETE from bi_dashboard_detail where bi_dashboard_id=?", id).Exec()
- return
- }
- type MoveDashboardDetailReq struct {
- BiDashboardId int `description:"看板id"`
- BiDashboardDetailId int `description:"看板详情id"`
- Sort int `description:"排序"`
- OtherDetailId int `description:"交换的详情id"`
- OtherSort int `description:"交换的排序"`
- }
- func EditBiDashboardDetail(item *BiDashboardDetail) (err error) {
-
- o := orm.NewOrm()
- _, err = o.Raw("UPDATE bi_dashboard_detail SET bi_dashboard_id=?,type=?,unique_code=?,sort=?,modify_time=? WHERE bi_dashboard_detail_id=?", item.BiDashboardId, item.Type, item.UniqueCode, item.Sort, item.ModifyTime, item.BiDashboardDetailId).Exec()
- return
- }
- type DelDashboardDetailReq struct {
- BiDashboardDetailId int `description:"看板详情id"`
- }
- func DeleteBiDashboardDetailByDetailId(id int) (err error) {
-
- o := orm.NewOrm()
- _, err = o.Raw("DELETE from bi_dashboard_detail where bi_dashboard_detail_id=?", id).Exec()
- return
- }
|