From 67b0ccf9e6a77767bd5b0823bc80bee474f49f9b Mon Sep 17 00:00:00 2001 From: wu <731351411@qq.com> Date: 星期二, 12 九月 2023 18:28:27 +0800 Subject: [PATCH] 新增数据库连接文件,逻辑优化 --- springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java index 76b6d90..697ba48 100644 --- a/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java +++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java @@ -1,11 +1,11 @@ package com.example.springboot.mapper; import org.apache.ibatis.annotations.*; -import com.example.springboot.common.Result; + import com.example.springboot.entity.Glass; import com.example.springboot.entity.StorageCage; import com.example.springboot.entity.StorageTask; -import com.example.springboot.entity.StorageCage; + import java.util.List; @@ -18,8 +18,8 @@ //@Select("(select*from storage_cage as a where a.state=0 and cage%2=0 ORDER BY id LIMIT 1)union (select a.* from storage_cage a inner join (select cage,if(shu2=1,shu3,shu5) as gezi from ( select cage, count(case when state1=1 and state2=0 then cell else null end)as shu1, count(case when state1=0 then cell else null end) as shu2, min(case when state1=1 and state2=0 then cell else null end) as shu3, min(case when state1=0 then cell else null end) as shu4, min(case when state1=0 or state2=0 then cell else null end) as shu5 from (select *,max(state) as state1,min(state) as state2 from storage_cage group by cage,cell) as a where cage%2!=0 GROUP BY cage HAVING shu2>1 or (shu2=1 and shu1>0) ) as sss limit 1)as b on a.cage=b.cage and a.cell=b.gezi and a.state=0 order by tier limit 1) ORDER BY id LIMIT 1;") //鑾峰彇璁㈠崟鍙锋帓搴忕殑绌鸿鍗曠瀛� - @Select("select cage,COUNT(if(order_id=#{glassid},order_id,null))as orderid from storage_cage where (order_id=#{glassid} or ''='') GROUP BY cage ORDER BY orderid desc; ") - List<StorageCage> selectAll(Short glassid); + @Select("select cage,COUNT(if(order_id=#{orderids},order_id,null))as orderid from storage_cage where (order_id=#{orderids} or ''='') GROUP BY cage ORDER BY orderid desc; ") + List<StorageCage> selectAll(Short orderids); //鍒ゆ柇璇ョ瀛愭槸鍚︽湁鍚堥�傚搴︾┖鏍� @Select("select cage,cell,tier,id,ROUND(id/2)as prcId from storage_cage where cage=#{cage1} and state=0 and width>=#{width} ORDER BY cell,tier LIMIT 1") @@ -42,7 +42,7 @@ @Select("select cage,cell,tier,glasswidth,ROUND(id/2)as prcId,id from storage_cage as a where a.order_id=#{orderId} and state=1 order by cage desc,tier desc,cell desc LIMIT 1") StorageCage selectOut(String orderId); //鎸夌幓鐠僆D鍑虹墖浠诲姟鏌ヨ - @Select("select cage,cell,tier,glasswidth,ROUND(id/2)as prcId,id from storage_cage as a where a.order_id=#{orderId} and state=1 order by cage desc,tier desc,cell desc LIMIT 1") + @Select("select cage,cell,tier,glasswidth,ROUND(id/2)as prcId,id from storage_cage as a where a.glass_id=#{glassid} and state=1 order by cage desc,tier desc,cell desc LIMIT 1") StorageCage selectOut2(String glassid); //鍒ゆ柇鍑虹墖涓�1鏃讹紝鏄惁鍙洿鎺ュ嚭鐗� -- Gitblit v1.8.0