Merge remote-tracking branch 'origin/main'

This commit is contained in:
卢序振 2024-09-03 18:47:30 +08:00
commit 32c0d5cb5f
5 changed files with 174 additions and 16 deletions

View File

@ -16,14 +16,13 @@ import java.util.List;
/** /**
* AI识别算法开发Controller * AI识别算法开发Controller
* *
* @author Lxz * @author Lxz
* @date 2023-12-11 * @date 2023-12-11
*/ */
@RestController @RestController
@RequestMapping("/aiRecognition/godUniversalElectricMeter") @RequestMapping("/aiRecognition/godUniversalElectricMeter")
public class GodUniversalElectricMeterController extends BaseController public class GodUniversalElectricMeterController extends BaseController {
{
@Resource @Resource
private IGodUniversalElectricMeterService godUniversalElectricMeterService; private IGodUniversalElectricMeterService godUniversalElectricMeterService;
@ -32,8 +31,7 @@ public class GodUniversalElectricMeterController extends BaseController
*/ */
//@PreAuthorize("@ss.hasPermi('aiRecognition:godUniversalElectricMeter:list')") //@PreAuthorize("@ss.hasPermi('aiRecognition:godUniversalElectricMeter:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(GodUniversalElectricMeter godUniversalElectricMeter) public TableDataInfo list(GodUniversalElectricMeter godUniversalElectricMeter) {
{
startPage(); startPage();
List<GodUniversalElectricMeter> list = godUniversalElectricMeterService.selectGodUniversalElectricMeterList(godUniversalElectricMeter); List<GodUniversalElectricMeter> list = godUniversalElectricMeterService.selectGodUniversalElectricMeterList(godUniversalElectricMeter);
return getDataTable(list); return getDataTable(list);
@ -45,8 +43,7 @@ public class GodUniversalElectricMeterController extends BaseController
//@PreAuthorize("@ss.hasPermi('aiRecognition:godUniversalElectricMeter:export')") //@PreAuthorize("@ss.hasPermi('aiRecognition:godUniversalElectricMeter:export')")
@Log(title = "AI识别算法开发", businessType = BusinessType.EXPORT) @Log(title = "AI识别算法开发", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, GodUniversalElectricMeter godUniversalElectricMeter) public void export(HttpServletResponse response, GodUniversalElectricMeter godUniversalElectricMeter) {
{
List<GodUniversalElectricMeter> list = godUniversalElectricMeterService.selectGodUniversalElectricMeterList(godUniversalElectricMeter); List<GodUniversalElectricMeter> list = godUniversalElectricMeterService.selectGodUniversalElectricMeterList(godUniversalElectricMeter);
ExcelUtil<GodUniversalElectricMeter> util = new ExcelUtil<GodUniversalElectricMeter>(GodUniversalElectricMeter.class); ExcelUtil<GodUniversalElectricMeter> util = new ExcelUtil<GodUniversalElectricMeter>(GodUniversalElectricMeter.class);
util.exportExcel(response, list, "AI识别算法开发数据"); util.exportExcel(response, list, "AI识别算法开发数据");
@ -57,8 +54,7 @@ public class GodUniversalElectricMeterController extends BaseController
*/ */
//@PreAuthorize("@ss.hasPermi('aiRecognition:godUniversalElectricMeter:query')") //@PreAuthorize("@ss.hasPermi('aiRecognition:godUniversalElectricMeter:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id) public AjaxResult getInfo(@PathVariable("id") String id) {
{
return success(godUniversalElectricMeterService.selectGodUniversalElectricMeterById(id)); return success(godUniversalElectricMeterService.selectGodUniversalElectricMeterById(id));
} }
@ -68,8 +64,7 @@ public class GodUniversalElectricMeterController extends BaseController
//@PreAuthorize("@ss.hasPermi('aiRecognition:godUniversalElectricMeter:add')") //@PreAuthorize("@ss.hasPermi('aiRecognition:godUniversalElectricMeter:add')")
@Log(title = "AI识别算法开发", businessType = BusinessType.INSERT) @Log(title = "AI识别算法开发", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody GodUniversalElectricMeter godUniversalElectricMeter) public AjaxResult add(@RequestBody GodUniversalElectricMeter godUniversalElectricMeter) {
{
return toAjax(godUniversalElectricMeterService.insertGodUniversalElectricMeter(godUniversalElectricMeter)); return toAjax(godUniversalElectricMeterService.insertGodUniversalElectricMeter(godUniversalElectricMeter));
} }
@ -79,8 +74,7 @@ public class GodUniversalElectricMeterController extends BaseController
//@PreAuthorize("@ss.hasPermi('aiRecognition:godUniversalElectricMeter:edit')") //@PreAuthorize("@ss.hasPermi('aiRecognition:godUniversalElectricMeter:edit')")
@Log(title = "AI识别算法开发", businessType = BusinessType.UPDATE) @Log(title = "AI识别算法开发", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody GodUniversalElectricMeter godUniversalElectricMeter) public AjaxResult edit(@RequestBody GodUniversalElectricMeter godUniversalElectricMeter) {
{
return toAjax(godUniversalElectricMeterService.updateGodUniversalElectricMeter(godUniversalElectricMeter)); return toAjax(godUniversalElectricMeterService.updateGodUniversalElectricMeter(godUniversalElectricMeter));
} }
@ -89,9 +83,24 @@ public class GodUniversalElectricMeterController extends BaseController
*/ */
//@PreAuthorize("@ss.hasPermi('aiRecognition:godUniversalElectricMeter:remove')") //@PreAuthorize("@ss.hasPermi('aiRecognition:godUniversalElectricMeter:remove')")
@Log(title = "AI识别算法开发", businessType = BusinessType.DELETE) @Log(title = "AI识别算法开发", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids) public AjaxResult remove(@PathVariable String[] ids) {
{
return toAjax(godUniversalElectricMeterService.deleteGodUniversalElectricMeterByIds(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));
}
} }

View File

@ -3,6 +3,7 @@ package com.god.aiRecognition.mapper;
import com.god.aiRecognition.domain.GodUniversalElectricMeter; import com.god.aiRecognition.domain.GodUniversalElectricMeter;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* AI识别算法开发Mapper接口 * AI识别算法开发Mapper接口
@ -61,4 +62,17 @@ public interface GodUniversalElectricMeterMapper
public int deleteGodUniversalElectricMeterByIds(String[] ids); public int deleteGodUniversalElectricMeterByIds(String[] ids);
String getMaxSnByPrefix(String yyyyMM); String getMaxSnByPrefix(String yyyyMM);
/**
* 根据条件查询对应数量
* @param godUniversalElectricMeter 查询条件实体
* @return 统计结果
*/
Long getCountBySome(GodUniversalElectricMeter godUniversalElectricMeter);
/**
*根据条件查询折线图横纵坐标
*/
List<Map<String,Object>> getCountEChartBySome(GodUniversalElectricMeter godUniversalElectricMeter);
} }

View File

@ -1,6 +1,8 @@
package com.god.aiRecognition.service; package com.god.aiRecognition.service;
import java.util.List; import java.util.List;
import java.util.Map;
import com.god.aiRecognition.domain.GodUniversalElectricMeter; import com.god.aiRecognition.domain.GodUniversalElectricMeter;
/** /**
@ -58,4 +60,13 @@ public interface IGodUniversalElectricMeterService
* @return 结果 * @return 结果
*/ */
public int deleteGodUniversalElectricMeterById(String id); public int deleteGodUniversalElectricMeterById(String id);
/**
*根据条件查询对应数量
*/
Long getCountBySome(GodUniversalElectricMeter godUniversalElectricMeter);
/**
*根据条件查询折线图横纵坐标
*/
List<Map<String,Object>> getCountEChartBySome(GodUniversalElectricMeter godUniversalElectricMeter);
} }

