|
@@ -30,15 +30,15 @@ type RewardSummaryDay struct { |
|
@@ -30,15 +30,15 @@ type RewardSummaryDay struct { |
30
|
YieldResult string `json:"yieldResult"` //产效功过结果
|
30
|
YieldResult string `json:"yieldResult"` //产效功过结果
|
31
|
UpToStandardResult string `json:"upToStandardResult"` //合格率功过结果
|
31
|
UpToStandardResult string `json:"upToStandardResult"` //合格率功过结果
|
32
|
AccidentResult1 string `json:"accidentResult1"` //质量事故功过结果
|
32
|
AccidentResult1 string `json:"accidentResult1"` //质量事故功过结果
|
33
|
- AccidentResul2 string `json:"accidentResul2"` //安全事故功过结果
|
|
|
34
|
- AccidentResul3 string `json:"accidentResul3"` //异物 功过结果
|
33
|
+ AccidentResult2 string `json:"accidentResul2"` //安全事故功过结果
|
|
|
34
|
+ AccidentResult3 string `json:"accidentResul3"` //异物 功过结果
|
35
|
}
|
35
|
}
|
36
|
|
36
|
|
37
|
// 功过看板-日榜
|
37
|
// 功过看板-日榜
|
38
|
func (d *RewardSumaryDao) SeachRewardSummaryDay(companyId int, orgId int, recordDate string) ([]RewardSummaryDay, error) {
|
38
|
func (d *RewardSumaryDao) SeachRewardSummaryDay(companyId int, orgId int, recordDate string) ([]RewardSummaryDay, error) {
|
39
|
sqlStr := `SELECT
|
39
|
sqlStr := `SELECT
|
40
|
"id",record_date_str,
|
40
|
"id",record_date_str,
|
41
|
- work_station->>'sectionName',
|
41
|
+ work_station->>'sectionName' as section_name,
|
42
|
worker->>'userName' as worker_name,
|
42
|
worker->>'userName' as worker_name,
|
43
|
summary_result,
|
43
|
summary_result,
|
44
|
yield_result,
|
44
|
yield_result,
|
|
@@ -46,7 +46,7 @@ func (d *RewardSumaryDao) SeachRewardSummaryDay(companyId int, orgId int, record |
|
@@ -46,7 +46,7 @@ func (d *RewardSumaryDao) SeachRewardSummaryDay(companyId int, orgId int, record |
46
|
accident_result1,
|
46
|
accident_result1,
|
47
|
accident_result2,
|
47
|
accident_result2,
|
48
|
accident_result3
|
48
|
accident_result3
|
49
|
- FROM "reward_summary"
|
49
|
+ FROM manufacture."reward_summary"
|
50
|
WHERE company_id=?
|
50
|
WHERE company_id=?
|
51
|
and org_id=?
|
51
|
and org_id=?
|
52
|
and record_date_str=?`
|
52
|
and record_date_str=?`
|
|
@@ -70,12 +70,12 @@ type RewardSummaryYield struct { |
|
@@ -70,12 +70,12 @@ type RewardSummaryYield struct { |
70
|
func (d *RewardSumaryDao) SeachRewardSummaryYield(companyId int, orgId int, recordDate string) ([]RewardSummaryYield, error) {
|
70
|
func (d *RewardSumaryDao) SeachRewardSummaryYield(companyId int, orgId int, recordDate string) ([]RewardSummaryYield, error) {
|
71
|
sqlStr := `SELECT
|
71
|
sqlStr := `SELECT
|
72
|
record_date_str,
|
72
|
record_date_str,
|
73
|
- work_station->>'sectionName',
|
73
|
+ work_station->>'sectionName' as section_name,
|
74
|
worker->>'userName' as worker_name,
|
74
|
worker->>'userName' as worker_name,
|
75
|
yield_result,
|
75
|
yield_result,
|
76
|
yield,
|
76
|
yield,
|
77
|
- "24" as yield_max
|
|
|
78
|
- FROM "reward_summary"
|
77
|
+ '24' as yield_max
|
|
|
78
|
+ FROM manufacture."reward_summary"
|
79
|
WHERE company_id=?
|
79
|
WHERE company_id=?
|
80
|
and org_id=?
|
80
|
and org_id=?
|
81
|
and record_date_str=?`
|
81
|
and record_date_str=?`
|
|
@@ -99,13 +99,13 @@ type RewardSummaryUpToStandard struct { |
|
@@ -99,13 +99,13 @@ type RewardSummaryUpToStandard struct { |
99
|
// 功过看板-合格率
|
99
|
// 功过看板-合格率
|
100
|
func (d *RewardSumaryDao) SeachRewardUpToStandard(companyId int, orgId int, recordDate string) ([]RewardSummaryUpToStandard, error) {
|
100
|
func (d *RewardSumaryDao) SeachRewardUpToStandard(companyId int, orgId int, recordDate string) ([]RewardSummaryUpToStandard, error) {
|
101
|
sqlStr := `SELECT
|
101
|
sqlStr := `SELECT
|
102
|
- "id",record_date_str,
|
|
|
103
|
- work_station->>'sectionName',
|
102
|
+ record_date_str,
|
|
|
103
|
+ work_station->>'sectionName' as section_name,
|
104
|
worker->>'userName' as worker_name,
|
104
|
worker->>'userName' as worker_name,
|
105
|
up_to_standard_result,
|
105
|
up_to_standard_result,
|
106
|
up_to_standard,
|
106
|
up_to_standard,
|
107
|
'90' as up_to_standard_max
|
107
|
'90' as up_to_standard_max
|
108
|
- FROM "reward_summary"
|
108
|
+ FROM manufacture."reward_summary"
|
109
|
WHERE company_id=23
|
109
|
WHERE company_id=23
|
110
|
and org_id=487
|
110
|
and org_id=487
|
111
|
and record_date_str='2022-10-29'`
|
111
|
and record_date_str='2022-10-29'`
|
|
@@ -124,20 +124,20 @@ type RewardAccident struct { |
|
@@ -124,20 +124,20 @@ type RewardAccident struct { |
124
|
YieldResult string `json:"yieldResult"` //产效功过结果
|
124
|
YieldResult string `json:"yieldResult"` //产效功过结果
|
125
|
UpToStandardResult string `json:"upToStandardResult"` //合格率功过结果
|
125
|
UpToStandardResult string `json:"upToStandardResult"` //合格率功过结果
|
126
|
AccidentResult1 string `json:"accidentResult1"` //质量事故功过结果
|
126
|
AccidentResult1 string `json:"accidentResult1"` //质量事故功过结果
|
127
|
- AccidentResul2 string `json:"accidentResul2"` //安全事故功过结果
|
|
|
128
|
- AccidentResul3 string `json:"accidentResul3"` //异物 功过结果
|
127
|
+ AccidentResult2 string `json:"accidentResul2"` //安全事故功过结果
|
|
|
128
|
+ AccidentResult3 string `json:"accidentResul3"` //异物 功过结果
|
129
|
}
|
129
|
}
|
130
|
|
130
|
|
131
|
// 功过看板-异常
|
131
|
// 功过看板-异常
|
132
|
func (d *RewardSumaryDao) SeachRewardAccident(companyId int, orgId int, recordDate string) ([]RewardAccident, error) {
|
132
|
func (d *RewardSumaryDao) SeachRewardAccident(companyId int, orgId int, recordDate string) ([]RewardAccident, error) {
|
133
|
sqlStr := `SELECT
|
133
|
sqlStr := `SELECT
|
134
|
"id",record_date_str,
|
134
|
"id",record_date_str,
|
135
|
- work_station->>'sectionName',
|
135
|
+ work_station->>'sectionName' as section_name,
|
136
|
worker->>'userName' as worker_name,
|
136
|
worker->>'userName' as worker_name,
|
137
|
up_to_standard_result,
|
137
|
up_to_standard_result,
|
138
|
up_to_standard,
|
138
|
up_to_standard,
|
139
|
'90' as up_to_standard_max
|
139
|
'90' as up_to_standard_max
|
140
|
- FROM "reward_summary"
|
140
|
+ FROM manufacture."reward_summary"
|
141
|
WHERE company_id=?
|
141
|
WHERE company_id=?
|
142
|
and org_id=?
|
142
|
and org_id=?
|
143
|
and record_date_str=?`
|
143
|
and record_date_str=?`
|