diff --git a/zc-business/src/main/java/com/zc/business/controller/OdsTollViuDataController.java b/zc-business/src/main/java/com/zc/business/controller/OdsTollViuDataController.java new file mode 100644 index 00000000..0ca07452 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/controller/OdsTollViuDataController.java @@ -0,0 +1,38 @@ +package com.zc.business.controller; + + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.zc.business.service.IOdsTollViuDataService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +/** + * 门架牌识流水数据接口 + */ +@Api(tags = {"门架牌识流水数据接口"}) +@RestController +@RequestMapping("/business/odsTollViuData") +public class OdsTollViuDataController extends BaseController { + + @Resource + private IOdsTollViuDataService iOdsTollViuDataService; + + + /** + * 当天门架牌识流水数据统计 + * + * @return 查询结果 + */ + @ApiOperation("门架牌识流水数据统计") + @GetMapping("/countNumber") + public AjaxResult odsTollViuDataCountNumber() { + return AjaxResult.success(iOdsTollViuDataService.odsTollViuDataCountNumber()); + } + +} diff --git a/zc-business/src/main/java/com/zc/business/service/IOdsTollViuDataService.java b/zc-business/src/main/java/com/zc/business/service/IOdsTollViuDataService.java index 83952a80..d349f42c 100644 --- a/zc-business/src/main/java/com/zc/business/service/IOdsTollViuDataService.java +++ b/zc-business/src/main/java/com/zc/business/service/IOdsTollViuDataService.java @@ -8,4 +8,9 @@ import com.zc.business.domain.OdsTollViuData; * @author xiepufeng */ public interface IOdsTollViuDataService extends IService { + + /** + * 当天门架牌识流水数据统计 + */ + int odsTollViuDataCountNumber(); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/OdsTollViuDataServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/OdsTollViuDataServiceImpl.java index 4135cf79..d836ba1e 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/OdsTollViuDataServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/OdsTollViuDataServiceImpl.java @@ -1,5 +1,6 @@ package com.zc.business.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.annotation.DataSource; import com.ruoyi.common.enums.DataSourceType; @@ -8,6 +9,9 @@ import com.zc.business.mapper.OdsTollViuDataMapper; import com.zc.business.service.IOdsTollViuDataService; import org.springframework.stereotype.Service; +import java.time.LocalDate; +import java.time.LocalDateTime; + /** * 门架牌识流水数据 */ @@ -15,4 +19,18 @@ import org.springframework.stereotype.Service; @DataSource(value = DataSourceType.SLAVE)//切换数据源 public class OdsTollViuDataServiceImpl extends ServiceImpl implements IOdsTollViuDataService { + + /** + * 当天门架牌识流水数据统计 + * @return + */ + @Override + public int odsTollViuDataCountNumber() { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + LocalDateTime startOfDay = LocalDate.now().atStartOfDay(); + LocalDateTime endOfDay = LocalDate.now().atTime(23, 59, 59); + // 查询当天 门架牌识流水数据 + queryWrapper.between(OdsTollViuData::getPictime, startOfDay, endOfDay); + return count(queryWrapper); + } }