View File

@ -11,6 +11,7 @@ import javax.annotation.Resource;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* AI识别算法开发Service业务层处理 * AI识别算法开发Service业务层处理
@ -101,4 +102,18 @@ public class GodUniversalElectricMeterServiceImpl implements IGodUniversalElectr
{ {
return godUniversalElectricMeterMapper.deleteGodUniversalElectricMeterById(id); return godUniversalElectricMeterMapper.deleteGodUniversalElectricMeterById(id);
} }
/**
*根据条件查询对应数量
*/
@Override
public Long getCountBySome(GodUniversalElectricMeter godUniversalElectricMeter) {
return godUniversalElectricMeterMapper.getCountBySome(godUniversalElectricMeter);
}
@Override
public List<Map<String, Object>> getCountEChartBySome(GodUniversalElectricMeter godUniversalElectricMeter) {
return godUniversalElectricMeterMapper.getCountEChartBySome(godUniversalElectricMeter);
}
} }

View File

@ -97,6 +97,115 @@
WHERE reserve_one LIKE CONCAT(#{prefix}, '%') WHERE reserve_one LIKE CONCAT(#{prefix}, '%')
order by reserve_one desc limit 1 order by reserve_one desc limit 1
</select> </select>
<select id="getCountBySome" resultType="java.lang.Long" parameterType="GodUniversalElectricMeter">
select COUNT(1)
from god_universal_electric_meter
<where>
<if test="reserveOne != null and reserveOne != ''">and reserve_one =
#{reserveOne}
</if>
<if test="reserveTwo != null and reserveTwo != ''">and reserve_two =
#{reserveTwo}
</if>
<if test="reserveThree != null and reserveThree != ''">and reserve_three =
#{reserveThree}
</if>
<if test="reserveFour != null and reserveFour != ''">and reserve_four =
#{reserveFour}
</if>
<if test="reserveFive != null and reserveFive != ''">and reserve_five =
#{reserveFive}
</if>
<if test="reserveSix != null and reserveSix != ''">and reserve_six =
#{reserveSix}
</if>
<if test="reserveSeven != null and reserveSeven != ''">and reserve_seven =
#{reserveSeven}
</if>
<if test="reserveEight != null and reserveEight != ''">and reserve_eight =
#{reserveEight}
</if>
<if test="reserveNine != null and reserveNine != ''">and reserve_nine =
#{reserveNine}
</if>
<if test="reserveTen != null and reserveTen != ''">and reserve_ten =
#{reserveTen}
</if>
<if test="reserveEleven != null and reserveEleven != ''">and reserve_eleven =
#{reserveEleven}
</if>
<if test="reserveTwelve != null and reserveTwelve != ''">and reserve_twelve =
#{reserveTwelve}
</if>
<if test="reserveThirteen != null and reserveThirteen != ''">and reserve_thirteen =
#{reserveThirteen}
</if>
<if test="reserveFourteen != null and reserveFourteen != ''">and reserve_fourteen =
#{reserveFourteen}
</if>
<if test="sysType != null and sysType != ''">and sys_type =
#{sysType}
</if>
<if test="moduleType != null and moduleType != ''">and module_type =
#{moduleType}
</if>
</where>
</select>
<select id="getCountEChartBySome" resultType="java.util.Map" parameterType="GodUniversalElectricMeter">
SELECT reserve_four AS acrossName, COUNT(1) AS portaitData
from god_universal_electric_meter
<where>
<if test="reserveOne != null and reserveOne != ''">and reserve_one =
#{reserveOne}
</if>
<if test="reserveTwo != null and reserveTwo != ''">and reserve_two =
#{reserveTwo}
</if>
<if test="reserveThree != null and reserveThree != ''">and reserve_three =
#{reserveThree}
</if>
<if test="reserveFour != null and reserveFour != ''">and reserve_four =
#{reserveFour}
</if>
<if test="reserveFive != null and reserveFive != ''">and reserve_five =
#{reserveFive}
</if>
<if test="reserveSix != null and reserveSix != ''">and reserve_six =
#{reserveSix}
</if>
<if test="reserveSeven != null and reserveSeven != ''">and reserve_seven =
#{reserveSeven}
</if>
<if test="reserveEight != null and reserveEight != ''">and reserve_eight =
#{reserveEight}
</if>
<if test="reserveNine != null and reserveNine != ''">and reserve_nine =
#{reserveNine}
</if>
<if test="reserveTen != null and reserveTen != ''">and reserve_ten =
#{reserveTen}
</if>
<if test="reserveEleven != null and reserveEleven != ''">and reserve_eleven =
#{reserveEleven}
</if>
<if test="reserveTwelve != null and reserveTwelve != ''">and reserve_twelve =
#{reserveTwelve}
</if>
<if test="reserveThirteen != null and reserveThirteen != ''">and reserve_thirteen =
#{reserveThirteen}
</if>
<if test="reserveFourteen != null and reserveFourteen != ''">and reserve_fourteen =
#{reserveFourteen}
</if>
<if test="sysType != null and sysType != ''">and sys_type =
#{sysType}
</if>
<if test="moduleType != null and moduleType != ''">and module_type =
#{moduleType}
</if>
</where>
GROUP BY reserve_four
</select>
<insert id="insertGodUniversalElectricMeter" parameterType="GodUniversalElectricMeter"> <insert id="insertGodUniversalElectricMeter" parameterType="GodUniversalElectricMeter">
insert into god_universal_electric_meter insert into god_universal_electric_meter