| | |
| | | try |
| | | { |
| | | //富尔达车间质量数字化看板,不良明细(取质检工序,按产线统计) |
| | | sql = @"select row_number() over(order by MM.lm_date,MM.wo_code) as RowNum,MM.lm_date,MM.wo_code,A.materiel_code,MM.step_code,T.stepname,A.good_qty as report_qty,A.ng_qty, |
| | | defect_name=( STUFF(( SELECT ',' + B.name |
| | | FROM CSR_WorkRecord_Defect N |
| | | inner join TDefect B on N.defect_code=B.code |
| | | where record_id=MM.record_id |
| | | FOR |
| | | XML PATH('') |
| | | ), 1, 1, '') ) |
| | | from CSR_WorkRecord_Defect as MM |
| | | inner join TK_Wrk_Record A on MM.record_id=a.id |
| | | inner join TK_Wrk_Step S on A.wo_code=S.wo_code and A.step_code=S.step_code |
| | | inner join TStep T on MM.step_code=T.stepcode |
| | | where MM.step_code=@StepCode and MM.style='B' and A.style='B' and A.ng_qty>0 and S.status<>'CLOSED' |
| | | group by MM.lm_date,MM.record_id,MM.wo_code,A.materiel_code,MM.step_code,T.stepname,A.good_qty,A.ng_qty"; |
| | | sql = @"select row_number() over(order by MM.lm_date,MM.wo_code) as RowNum,MM.lm_date,A.eqp_code,E.name as eqp_name,MM.wo_code,A.materiel_code,MM.step_code,T.stepname,A.good_qty as report_qty,A.ng_qty, |
| | | defect_name=( STUFF(( SELECT ',' + B.name |
| | | FROM CSR_WorkRecord_Defect N |
| | | inner join TDefect B on N.defect_code=B.code |
| | | where record_id=MM.record_id |
| | | FOR |
| | | XML PATH('') |
| | | ), 1, 1, '') ) |
| | | from CSR_WorkRecord_Defect as MM |
| | | inner join TK_Wrk_Record A on MM.record_id=a.id |
| | | inner join TK_Wrk_Step S on A.wo_code=S.wo_code and A.step_code=S.step_code |
| | | inner join TStep T on MM.step_code=T.stepcode |
| | | inner join TEqpInfo E on A.eqp_code=E.code |
| | | where MM.step_code=@StepCode and MM.style='B' and A.style='B' and A.ng_qty>0 and S.status<>'CLOSED' |
| | | group by MM.lm_date,MM.record_id,A.eqp_code,E.name,MM.wo_code,A.materiel_code,MM.step_code,T.stepname,A.good_qty,A.ng_qty"; |
| | | dynamicParams.Add("@StepCode", StepCode); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | mes.code = "200"; |