2020年12月2日SQL汇总

#根据站点编号查询站点
SELECT * FROM `bs_vending` where siteId='225-0000052'
#查询终端成功请求xx接口的交易记录
select * from sys_trade_log where platCode='03' and tradeCode='1220' and retCode='0000';
select * from sys_trade_log where platCode='03' and tradeCode='1201' and retCode='0000';
#根据站点编号查询入库单信息
select * from bs_inbound where siteId='225-0000052';
#根据站点编号查询设备类型
#1.先根据站点编号查询机型编码
select deviceId from bs_vending where siteId ='225-0000052'
#2.再根据机型编码查询设备类型
select cabinetType from bs_vending_model where deviceId='xx'
#更新入库详情信息表,为卷宗数量字段赋值10
update bs_inbound_info t  set t.archivePageNum = 10
#根据订单编号查询订单信息
select * from bs_borrow_order where order_id='10000158498654916'
#根据站点编号查询寄存主单信息
select * from bs_order where siteId='225-0000056'
#更新寄存主单表,机型是结案柜的数据为archivePageNum字段赋值
update bs_order set archivePageNum=500 where siteName like '%结案%';
#模糊查询
select * from bs_order where siteName like'%结案%'
######################################2020-12-2 14:57:32#######################################################
#根据站点编号、柜子编号、箱子编号查询某个箱子信息
select  logid, slaneId, siteId, siteName, cabinetId, factoryId, deviceId, seqId, boxId,
                boxCode, boxType, bCol, bRow, boxState, curState, stateTime, oderId, createTime,
                corpId,userId,drawerNum,boxCy  from bs_vending_lane
                        where siteId='225-0000056' and cabinetId='1' and slaneId='225-0002844'
                        
#根据站点编号、箱子编号连接查询某个箱子信息和箱子对应的archivePageNum(箱子已经存放卷宗页数)                
select  vl.logid, vl.slaneId, vl.siteId, vl.siteName, vl.cabinetId, vl.factoryId, vl.deviceId, vl.seqId, vl.boxId,
                vl.boxCode, vl.boxType, vl.bCol, vl.bRow, vl.boxState, vl.curState, vl.stateTime, vl.oderId, vl.createTime,
                vl.corpId,vl.userId,vl.drawerNum,vl.boxCy,o.archivePageNum from bs_vending_lane as vl
                        left join bs_order as o on vl.siteId=o.siteId and vl.slaneId=o.boxId
                        where vl.siteId='225-0000056' and vl.cabinetId='1' and vl.slaneId='225-0002844'

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值