diff --git a/src/main/java/club/joylink/xiannccda/dto/alertTip/AlertTipQueryDTO.java b/src/main/java/club/joylink/xiannccda/dto/alertTip/AlertTipQueryDTO.java index 13fc6c7..49d2dba 100644 --- a/src/main/java/club/joylink/xiannccda/dto/alertTip/AlertTipQueryDTO.java +++ b/src/main/java/club/joylink/xiannccda/dto/alertTip/AlertTipQueryDTO.java @@ -14,9 +14,9 @@ import lombok.Setter; @NoArgsConstructor public class AlertTipQueryDTO extends PageDTO { - private AlertType alertType; - private AlertTipTimeType timeType; - private AlertLocation locationType; + private String alertType; + private String timeType; + private String locationType; private Long areaConfigId; private String areaConfigName; } diff --git a/src/main/java/club/joylink/xiannccda/mapper/AlertTipMapper.java b/src/main/java/club/joylink/xiannccda/mapper/AlertTipMapper.java index dedf63e..6364e7a 100644 --- a/src/main/java/club/joylink/xiannccda/mapper/AlertTipMapper.java +++ b/src/main/java/club/joylink/xiannccda/mapper/AlertTipMapper.java @@ -20,5 +20,5 @@ import org.apache.ibatis.annotations.Param; @Mapper public interface AlertTipMapper extends BaseMapper { - IPage newSelectPage2(@Param("tipQuery") AlertTipQueryDTO dto); + IPage selectForPage(@Param("tipQuery") AlertTipQueryDTO dto); } diff --git a/src/main/java/club/joylink/xiannccda/repository/impl/AlertTipRepository.java b/src/main/java/club/joylink/xiannccda/repository/impl/AlertTipRepository.java index 6e6ba88..b98086b 100644 --- a/src/main/java/club/joylink/xiannccda/repository/impl/AlertTipRepository.java +++ b/src/main/java/club/joylink/xiannccda/repository/impl/AlertTipRepository.java @@ -34,10 +34,10 @@ public class AlertTipRepository extends ServiceImpl im public Page page(AlertTipQueryDTO queryDTO) { LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(AlertTip.class); if (queryDTO.getAlertType() != null) { - queryWrapper.eq(AlertTip::getAlertType, queryDTO.getAlertType().name()); + queryWrapper.eq(AlertTip::getAlertType, queryDTO.getAlertType()); } if (queryDTO.getTimeType() != null) { - queryWrapper.eq(AlertTip::getTimeType, queryDTO.getTimeType().name()); + queryWrapper.eq(AlertTip::getTimeType, queryDTO.getTimeType()); } queryWrapper.eq(queryDTO.getAreaConfigId() != null, AlertTip::getAreaConfigId, queryDTO.getAreaConfigId()); @@ -66,7 +66,7 @@ public class AlertTipRepository extends ServiceImpl im @Override public IPage leftAreaPage(AlertTipQueryDTO queryDTO) { - return this.baseMapper.newSelectPage2(queryDTO); + return this.baseMapper.selectForPage(queryDTO); } } diff --git a/src/main/resources/mybatis/mapper/AlertTipMapper.xml b/src/main/resources/mybatis/mapper/AlertTipMapper.xml index 8e985e2..f016f0f 100644 --- a/src/main/resources/mybatis/mapper/AlertTipMapper.xml +++ b/src/main/resources/mybatis/mapper/AlertTipMapper.xml @@ -2,7 +2,7 @@ - select A.*, B.area_name as areaConfigName from alert_tip A left join device_area_config B on A.area_config_id = B.id where 1 = 1 diff --git a/src/test/java/club/joylink/xiannccda/service/AlertTipServiceTest.java b/src/test/java/club/joylink/xiannccda/service/AlertTipServiceTest.java index 9f49315..09e3360 100644 --- a/src/test/java/club/joylink/xiannccda/service/AlertTipServiceTest.java +++ b/src/test/java/club/joylink/xiannccda/service/AlertTipServiceTest.java @@ -25,7 +25,8 @@ public class AlertTipServiceTest { @Test public void page() { AlertTipQueryDTO dto = new AlertTipQueryDTO(); - dto.setAreaConfigName("鱼"); + + dto.setAlertType(AlertType.BLUE_DISPLAY.name()); IPage page = this.alertTipRepository.leftAreaPage(dto); System.out.println(JSON.toJSONString(page, Feature.PrettyFormat));