| | |
| | | @Select("select cage,round(100-(21-sum(if(state>0,1,state)))/21*100) as cell,21-sum(if(state>0,1,state)) as state from (select cage,cell,max(state) as state from storage_cage group by cage,cell) as cages group by cage") |
| | | List<StorageCage> selectAll(); |
| | | |
| | | @Select("Select cage,sum(case when number=0 or number is null then 1 else 0 end) as cell,100-sum(case when number=0 or number is null then 1 else 0 end)/count(id)*100 as width from storage_cage group by cage") |
| | | // @Select("Select cage,sum(case when number=0 or number is null then 1 else 0 end) as cell,100-sum(case when number=0 or number is null then 1 else 0 end)/count(id)*100 as width from storage_cage group by cage") |
| | | // List<StorageCage> selectAlls(); |
| | | // 查询每个笼子的使用情况 |
| | | // @Select("Select a.cage,sum(case when a.number=0 or a.number is null then 1 else 0 end)-b.cells as cell,100+b.cells-sum(case when a.number=0 or a.number is null then 1 else 0 end)/count(a.id)*100 as width from storage_cage a left join (select `cage_numbers`.`cage` AS `cages`,count(`a`.`shelf_rack`) AS `cells` from ((select 1 AS `cage` union all select 2 AS `2` union all select 3 AS `3` union all select 4 AS `4`) `cage_numbers` left join `out_task` `a` on((((case when (`a`.`shelf_rack` between 1 and 40) then 1 when (`a`.`shelf_rack` between 41 and 80) then 2 when (`a`.`shelf_rack` between 81 and 120) then 3 when (`a`.`shelf_rack` between 121 and 160) then 4 else NULL end) = `cage_numbers`.`cage`) and (`a`.`task_state` = 0)))) group by `cage_numbers`.`cage` order by `cage_numbers`.`cage`) as b on a.cage=b.cages group by a.cage;") |
| | | // List<StorageCage> selectAlls(); |
| | | @Select("Select a.cage, GREATEST(sum(case when a.number is null and disabled=0 then 1 else 0 end),0) as cell,LEAST(100-sum(case when a.number is null and disabled=0 then 1 else 0 end)/count(a.id)*100,100) as width from storage_cage a left join (select `cage_numbers`.`cage` AS `cages`,count(`a`.`shelf_rack`) AS `cells` from ((select 1 AS `cage` union all select 2 AS `2` union all select 3 AS `3` union all select 4 AS `4`) `cage_numbers` left join `out_task` `a` on((((case when (`a`.`shelf_rack` between 1 and 40) then 1 when (`a`.`shelf_rack` between 41 and 80) then 2 when (`a`.`shelf_rack` between 81 and 120) then 3 when (`a`.`shelf_rack` between 121 and 160) then 4 else NULL end) = `cage_numbers`.`cage`) and (`a`.`task_state` = 0)))) group by `cage_numbers`.`cage` order by `cage_numbers`.`cage`) as b on a.cage=b.cages group by a.cage;") |
| | | List<StorageCage> selectAlls(); |
| | | |
| | | // 查询10-6笼内层格子状态 |
| | |
| | | void updateStroageCageByCell(Integer cell, Integer num); |
| | | |
| | | // 计算格子内剩余宽度 |
| | | @Update("update storage_cage set width=4300-if(glasswidth is null,0,glasswidth+300)*number+300 where cell=#{cell}") |
| | | @Update("update storage_cage set width=4300-if(glasswidth is null,0,glasswidth)*number-(number*300)+300 where cell=#{cell}") |
| | | void UpdateStroageCageWidthByCell(Integer cell); |
| | | |
| | | // 根据任务类型获取任务 |
| | |
| | | // int deleteGlassinfo(String flowcard); |
| | | @Update("Update flowcard set state=2, flowcard=CONCAT('已删除', #{flowcard}),orderstate=0 where flowcard=#{flowcard}") |
| | | int deleteFlowcard(String flowcard); |
| | | //查询当前笼子是否还有该订单的玻璃 |
| | | |
| | | @Select("select count(*) from storage_cage where flowcard=#{flowcard}") |
| | | int selectflowcardCage(String flowcard); |
| | | //修改出片队列状态 |
| | | @Update("Update out_task set task_state=#{state} where id=#{id}") |
| | | int UpdateOutTask(Integer id, Integer state); |
| | |
| | | List<Map> Selecttiersum(); |
| | | |
| | | // 查询笼内玻璃信息 |
| | | @Select("select * from storage_cage where cage=#{cage} order by id desc") |
| | | @Select("select DISTINCT * from storage_cage where cage=#{cage} order by id desc") |
| | | List<StorageCage> SelectStorageCageByCage(Integer cage); |
| | | |
| | | // 添加出片队列 |