123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470 |
- select sqlname,sqlstr,params from apisql where
- -- 申购
- sqlname ='getPartsListSG'
- -- 入库
- sqlname ='insertPartRepertory' -- (手动,调拨)
- or sqlname ='getPartListByProvider' -- 手动入库备件列表(已修复)
- or sqlname ='getWarehouseListByProvider' -- 手动入库库位列表
- or sqlname ='getTransferCodeRK' -- 调拨单列表
- -- 出库
- or sqlname ='insertPartUseRepertory' -- (手动、报废、领用)
- or sqlname ='updatePartUseRepertory' -- (调拨)
- or sqlname ='getPartsListCK' -- 手动、报废备件列表
- or sqlname ='getPartsListLY' -- 调拨、领用(维修、保养)备件列表(已修改)
- -- 退货
- or sqlname ='getPartsListTH' -- 退货备件列表 (已修改)
- or sqlname ='updatePartRepertoryTHS' -- (已修改)
- -- 退库(选出库单)
- or sqlname ='updatePartRepertoryTK' --(还需要前端 修改参数)
- -- sqlname ='insertBigPartquit'
- -- or sqlname ='insertPartquit'
- -- or sqlname ='updatePartUseQuit'
- select sqlname,sqlstr,params from apisql where sqlname ='getPartsListLY'
- select sqlname,sqlstr,params from apisql where sqlname ='getPartsListLY_m'
- select sqlname,sqlstr,params from apisql where sqlname ='insertpartapply_m'
- select sqlname,sqlstr,params from apisql where sqlname ='insertpartapply'
- select sqlname,sqlstr,params from apisql where sqlname ='getBigpartusecode'
- select sqlname,sqlstr,params from apisql where sqlname ='getpartUseListBybigTK'
- select sqlname,sqlstr,params from apisql where sqlname ='getUserPCButtons'
- select sqlname,sqlstr,params from apisql where sqlname ='updatePartUseQuit'
- select sqlname,sqlstr,params from apisql where sqlname ='updatePartRepertoryTK'
- select sqlname,sqlstr,params from apisql where sqlname ='updateBigPartTransfer'
- select sqlname,sqlstr,params from apisql where sqlname ='getbuydetailList'
- select sqlname,sqlstr,params from apisql where sqlname ='getPartListByProvider'
- select sqlname,sqlstr,params from apisql where sqlname ='insertPartUseRepertory'
- select sqlname,sqlstr,params from apisql where sqlname ='insertBigPartTransfer'
- select sqlname,sqlstr,params from apisql where sqlname ='insertContractV2'
- select sqlname,sqlstr,params from apisql where sqlname ='getbuydetailListbyBig'
- select sqlname,sqlstr,params from apisql where sqlname ='getWXworkMsg'
- select sqlname,sqlstr,params from apisql where sqlname ='getNoMesList'
- select sqlname,sqlstr,params from apisql where sqlname ='getNoMesCount'
- update apisql set sqlname='getNoMesList_bk' where sqlname ='getNoMesList';
- update apisql set sqlname='getNoMesCount_bk' where sqlname ='getNoMesCount';
- select pr.partcode ,c.partcode code2 ,p.name,pr.location,bc.contractCode,t.id tid from part_repertory pr
- join warehouse w on w.id = pr.locationId
- join pasture p on p.id =w.pastureid
- join contract c on pr.contractId = c.id
- join bigcontract bc on bc.id =c.bigid
- join (select bc.contractCode,c.partcode ,c.id from contract c join bigcontract bc on bc.id =c.bigid)t
- on pr.partcode =t.partcode and bc.contractCode =t.contractCode
- where pr.contractId = 643094
- and pr.locationid=29126
- select pr.partcode ,c.partcode code2 ,c.id,p.name,pr.location,bc.contractCode,bc.id from part_repertory pr
- join warehouse w on w.id = pr.locationId
- join pasture p on p.id =w.pastureid
- join contract c on pr.partcode = c.partcode
- join bigcontract bc on bc.id =c.bigid
- where pr.contractId = 643094
- and pr.locationid=29126
- (备件查询接口已修改,并删除库位信息返回值)
- call updatePartRepertoryTHS(?)
- call updatePartRepertoryTHS(?)
- show create procedure updatePartRepertoryTHS
- show create procedure updatePartRepertoryTHS
- update apisql set params ="quitNumber,contractId,locationId,partCode",
- sqlstr="UPDATE part_repertory SET reportery = reportery + ? WHERE contractId = ? AND locationId = ? and partCode =?"
- where sqlname ='updatePartRepertoryTK'
- update apisql set params ="quitNumber,contractId,locationId",
- sqlstr="UPDATE part_repertory SET reportery = reportery + ? WHERE contractId = ? AND locationId = ? limit 1"
- where sqlname ='updatePartRepertoryTK'
- UPDATE part_repertory SET reportery = reportery + ? WHERE contractId = ? AND locationid = ? and partcode =?
- | quitNumber,price,quitNumber,quitNumber,contractId,location |
- show create procedure createBuydetailBySG;
- select p.* from partquit p join bigpartquit bp on p.bigid =bp.id
- where bp.useform ='CK56220923012'
- describe bigpartrefund
- select count(*) from bigpartrefund where pastureid =18
- select * from warehouse
- select pr.partcode ,c.partcode code2 ,p.name,pr.location,bc.contractCode from part_repertory pr
- join warehouse w on w.id = pr.locationId
- join pasture p on p.id =w.pastureid
- join contract c on pr.contractId = c.id
- join bigcontract bc on bc.id =c.bigid
- where contractId = 643094
- and locationid=29126
- and partcode ='14.02.15.07.000258'
- SELECT sqlstr,params FROM apisql WHERE sqlname = 'syncEASPpartlaid' limit 1
- select sapstatus ,count(*) from bigparttransfer group by sapstatus
- select statue,sapstatus from bigparttransfer where statue=1 and SapStatus=0 CreatDate >'2022-09-28'
- select * from parts where 1=1 and if('14.01.01.01.000002'='',1=1,'14.01.01.01.000002'=partcode) limit 10;
- alter table bigbuydetail add index(buyerDate);
- alter table bigbuydetail add index(buyerPerson);
- alter table bigbuydetail add index(providerId);
- alter table bigbuydetail add index(pastureId);
- alter table bigbuydetail drop index buyerDate_2;
- alter table bigbuydetail drop index buyerPerson_2;
- alter table bigbuydetail drop index providerId_2;
- alter table bigbuydetail drop index pastureId_2;
- drop index(buyerDate_2) on bigbuydetail;
- drop index(buyerPerson_2) on bigbuydetail;
- drop index(providerId_2) on bigbuydetail;
- drop index(pastureId_2) on bigbuydetail;
- select buye from bigbuydetail order by buyerDate limti 100;
- select count(*) from bigbuydetail buyerDate >'2022--09-22'
- show index from bigbuydetail
- providerName,providerName,
- partName,partName,
- partCode,partCode,
- isStorage,isStorage,
- matchCode,matchCode,
- buyeCode,buyeCode,
- startTime,startTime,
- stopTime,stopTime
- (pa.name=? or ?='现代牧业') AND
- (? ='' or ?=p.providerName)
- AND ('陕西合力' =''or '陕西合力'=p.providerName)
- AND if (? ='',1=1,?=ps.name)
- AND if (? ='',1=1,?=bd.partcode)
- AND if (? ='',1=1,?=bd.isStorage)
- AND if (? ='',1=1,?=bbd.matchCode)
- AND if (? ='',1=1,?=bbd.buyeCode)
- AND if (? ='',1=1,bbd.`buyerDate` >= ?)
- AND if (? ='',1=1,bbd.`buyerDate` <= ?)
- select * from provider where providerName = '北京京东'
- alter table bigparttransfer add column group varchar(100) default ''
- alter table bigparttransfer add column groupName varchar(100) default ''
- select bd.id, bd.partcode,bbd.buyeCode from bigbuydetail bbd join buydetail bd on bd.bigid =bbd.id where bbd.buyeCode ='CG08220924024'
- 14.01.01.02.000093
- select * from partapply where note ='test0930'
- alter table contract add column taxcode varchar(100) default ''
- (
- select contractid ,count(*)c from part_repertory group by contractid
- having count(*)>1
- )t
- select * from part_repertory pr
- join (
- select partCode,locationId,contractId,providerId,price from part_repertory group by partCode,locationId,contractId,providerId,price
- having count(*)>1
- )t on
- pr.partCode= t.partCode,
- pr.locationId= t.locationId,
- pr.contractId= t.contractId,
- pr.providerId= t.providerId,
- pr.price= t.price
- limit 10
- select count(*) from (
- select partCode,locationId,contractId,providerId,price from part_repertory group by partCode,locationId,contractId,providerId,price
- having count(*)>1
- )a
- select count(*)
- select pr.id, pr.partcode ,pr.contractId ,c.id ,c.partcode,c2.id,c2.partcode
- from part_repertory pr
- left join contract c on c.id =pr.contractId
- left join contract c2 on c2.partcode = pr.partcode
- join bigcontract bc on bc.id =c2.bigid
- where pr.providerId = bc.providerId and pr.brandid =c2.brandid and pr.price =c2.price
- and c.partcode <>c2.partcode
- delete pr from part_repertory pr
- left join contract c on c.id =pr.contractId
- left join contract c2 on c2.partcode = pr.partcode
- join bigcontract bc on bc.id =c2.bigid
- set pr.contractId = c2.id
- where pr.providerId = bc.providerId and pr.brandid =c2.brandid and pr.price =c2.price
- and c.partcode <>c2.partcode
- where pr.reportery <0
- insert index part_repertory4 (
- select * part_repertory from part_repertory where reportery <0
- )
- delete from part_repertory where reportery <0
- insert into part_repertory3
- (
- select pr.*
- from part_repertory pr
- left join contract c on c.id =pr.contractId
- left join contract c2 on c2.partcode = pr.partcode
- join bigcontract bc on bc.id =c2.bigid
- where pr.providerId = bc.providerId and pr.brandid =c2.brandid and pr.price =c2.price
- and c.partcode <>c2.partcode
- )a
- select partcode ,count(*) from parts group by partCode having count(*) > 1
- select contractid ,count(*)c from part_repertory group by contractid having count(*)>1
- select pr.id
- from part_repertory pr
- left join contract c on c.id =pr.contractId
- left join contract c2 on c2.partcode = pr.partcode
- join bigcontract bc on bc.id =c2.bigid
- where pr.providerId = bc.providerId and pr.brandid =c2.brandid and pr.price =c2.price
- and c.partcode <>c2.partcode
- group by pr.id
- having count(*) >1
- CREATE TABLE `part_repertory` (
- `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
- `pastureId` int(11) NOT NULL COMMENT '牧场主键',
- `partId` int(11) DEFAULT NULL COMMENT '设备主键',
- `partName` varchar(100) DEFAULT NULL,
- `partCode` varchar(100) DEFAULT NULL,
- `specification` varchar(100) DEFAULT NULL COMMENT '规格',
- `location` varchar(100) DEFAULT NULL COMMENT '位置',
- `locationId` int(11) NOT NULL,
- `reportery` decimal(10,2) DEFAULT NULL COMMENT '库存',
- `minRepertory` decimal(11,0) NOT NULL DEFAULT 0 COMMENT '最低库存',
- `maxRepertory` decimal(11,0) NOT NULL DEFAULT 10 COMMENT '最高库存',
- `contractId` bigint(50) NOT NULL,
- `providerId` int(11) DEFAULT NULL,
- `providerNames` varchar(100) DEFAULT NULL,
- `brand` varchar(100) DEFAULT NULL COMMENT '品牌',
- `brandId` int(11) NOT NULL,
- `unit` varchar(20) DEFAULT NULL COMMENT '单位',
- `price` decimal(15,5) NOT NULL COMMENT '单价',
- `enable` tinyint(4) DEFAULT NULL,
- `precontractId` varchar(50) DEFAULT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `pastureId` (`partCode`,`precontractId`,`locationId`),
- KEY `partcode` (`partCode`,`locationId`,`contractId`,`providerId`,`price`),
- KEY `contractId_2` (`contractId`)
- ) ENGINE=InnoDB AUTO_INCREMENT=587463 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC
- alter table part_repertory add UNIQUE index (`partCode`,`locationId`,`contractId`,`providerId`,`price`)
- delete pr from part_repertory pr
- join
- (select group_concat(id,',') gid,partCode,locationId,contractId,providerId,price from part_repertory group by partCode,locationId,contractId,providerId,price having count(*)>1
- )t on
- pr.partCode= t.partCode and
- pr.locationId= t.locationId and
- pr.contractId= t.contractId and
- pr.providerId= t.providerId and
- pr.price= t.price
- select pr.* from part_repertory pr join
- (
- select pr.id ,
- rank() over (partition by pr.partCode,
- pr.locationId,
- pr.contractId,
- pr.providerId,
- pr.price order by id) as Ranking
- from part_repertory pr
- join
- (select partCode,locationId,contractId,providerId,price from part_repertory group by partCode,locationId,contractId,providerId,price having count(*)>1
- )t on
- pr.partCode= t.partCode and
- pr.locationId= t.locationId and
- pr.contractId= t.contractId and
- pr.providerId= t.providerId and
- pr.price= t.price
- )t2 on pr.id =t2.id
- where t2.Ranking >1
- select pr.*
- from part_repertory pr
- join
- (select partCode,locationId,contractId,providerId,price from part_repertory group by partCode,locationId,contractId,providerId,price having count(*)>1
- )t on
- pr.partCode= t.partCode and
- pr.locationId= t.locationId and
- pr.contractId= t.contractId and
- pr.providerId= t.providerId and
- pr.price= t.price
- delete pr from part_repertory pr join
- (
- select pr.id ,
- rank() over (partition by pr.partCode,
- pr.locationId,
- pr.contractId,
- pr.providerId,
- pr.price order by id) as Ranking
- from part_repertory pr
- join
- (select partCode,locationId,contractId,providerId,price from part_repertory group by partCode,locationId,contractId,providerId,price having count(*)>1
- )t on
- pr.partCode= t.partCode and
- pr.locationId= t.locationId and
- pr.contractId= t.contractId and
- pr.providerId= t.providerId and
- pr.price= t.price
- )t2 on pr.id =t2.id
- where t2.Ranking >1
- select partCode,locationId,contractId,providerId,price,reportery from part_repertory4 where reportery 0
- select pr.* from part_repertory pr join (
- select sum(reportery)c,partCode,locationId,contractId,providerId,price from part_repertory4
- where reportery <0
- group by partCode,locationId,contractId,providerId,price
- )t on
- pr.partCode= t.partCode and
- pr.locationId= t.locationId and
- pr.contractId= t.contractId and
- pr.providerId= t.providerId and
- pr.price= t.price
- update part_repertory pr join (
- select sum(reportery)c,partCode,locationId,contractId,providerId,price from part_repertory4
- where reportery <0
- group by partCode,locationId,contractId,providerId,price
- )t on
- pr.partCode= t.partCode and
- pr.locationId= t.locationId and
- pr.contractId= t.contractId and
- pr.providerId= t.providerId and
- pr.price= t.price
- set pr.reportery =pr.reportery+t.c
- SELECT pr.contractid,sum(pu.checkoutNumber) sumuse
- FROM part_repertory pr
- join warehouse w on w.id = pr.locationId
- left join partuse pu on pr.contractId =pu.contractId and pr.locationId = pu.locationId
- group by pr.contractId
- select pr.id ,
- rank() over (partition by pr.partCode,
- pr.locationId,
- pr.contractId,
- pr.providerId,
- pr.price order by id) as Ranking
- from part_repertory pr
- join
- (select partCode,locationId,contractId,providerId,price from part_repertory group by partCode,locationId,contractId,providerId,price having count(*)>1
- )t on
- pr.partCode= t.partCode and
- pr.locationId= t.locationId and
- pr.contractId= t.contractId and
- pr.providerId= t.providerId and
- pr.price= t.price
- select * from role where name ='系统管理员'
- select * from role_menu where role_id=44
- delete from role_menu where role_id=44
- select * from bigpartuse where id =669407
- select * from bigpartuse where id =669407
- select * from partuse where bigid =669407
- select trim( TRAILING '.' from (TRAILING '0' FROM 3.10))
- select trim( TRAILING '.' from 3.10)
- select CAST('123.12' as DECIMAL)
- UPDATE part_repertory SET reportery = reportery + '1' WHERE contractId = 497108 AND locationid = 10559 and partcode ="14.01.07.01.001030"
- select * from bigpartapply where applycode ='LY19221008015'
- select * from partapply where bigid =210605
- select * from partapply where bigid =419328
- select * from parts where partcode ='14.02.03.02.000013'
- select pr.partcode, pr.contractId,pr.reportery,pr.pastureid,p.name from part_repertory pr
- left join warehouse w on pr.locationid = w.id
- left join pasture p on w.pastureId =p.id
- where pr.id =488222
- select * from contract where id =521518
|