From eb8f2810925752accbd1587343328c2277e93815 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=B7=E5=8F=B6?= <14103883+leaf-phos@user.noreply.gitee.com> Date: Fri, 8 Nov 2024 15:50:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9E=8B=E5=8F=B7=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruoyi/ss/model/domain/SmModel.java | 3 +++ .../main/java/com/ruoyi/ss/model/domain/SmModelBO.java | 2 ++ .../java/com/ruoyi/ss/model/mapper/SmModelMapper.xml | 9 ++++----- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/model/domain/SmModel.java b/smart-switch-service/src/main/java/com/ruoyi/ss/model/domain/SmModel.java index ade49d45..7aa4bec4 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/model/domain/SmModel.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/model/domain/SmModel.java @@ -74,4 +74,7 @@ public class SmModel extends BaseEntity @ApiModelProperty("SN前缀") private String snPrefix; + + @ApiModelProperty("排序字段") + private Integer sort; } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/model/domain/SmModelBO.java b/smart-switch-service/src/main/java/com/ruoyi/ss/model/domain/SmModelBO.java index 6b0669fb..9aed64aa 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/model/domain/SmModelBO.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/model/domain/SmModelBO.java @@ -21,6 +21,7 @@ public class SmModelBO extends SmModel { bo.setServiceRate(getServiceRate()); bo.setProductId(getProductId()); bo.setSnPrefix(getSnPrefix()); + bo.setSort(getSort()); return bo; } @@ -38,6 +39,7 @@ public class SmModelBO extends SmModel { bo.setServiceRate(getServiceRate()); bo.setProductId(getProductId()); bo.setSnPrefix(getSnPrefix()); + bo.setSort(getSort()); return bo; } } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/model/mapper/SmModelMapper.xml b/smart-switch-service/src/main/java/com/ruoyi/ss/model/mapper/SmModelMapper.xml index b788bc74..91902067 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/model/mapper/SmModelMapper.xml +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/model/mapper/SmModelMapper.xml @@ -25,10 +25,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sm.service_rate, sm.product_id, sm.sn_prefix, - count(case when sd.activation_time is not null and sd.deleted = false then sd.device_id end) as activation_count, - count(case when sd.online_status = '1' and sd.activation_time is not null and sd.deleted = false then sd.device_id end) as online_count + sm.sort from sm_model sm - left join sm_device sd on sm.model_id = sd.model_id @@ -52,13 +50,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - group by sm.model_id