123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- update pasture p join temDict d on d.factory_name =p.name
- set
- p.company_code=d.company_code,
- p.company_name=d.company_name,
- p.factory_name=d.factory_name,
- p.factory_code=d.factory_code
- update warehouse w join pasture p on p.factory_code =w.factory_code
- set w.pastureId=p.id
- where p.factory_code <>""
- select warehosecode,count(*) from warehouse
- group by warehosecode
- having count(*)>1
- update provider set enable =0
- alter table PartUse modify contractId integer default 0
- delete from partuse where id =41772
- select id ,r from (select id ,row_number() over(order by id asc)r from partuse )t where r=17160
- select id from partuse where contractId ='' or contractId is null
- update partuse set contractId2 =contractId
- update partlaid set contractId2 =contractId
- delete from Equipment where modifyTime is not null
- update parts set enable =1 ,statue =1
- update department d join pasture p on p.id = d.pastureId
- set d.pasturename =p.name
- update department d join temDict_costcenter t on d.pasturename =t.factory_name
- and d.name =t.CostCenter_name
- set d.CostCenter_code = t.CostCenter_code
- update pasture set factory_code ='M005', parchase_organization ='1012' where name ='察北牧场';
- select name from pasture where name like '察北%'
- update pasture set factory_code ='M005' ,company_code ='1005',parchase_organization='1005'
- where name ='察北牧场';
- update pasture set factory_code 'M005' where name ='察北牧场';
- upadte warehourse w join pasture p on p.name = w.factory_name
- set w.pastureId =p.id
- where w.pastureId =0 or w.pastureId is null
- update warehouse set pastureId =115 ,pasture_name ='察北牧场' ,factory_code='M005',
- warehoseCode =replace(warehoseCode,char(9),'')
- where factory_name ='察北牧场'
- update Equipment set pastureId =115 ,companycode='1005' where companycode ='1006' limit 100
- update department d join dept_Data dd on dd.center_name =d.name
- set d.CostCenter_code =dd.CostCenter_code
- update pasture set factory_code ='M001',company_code ='9099' where name ='马鞍山牧场'
- update pasture set factory_code ='M008',company_code ='1008' where name ='宝鸡牧场'
- update parts set old_partcode =partcode
- update parts set partcode=new_partcode
- select * from part_class where partcode ='14.01.01'
- select * from part_class where pid = 167
- insert into
- part_repertory pr
- left join warehouse w on w.id =pr.locationId
- left join contract c on c.id=pr.contractId
- left join bigcontract bc on bc.id =c.bigId
- left join pasture p on (p.id=pr.pastureId or p.id=w.pastureId )
- set reportery =2
- where p.name ='塞一牧场'
- and bc.contractCode like 'BJ0220080579%'
- and pr.partCode ='14.02.15.06.000046'
- update apisql set
- sqlstr=
- "select (@sort := @sort+1) sort,empname employeeName,DATE_FORMAT(u.createdtime,'%Y-%m-%d') resumeTime,'创建合同' typeName,'提交审核' statusName
- from (SELECT @sort:=0)a,`user` u "
- where sqlname ='getContractResume'
- select * from pasture where name ='临沂牧场'
- select * from provider where providerName='无供应商旧件';
- select brand from part_repertory pr where pr.location ='A-01-01' and
- (pr.pastureId =629 or (pr.pastureId =18 and (select pastureId from warehouse where id = pr.`locationId`)= 629) )
- 395
- select partcode ,count(*) from part_repertory pr where pr.location ='A-01-01' and
- (pr.pastureId =618 or (pr.pastureId =18 and (select pastureId from warehouse where id = pr.`locationId`)= 618) )
- group by partcode
- having count(*)>1
- part_re_temp
- update part_repertory pr
- join part_re_temp t on pr.partcode =t.code and pr.brand = t.brand
- set pr.reportery =t.num
- where pr.location ='A-01-01' and
- (pr.pastureId =618 or (pr.pastureId =18 and (select pastureId from warehouse where id = pr.`locationId`)= 618) )
- and t.code not in
- (
- '14.01.01.02.000832',
- '14.01.04.01.001202',
- '14.01.07.01.002407'
- )
- 330
- 338
- 344
- select pr.* from part_repertory pr where pr.location ='A-01-01' and
- (pr.pastureId =629 or (pr.pastureId =18 and (select pastureId from warehouse where id = pr.`locationId`)= 629) )
- and partcode in
- (
- '14.01.01.02.000832',
- '14.01.04.01.001202',
- '14.01.07.01.002407'
- )
- select * from part_re_temp where code in
- (
- '14.01.01.02.000832',
- '14.01.04.01.001202',
- '14.01.07.01.002407'
- )
- select pr.partcode,pr.brand,t.num from part_repertory pr
- join part_re_temp t on pr.partcode =t.code and pr.brand = t.brand
- where pr.location ='A-01-01' and
- (pr.pastureId =629 or (pr.pastureId =18 and (select pastureId from warehouse where id = pr.`locationId`)= 629) )
- and pr.partcode in
- (
- '14.01.01.02.000832',
- '14.01.04.01.001202',
- '14.01.07.01.002407'
- )
- update
- part_repertory pr
- join save_temp s on pr.partcode =s.code and pr.price =s.price and pr.brand =s.brand
- join provider pv on pv.id =pr.providerId and pv.providerName =s.providername
- set pr.reportery = s.num
- where pr.pastureid =618 or (select pastureId from warehouse w where w.id =pr.locationid) =618
- update
- part_repertory pr
- join save_temp s on pr.partcode =s.code and pr.price =s.price and pr.brand =s.brand
- join provider pv on pv.id =pr.providerId and pv.providerName =s.providername
- set pr.reportery = pr.reportery -12
- where pr.pastureid =618 or (select pastureId from warehouse w where w.id =pr.locationid) =618
- select count(*) from
- part_repertory pr
- join save_temp s on pr.partcode =s.code and pr.price =s.price and pr.brand =s.brand
- join provider pv on pv.id =pr.providerId and pv.providerName =s.providername
- where pr.pastureid =621 or (select pastureId from warehouse w where w.id =pr.locationid) =621
- select * from part_repertory where partcode ='14.01.04.05.000485'
- select * from pasture where name ='云南牧场'
- 217
- alter table partapply add column created_at datetime
|