From fbd277ae603d5e3335d1ac96741745fbecbdeca7 Mon Sep 17 00:00:00 2001 From: liulixin Date: Sat, 3 Feb 2024 15:55:18 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=B8=E6=9C=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gatemachine/GateCarIOController.java | 17 +++++-- .../gatemachine/CzksGateCarIOMapper.java | 7 +-- .../service/gatemachine/GateCarIOService.java | 5 ++- .../impl/GateCarIOServiceImpl.java | 23 +++++++--- .../gatemachine/CzksGateCarIOMapper.xml | 44 ++++++++++++------- 5 files changed, 68 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/zcloud/controller/gatemachine/GateCarIOController.java b/src/main/java/com/zcloud/controller/gatemachine/GateCarIOController.java index 7618f036..c8028ef6 100644 --- a/src/main/java/com/zcloud/controller/gatemachine/GateCarIOController.java +++ b/src/main/java/com/zcloud/controller/gatemachine/GateCarIOController.java @@ -77,12 +77,14 @@ public class GateCarIOController extends BaseController { * @return */ @RequestMapping(value = "/getIORecords") - public ReturnMap getIORecord() { - return ReturnMap.ok().put("data", gateCarIOService.getIORecord(this.getPageData())); + public ReturnMap getIORecord(Page page) { + PageData pd = this.getPageData(); + page.setPd(pd); + return ReturnMap.ok().put("data", gateCarIOService.getIORecord(page)); } /** - * 获取在场,离场,总量计数 + * 获取当日计数 * @return */ @RequestMapping(value = "/getEQCount") @@ -90,4 +92,13 @@ public class GateCarIOController extends BaseController { return ReturnMap.ok().put("data", gateCarIOService.getTodayEQCount(this.getPageData())); } + /** + * 获取在场,离场,总量计数 + * @return + */ + @RequestMapping(value = "/getEQCountAll") + public ReturnMap getTodayEQCountAll() { + return ReturnMap.ok().put("data", gateCarIOService.getAllEQCount(this.getPageData())); + } + } diff --git a/src/main/java/com/zcloud/mapper/datasource/gatemachine/CzksGateCarIOMapper.java b/src/main/java/com/zcloud/mapper/datasource/gatemachine/CzksGateCarIOMapper.java index 41d96a8c..10779a38 100644 --- a/src/main/java/com/zcloud/mapper/datasource/gatemachine/CzksGateCarIOMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/gatemachine/CzksGateCarIOMapper.java @@ -19,12 +19,13 @@ public interface CzksGateCarIOMapper { void saveMineral(PageData pageData); PageData countGroceryEnterAndQuit(PageData pd); + PageData countGroceryEnterAndQuitAll(PageData pd); PageData countMineralEnterAndQuit(PageData pd); + PageData countMineralEnterAndQuitAll(PageData pd); - List getGroceryIORecords(PageData page); - - List getMineralIORecords(PageData page); + List getGroceryIORecords(Page page); + List getMineralIORecords(Page page); void removeGroceryRecordByIds(PageData pageData); diff --git a/src/main/java/com/zcloud/service/gatemachine/GateCarIOService.java b/src/main/java/com/zcloud/service/gatemachine/GateCarIOService.java index 0b011b20..35abd472 100644 --- a/src/main/java/com/zcloud/service/gatemachine/GateCarIOService.java +++ b/src/main/java/com/zcloud/service/gatemachine/GateCarIOService.java @@ -7,10 +7,9 @@ import java.util.List; public interface GateCarIOService { - List getDatalistpage(Page page); - List getIORecord(PageData page); + List getIORecord(Page page); void edit(PageData pd); @@ -19,4 +18,6 @@ public interface GateCarIOService { void save(PageData pageData); PageData getTodayEQCount(PageData pageData); + PageData getAllEQCount(PageData pageData); + } diff --git a/src/main/java/com/zcloud/service/gatemachine/impl/GateCarIOServiceImpl.java b/src/main/java/com/zcloud/service/gatemachine/impl/GateCarIOServiceImpl.java index f1a1f335..a911e6a4 100644 --- a/src/main/java/com/zcloud/service/gatemachine/impl/GateCarIOServiceImpl.java +++ b/src/main/java/com/zcloud/service/gatemachine/impl/GateCarIOServiceImpl.java @@ -47,8 +47,13 @@ public class GateCarIOServiceImpl implements GateCarIOService { * @return */ @Override - public List getIORecord(PageData page) { - return czksGateCarIOMapper.getMineralIORecords(page); + public List getIORecord(Page page) { + PageData pd = page.getPd(); + String o = (String) pd.get("type"); + if ("1".equals(o)) { + return czksGateCarIOMapper.getMineralIORecords(page); + } + return czksGateCarIOMapper.getGroceryIORecords(page); } /** @@ -109,10 +114,18 @@ public class GateCarIOServiceImpl implements GateCarIOService { * @return */ @Override - public PageData getTodayEQCount(PageData page) { + public PageData getTodayEQCount(PageData pd) { PageData pageData = new PageData(); - pageData.put("grocery", czksGateCarIOMapper.countGroceryEnterAndQuit(page)); - pageData.put("mineral", czksGateCarIOMapper.countMineralEnterAndQuit(page)); + pageData.put("grocery", czksGateCarIOMapper.countGroceryEnterAndQuit(pd)); + pageData.put("mineral", czksGateCarIOMapper.countMineralEnterAndQuit(pd)); + return pageData; + } + + @Override + public PageData getAllEQCount(PageData pd) { + PageData pageData = new PageData(); + pageData.put("grocery", czksGateCarIOMapper.countGroceryEnterAndQuitAll(pd)); + pageData.put("mineral", czksGateCarIOMapper.countMineralEnterAndQuitAll(pd)); return pageData; } } diff --git a/src/main/resources/mybatis/datasource/gatemachine/CzksGateCarIOMapper.xml b/src/main/resources/mybatis/datasource/gatemachine/CzksGateCarIOMapper.xml index 1936e24b..2cb017f4 100644 --- a/src/main/resources/mybatis/datasource/gatemachine/CzksGateCarIOMapper.xml +++ b/src/main/resources/mybatis/datasource/gatemachine/CzksGateCarIOMapper.xml @@ -67,28 +67,28 @@ select * from `qa-czks-prevention`.`work_grocery_io_record` f where 1=1 - + and f.JGSJ = #{JGSJ} - + and f.LX = #{LX} - + and f.TRUCK_NO like CONCAT(CONCAT('%', #{TRUCK_NO}),'%') order by f.OPERATTIME desc + - select count(case when m.PASS_TYPE = '0' then 0 end) as `entered`, count(case when m.PASS_TYPE = '1' then 1 end) as `quited` @@ -162,9 +160,25 @@ `qa-czks-prevention`.`work_mineral_io_record` m where m.ISDELETE = 0 - - and day(m.CREATTIME) = day(NOW()); - + and day(m.CREATTIME) = day(NOW()) + + +