diff --git a/src/main/java/com/zcloud/controller/gatemachine/GateCarIOController.java b/src/main/java/com/zcloud/controller/gatemachine/GateCarIOController.java index 61fafd85..f361ee77 100644 --- a/src/main/java/com/zcloud/controller/gatemachine/GateCarIOController.java +++ b/src/main/java/com/zcloud/controller/gatemachine/GateCarIOController.java @@ -55,16 +55,14 @@ public class GateCarIOController extends BaseController { } @RequestMapping(value = "/getIORecords") - public ReturnMap getIORecord(Page page) { - PageData pageData = this.getPageData(); - page.setPd(pageData); - return ReturnMap.ok().put("data", gateCarIOService.getIORecord(page)); + public ReturnMap getIORecord() { + return ReturnMap.ok().put("data", gateCarIOService.getIORecord(this.getPageData())); } @RequestMapping(value = "/getEQCount") public ReturnMap getTodayEQCount() { - PageData pageData = this.getPageData(); - return ReturnMap.ok().put("data", gateCarIOService.getTodayEQCount(pageData)); + PageData page = this.getPageData(); + return ReturnMap.ok().put("data", gateCarIOService.getTodayEQCount(page)); } } 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 c70880c1..dfcc20ca 100644 --- a/src/main/java/com/zcloud/mapper/datasource/gatemachine/CzksGateCarIOMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/gatemachine/CzksGateCarIOMapper.java @@ -16,7 +16,11 @@ public interface CzksGateCarIOMapper { void saveMineral(PageData pageData); - List getIORecord(Page page); - PageData countGroceryEnterAndQuit(PageData pageData); - PageData countMineralEnterAndQuit(PageData pageData); + List getIORecord(PageData pd); + PageData countGroceryEnterAndQuit(PageData pd); + PageData countMineralEnterAndQuit(PageData pd); + + List getGroceryIORecords(PageData page); + + List getMineralIORecords(PageData page); } diff --git a/src/main/java/com/zcloud/service/gatemachine/GateCarIOService.java b/src/main/java/com/zcloud/service/gatemachine/GateCarIOService.java index 7919db29..0b011b20 100644 --- a/src/main/java/com/zcloud/service/gatemachine/GateCarIOService.java +++ b/src/main/java/com/zcloud/service/gatemachine/GateCarIOService.java @@ -10,7 +10,7 @@ public interface GateCarIOService { List getDatalistpage(Page page); - List getIORecord(Page page); + List getIORecord(PageData page); void edit(PageData pd); 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 df32e6c8..51934193 100644 --- a/src/main/java/com/zcloud/service/gatemachine/impl/GateCarIOServiceImpl.java +++ b/src/main/java/com/zcloud/service/gatemachine/impl/GateCarIOServiceImpl.java @@ -9,6 +9,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; /** @@ -29,8 +30,12 @@ public class GateCarIOServiceImpl implements GateCarIOService { } @Override - public List getIORecord(Page page) { - return czksGateCarIOMapper.getIORecord(page); + public List getIORecord(PageData page) { + if (page.get("areaType") != null && "1".equals(page.get("areaType").toString())) { + return czksGateCarIOMapper.getGroceryIORecords(page); + } else { + return czksGateCarIOMapper.getMineralIORecords(page); + } } @Override @@ -60,10 +65,10 @@ public class GateCarIOServiceImpl implements GateCarIOService { } @Override - public PageData getTodayEQCount(PageData PageData) { + public PageData getTodayEQCount(PageData page) { PageData pageData = new PageData(); - pageData.put("grocery", czksGateCarIOMapper.countGroceryEnterAndQuit(PageData)); - pageData.put("mineral", czksGateCarIOMapper.countMineralEnterAndQuit(PageData)); + pageData.put("grocery", czksGateCarIOMapper.countGroceryEnterAndQuit(page)); + pageData.put("mineral", czksGateCarIOMapper.countMineralEnterAndQuit(page)); return pageData; } } diff --git a/src/main/resources/mybatis/datasource/gatemachine/CzksGateCarIOMapper.xml b/src/main/resources/mybatis/datasource/gatemachine/CzksGateCarIOMapper.xml index 8c4865e7..30963107 100644 --- a/src/main/resources/mybatis/datasource/gatemachine/CzksGateCarIOMapper.xml +++ b/src/main/resources/mybatis/datasource/gatemachine/CzksGateCarIOMapper.xml @@ -63,23 +63,33 @@ #{OPERATOR}, #{OPERATTIME}) - select * from - `qa-czks-prevention`.`work_grocery_io_record` f + where 1=1 + + and f.JGSJ = #{JGSJ} - - `qa-czks-prevention`.`work_mineral_io_record` f + + and f.LX = #{LX} - where - - f.JGSJ = #{pd.JGSJ} + + and f.TRUCK_NO like CONCAT(CONCAT('%', #{TRUCK_NO}),'%') - - and f.LX = #{pd.LX} + order by f.OPERATTIME desc + + @@ -106,10 +116,10 @@ OPERATTIME=#{OPERATTIME} where 1=1 - f.grocery_record_id=#{grocery_record_id} + and f.grocery_record_id=#{grocery_record_id} - f.mineral_record_id=#{mineral_record_id} + and f.mineral_record_id=#{mineral_record_id} @@ -123,10 +133,10 @@ set ISDELETE = 1 where 1=1 - f.grocery_record_id=#{grocery_record_id} + and f.grocery_record_id=#{grocery_record_id} - f.mineral_record_id=#{mineral_record_id} + and f.mineral_record_id=#{mineral_record_id}