diff --git a/God-Vue-master/god-admin/src/main/java/com/god/web/controller/aiRecognition/GodUniversalElectricMeterController.java b/God-Vue-master/god-admin/src/main/java/com/god/web/controller/aiRecognition/GodUniversalElectricMeterController.java index 2952a029..11f24ce2 100644 --- a/God-Vue-master/god-admin/src/main/java/com/god/web/controller/aiRecognition/GodUniversalElectricMeterController.java +++ b/God-Vue-master/god-admin/src/main/java/com/god/web/controller/aiRecognition/GodUniversalElectricMeterController.java @@ -16,14 +16,13 @@ import java.util.List; /** * AI识别算法开发Controller - * + * * @author Lxz * @date 2023-12-11 */ @RestController @RequestMapping("/aiRecognition/godUniversalElectricMeter") -public class GodUniversalElectricMeterController extends BaseController -{ +public class GodUniversalElectricMeterController extends BaseController { @Resource private IGodUniversalElectricMeterService godUniversalElectricMeterService; @@ -32,8 +31,7 @@ public class GodUniversalElectricMeterController extends BaseController */ //@PreAuthorize("@ss.hasPermi('aiRecognition:godUniversalElectricMeter:list')") @GetMapping("/list") - public TableDataInfo list(GodUniversalElectricMeter godUniversalElectricMeter) - { + public TableDataInfo list(GodUniversalElectricMeter godUniversalElectricMeter) { startPage(); List list = godUniversalElectricMeterService.selectGodUniversalElectricMeterList(godUniversalElectricMeter); return getDataTable(list); @@ -45,8 +43,7 @@ public class GodUniversalElectricMeterController extends BaseController //@PreAuthorize("@ss.hasPermi('aiRecognition:godUniversalElectricMeter:export')") @Log(title = "AI识别算法开发", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, GodUniversalElectricMeter godUniversalElectricMeter) - { + public void export(HttpServletResponse response, GodUniversalElectricMeter godUniversalElectricMeter) { List list = godUniversalElectricMeterService.selectGodUniversalElectricMeterList(godUniversalElectricMeter); ExcelUtil util = new ExcelUtil(GodUniversalElectricMeter.class); util.exportExcel(response, list, "AI识别算法开发数据"); @@ -57,8 +54,7 @@ public class GodUniversalElectricMeterController extends BaseController */ //@PreAuthorize("@ss.hasPermi('aiRecognition:godUniversalElectricMeter:query')") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") String id) - { + public AjaxResult getInfo(@PathVariable("id") String id) { return success(godUniversalElectricMeterService.selectGodUniversalElectricMeterById(id)); } @@ -68,8 +64,7 @@ public class GodUniversalElectricMeterController extends BaseController //@PreAuthorize("@ss.hasPermi('aiRecognition:godUniversalElectricMeter:add')") @Log(title = "AI识别算法开发", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody GodUniversalElectricMeter godUniversalElectricMeter) - { + public AjaxResult add(@RequestBody GodUniversalElectricMeter godUniversalElectricMeter) { return toAjax(godUniversalElectricMeterService.insertGodUniversalElectricMeter(godUniversalElectricMeter)); } @@ -79,8 +74,7 @@ public class GodUniversalElectricMeterController extends BaseController //@PreAuthorize("@ss.hasPermi('aiRecognition:godUniversalElectricMeter:edit')") @Log(title = "AI识别算法开发", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody GodUniversalElectricMeter godUniversalElectricMeter) - { + public AjaxResult edit(@RequestBody GodUniversalElectricMeter godUniversalElectricMeter) { return toAjax(godUniversalElectricMeterService.updateGodUniversalElectricMeter(godUniversalElectricMeter)); } @@ -89,9 +83,24 @@ public class GodUniversalElectricMeterController extends BaseController */ //@PreAuthorize("@ss.hasPermi('aiRecognition:godUniversalElectricMeter:remove')") @Log(title = "AI识别算法开发", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable String[] ids) - { + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) { return toAjax(godUniversalElectricMeterService.deleteGodUniversalElectricMeterByIds(ids)); } + + /** + * 根据条件查询对应数量 + */ + @GetMapping("/getCountBySome") + public AjaxResult getCountBySome(GodUniversalElectricMeter godUniversalElectricMeter) { + return success(godUniversalElectricMeterService.getCountBySome(godUniversalElectricMeter)); + } + + /** + * 根据条件查询折线图横纵坐标 + */ + @GetMapping("/getCountEChartBySome") + public AjaxResult getCountEChartBySome(GodUniversalElectricMeter godUniversalElectricMeter) { + return success(godUniversalElectricMeterService.getCountEChartBySome(godUniversalElectricMeter)); + } } diff --git a/God-Vue-master/god-system/src/main/java/com/god/aiRecognition/mapper/GodUniversalElectricMeterMapper.java b/God-Vue-master/god-system/src/main/java/com/god/aiRecognition/mapper/GodUniversalElectricMeterMapper.java index b9088e6f..c1678c5a 100644 --- a/God-Vue-master/god-system/src/main/java/com/god/aiRecognition/mapper/GodUniversalElectricMeterMapper.java +++ b/God-Vue-master/god-system/src/main/java/com/god/aiRecognition/mapper/GodUniversalElectricMeterMapper.java @@ -3,6 +3,7 @@ package com.god.aiRecognition.mapper; import com.god.aiRecognition.domain.GodUniversalElectricMeter; import java.util.List; +import java.util.Map; /** * AI识别算法开发Mapper接口 @@ -61,4 +62,17 @@ public interface GodUniversalElectricMeterMapper public int deleteGodUniversalElectricMeterByIds(String[] ids); String getMaxSnByPrefix(String yyyyMM); + + /** + * 根据条件查询对应数量 + * @param godUniversalElectricMeter 查询条件实体 + * @return 统计结果 + */ + Long getCountBySome(GodUniversalElectricMeter godUniversalElectricMeter); + + + /** + *根据条件查询折线图横纵坐标 + */ + List> getCountEChartBySome(GodUniversalElectricMeter godUniversalElectricMeter); } diff --git a/God-Vue-master/god-system/src/main/java/com/god/aiRecognition/service/IGodUniversalElectricMeterService.java b/God-Vue-master/god-system/src/main/java/com/god/aiRecognition/service/IGodUniversalElectricMeterService.java index 01b27098..599435cd 100644 --- a/God-Vue-master/god-system/src/main/java/com/god/aiRecognition/service/IGodUniversalElectricMeterService.java +++ b/God-Vue-master/god-system/src/main/java/com/god/aiRecognition/service/IGodUniversalElectricMeterService.java @@ -1,6 +1,8 @@ package com.god.aiRecognition.service; import java.util.List; +import java.util.Map; + import com.god.aiRecognition.domain.GodUniversalElectricMeter; /** @@ -58,4 +60,13 @@ public interface IGodUniversalElectricMeterService * @return 结果 */ public int deleteGodUniversalElectricMeterById(String id); + /** + *根据条件查询对应数量 + */ + Long getCountBySome(GodUniversalElectricMeter godUniversalElectricMeter); + + /** + *根据条件查询折线图横纵坐标 + */ + List> getCountEChartBySome(GodUniversalElectricMeter godUniversalElectricMeter); } diff --git a/God-Vue-master/god-system/src/main/java/com/god/aiRecognition/service/impl/GodUniversalElectricMeterServiceImpl.java b/God-Vue-master/god-system/src/main/java/com/god/aiRecognition/service/impl/GodUniversalElectricMeterServiceImpl.java index 00de2ffc..20f6bbe6 100644 --- a/God-Vue-master/god-system/src/main/java/com/god/aiRecognition/service/impl/GodUniversalElectricMeterServiceImpl.java +++ b/God-Vue-master/god-system/src/main/java/com/god/aiRecognition/service/impl/GodUniversalElectricMeterServiceImpl.java @@ -11,6 +11,7 @@ import javax.annotation.Resource; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; +import java.util.Map; /** * AI识别算法开发Service业务层处理 @@ -101,4 +102,18 @@ public class GodUniversalElectricMeterServiceImpl implements IGodUniversalElectr { return godUniversalElectricMeterMapper.deleteGodUniversalElectricMeterById(id); } + + /** + *根据条件查询对应数量 + */ + @Override + public Long getCountBySome(GodUniversalElectricMeter godUniversalElectricMeter) { + return godUniversalElectricMeterMapper.getCountBySome(godUniversalElectricMeter); + } + + @Override + public List> getCountEChartBySome(GodUniversalElectricMeter godUniversalElectricMeter) { + return godUniversalElectricMeterMapper.getCountEChartBySome(godUniversalElectricMeter); + } + } diff --git a/God-Vue-master/god-system/src/main/resources/mapper/aiRecognition/GodUniversalElectricMeterMapper.xml b/God-Vue-master/god-system/src/main/resources/mapper/aiRecognition/GodUniversalElectricMeterMapper.xml index ccdecf49..b941551f 100644 --- a/God-Vue-master/god-system/src/main/resources/mapper/aiRecognition/GodUniversalElectricMeterMapper.xml +++ b/God-Vue-master/god-system/src/main/resources/mapper/aiRecognition/GodUniversalElectricMeterMapper.xml @@ -97,6 +97,115 @@ WHERE reserve_one LIKE CONCAT(#{prefix}, '%') order by reserve_one desc limit 1 + + insert into god_universal_electric_meter