Selaa lähdekoodia

增加关键词搜索

hechunping 1 vuosi sitten
vanhempi
commit
f2a351c45b

+ 3 - 0
device-api-service/src/main/resources/mapper/DeviceInfoMapper.xml

@@ -258,6 +258,9 @@
                 </otherwise>
             </choose>
         </if>
+        <if test="queryPage.keyword != null and queryPage.keyword != ''">
+            and CONCAT(IFNULL(info.device_name, ''), IFNULL(info.device_id, '')) LIKE CONCAT('%',#{keyword},'%')
+        </if>
         <if test="queryPage.showStatus != null">
             and info.show_status = #{queryPage.showStatus}
         </if>

+ 3 - 0
device-api/src/main/java/com/xy/dto/DeviceInfoDto.java

@@ -395,6 +395,9 @@ public class DeviceInfoDto {
         @ApiModelProperty("缺货状态")
         private Integer stockStatus;
 
+        @ApiModelProperty("搜索词")
+        private String keyword;
+
         /**
          * 设备ID
          */