diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/suit/domain/SuitQuery.java b/smart-switch-service/src/main/java/com/ruoyi/ss/suit/domain/SuitQuery.java index ad01349d..2b816179 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/suit/domain/SuitQuery.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/suit/domain/SuitQuery.java @@ -25,4 +25,6 @@ public class SuitQuery extends Suit { @ApiModelProperty("设备ID") private Long deviceId; + @ApiModelProperty("手机号或用户名") + private String mobileOrUserName; } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/suit/domain/SuitVO.java b/smart-switch-service/src/main/java/com/ruoyi/ss/suit/domain/SuitVO.java index 19033a62..4fd8140f 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/suit/domain/SuitVO.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/suit/domain/SuitVO.java @@ -23,4 +23,7 @@ public class SuitVO extends Suit { @ApiModelProperty("应用的设备列表") @JsonView(JsonViewProfile.AppMch.class) private List deviceList; + + @ApiModelProperty("手机号或用户名") + private String mobileOrUserName; } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/suit/mapper/SuitMapper.xml b/smart-switch-service/src/main/java/com/ruoyi/ss/suit/mapper/SuitMapper.xml index 45307278..bb4ac0fc 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/suit/mapper/SuitMapper.xml +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/suit/mapper/SuitMapper.xml @@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ss.low_power, ss.enabled_voice, ss.voice_minutes, + if(su.phonenumber is not null, su.phonenumber, su.user_name) as mobile_or_user_name, su.user_name as user_name from @@ -47,6 +48,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and ss.suit_id = #{suitId} and ss.name like concat('%', #{name}, '%') + + and if(su.phonenumber is not null, su.phonenumber, su.user_name) like concat('%', #{mobileOrUserName}, '%') + and ss.`value` = #{value} and ss.price = #{price} and ss.description = #{description}