feat:完善项目
This commit is contained in:
@ -18,6 +18,7 @@ type WorkRepairInfo struct {
|
||||
EquipmentTitle string `json:"equipment_title"`
|
||||
Priority int `json:"priority"`
|
||||
BreakdownTitle string `json:"breakdown_title"`
|
||||
Username string `json:"username"`
|
||||
}
|
||||
|
||||
type WorkRepairEvaluateInfo struct {
|
||||
@ -29,9 +30,11 @@ func (m *WorkRepair) Repairs(page, pageSize int, count *int64, where ...*model.M
|
||||
db := orm.GetDB().Table(m.TableName()+" r").
|
||||
Select("r.id", "r.order_no", "e.code AS equipment_code", "e.title AS equipment_title", "w.priority",
|
||||
"(SELECT GROUP_CONCAT(s_b.title) FROM (SELECT id, title FROM sys_breakdown) AS s_b WHERE FIND_IN_SET(s_b.id, w.breakdown)) AS breakdown_title",
|
||||
"r.created_at").
|
||||
"r.is_evaluate", "r.evaluate_score", "r.status", "u.name AS username", "r.created_at").
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS w ON r.work_id = w.id", model.NewWorkInstance().TableName())).
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS e ON w.equipment_id = e.id", model.NewManageEquipment().TableName()))
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS e ON w.equipment_id = e.id", model.NewManageEquipment().TableName())).
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS u ON w.uid = u.uuid", model.NewSysUser().TableName())).
|
||||
Where("r.is_deleted = ?", model.DeleteStatusForNot)
|
||||
|
||||
if len(where) > 0 {
|
||||
for _, wo := range where {
|
||||
|
Reference in New Issue
Block a user