| | |
| | | var sql = @"select A.id, A.status,A.wotype,A.printcount,A.wo_code,A.materiel_code as partcode,B.partname,B.partspec,A.plan_qty,A.wkshp_code,C.org_name as wkshp_name, |
| | | A.route_code,E.name as route_name,A.stck_code,F.name as stck_name,A.plan_startdate,A.plan_enddate,A.piroque,A.sourceid,A.m_po,W.saleOrderCode,U.username as lm_user,A.lm_date |
| | | from TK_Wrk_Man A |
| | | left join TKimp_Ewo W on A.m_po=W.wo and A.materiel_code=W.materiel_code |
| | | left join TKimp_Ewo W on A.m_po=W.wo and A.materiel_code=W.materiel_code and A.sourceid=W.id |
| | | left join TMateriel_Info B on A.materiel_code=B.partcode |
| | | left join TOrganization C on A.wkshp_code=C.org_code |
| | | left join T_Sec_Stck D on A.stck_code=D.code |
| | |
| | | var sql = @"select A.id, A.status,A.wotype,A.wo_code,A.materiel_code as partcode,B.partname,B.partspec,A.plan_qty,A.wkshp_code,C.org_name as wkshp_name, |
| | | A.route_code,E.name as route_name,A.stck_code,F.name as stck_name,A.plan_startdate,A.plan_enddate,A.piroque,A.sourceid,A.m_po,W.saleOrderCode,U.username as lm_user,A.lm_date,S.bad_qty |
| | | from TK_Wrk_Man A |
| | | left join TKimp_Ewo W on A.m_po=W.wo and A.materiel_code=W.materiel_code |
| | | left join TKimp_Ewo W on A.m_po=W.wo and A.materiel_code=W.materiel_code and A.sourceid=W.id |
| | | left join (select wo_code,sum(bad_qty) as bad_qty from TK_Wrk_Step where bad_qty>0 group by wo_code) S on A.wo_code=S.wo_code |
| | | left join TMateriel_Info B on A.materiel_code=B.partcode |
| | | left join TOrganization C on A.wkshp_code=C.org_code |
| | |
| | | B.m_po,W.saleOrderCode |
| | | from TK_Wrk_Step A |
| | | left join TK_Wrk_Man B on A.wo_code=B.wo_code |
| | | left join TKimp_Ewo W on B.m_po=W.wo and B.materiel_code=W.materiel_code |
| | | left join TKimp_Ewo W on B.m_po=W.wo and B.materiel_code=W.materiel_code and B.sourceid=W.id |
| | | left join TMateriel_Info M on B.materiel_code=M.partcode |
| | | left join TStep S on A.step_code=S.stepcode |
| | | left join TOrganization F on B.wkshp_code=F.org_code |
| | |
| | | B.m_po,W.saleOrderCode |
| | | from TK_Wrk_Step A |
| | | left join TK_Wrk_Man B on A.wo_code=B.wo_code |
| | | left join TKimp_Ewo W on B.m_po=W.wo and B.materiel_code=W.materiel_code |
| | | left join TKimp_Ewo W on B.m_po=W.wo and B.materiel_code=W.materiel_code and B.sourceid=W.id |
| | | left join TMateriel_Info M on B.materiel_code=M.partcode |
| | | left join TStep S on A.step_code=S.stepcode |
| | | left join TOrganization F on B.wkshp_code=F.org_code |
| | |
| | | B.m_po,W.saleOrderCode |
| | | from TK_Wrk_Step A |
| | | left join TK_Wrk_Man B on A.wo_code=B.wo_code |
| | | left join TKimp_Ewo W on B.m_po=W.wo and B.materiel_code=W.materiel_code |
| | | left join TKimp_Ewo W on B.m_po=W.wo and B.materiel_code=W.materiel_code and B.sourceid=W.id |
| | | left join TMateriel_Info M on B.materiel_code=M.partcode |
| | | left join TStep S on A.step_code=S.stepcode |
| | | left join TOrganization F on B.wkshp_code=F.org_code |
| | |
| | | from TK_Wrk_Step A |
| | | left join TStep T on A.step_code=T.stepcode |
| | | left join TK_Wrk_Man M on A.wo_code=M.wo_code |
| | | left join TKimp_Ewo W on M.m_po=W.wo and M.materiel_code=W.materiel_code |
| | | left join TKimp_Ewo W on M.m_po=W.wo and M.materiel_code=W.materiel_code and M.sourceid=W.id |
| | | left join TMateriel_Info P on M.materiel_code=P.partcode |
| | | where A.wo_code=@ordercode and A.step_code=@stepcode"; |
| | | dynamicParams.Add("@ordercode", ordercode); |
| | |
| | | ,(select sum(S.ng_qty) from TK_Wrk_Step S where S.wo_code=A.wo_code and S.isend='Y') as ng_qty |
| | | ,(select sum(S.bad_qty) from TK_Wrk_Step S where S.wo_code=A.wo_code and S.isend='Y') as bad_qty |
| | | from TK_Wrk_Man A |
| | | left join TKimp_Ewo W on A.m_po=W.wo and A.materiel_code=W.materiel_code |
| | | left join TKimp_Ewo W on A.m_po=W.wo and A.materiel_code=W.materiel_code and A.sourceid=W.id |
| | | left join TMateriel_Info B on A.materiel_code=B.partcode |
| | | left join TOrganization C on A.wkshp_code=C.org_code |
| | | left join T_Sec_Stck D on A.stck_code=D.code |