新增根据厂商查询设备信息

This commit is contained in:
chenlinghy 2023-08-31 19:43:24 +08:00
parent 7e065298fd
commit 0df845132d
6 changed files with 23 additions and 4 deletions

View File

@ -92,9 +92,9 @@ public class DeviceDO {
*/ */
private Integer type; private Integer type;
/** /**
* 警报器厂商 * 警报器厂商 1:圆融科技 2:欧丽 3:厚华
*/ */
private String manufacturer; private Integer manufacturer;
/** /**
* 警报器功率 * 警报器功率
*/ */

View File

@ -18,4 +18,6 @@ public class DeviceByLocationDTO {
private Integer countyCode; private Integer countyCode;
private String deviceName; private String deviceName;
private Integer manufacturer;
} }

View File

@ -36,5 +36,11 @@ public class DeviceReqDTO {
@Schema(title = "省份代码", example = "1", description = "该值为null查询所有省份") @Schema(title = "省份代码", example = "1", description = "该值为null查询所有省份")
private Integer provinceCode; private Integer provinceCode;
/**
* 警报器厂商 1:圆融科技 2:欧丽 3:厚华
*/
@Schema(title = "警报器厂商", example = "1", description = "警报器厂商 1:圆融科技 2:欧丽 3:厚华")
private Integer manufacturer;
} }

View File

@ -69,6 +69,12 @@ public class DeviceRespDTO {
@Schema(title = "是否告警中", example = "false", description = "false为非告警中true为告警中") @Schema(title = "是否告警中", example = "false", description = "false为非告警中true为告警中")
private Boolean isAlarming; private Boolean isAlarming;
/**
* 警报器厂商 1:圆融科技 2:欧丽 3:厚华
*/
@Schema(title = "警报器厂商", example = "1", description = "警报器厂商 1:圆融科技 2:欧丽 3:厚华")
private Integer manufacturer;
public static DeviceRespDTO fromDO(DeviceDO deviceDO) { public static DeviceRespDTO fromDO(DeviceDO deviceDO) {
DeviceRespDTO resp = new DeviceRespDTO(); DeviceRespDTO resp = new DeviceRespDTO();
resp.setDeviceId(deviceDO.getDeviceId()); resp.setDeviceId(deviceDO.getDeviceId());
@ -80,6 +86,7 @@ public class DeviceRespDTO {
resp.setLongitude(deviceDO.getLongitude()); resp.setLongitude(deviceDO.getLongitude());
resp.setInstallSite(deviceDO.getInstallSite()); resp.setInstallSite(deviceDO.getInstallSite());
resp.setIsAlarming(DeviceAlarmStatusEnum.ALARMING.getCode().equals(deviceDO.getAlarmStatus())); resp.setIsAlarming(DeviceAlarmStatusEnum.ALARMING.getCode().equals(deviceDO.getAlarmStatus()));
resp.setManufacturer(deviceDO.getManufacturer());
return resp; return resp;
} }

View File

@ -40,7 +40,8 @@ public class DeviceServiceImpl implements DeviceService {
.provinceCode(deviceReqDTO.getProvinceCode()) .provinceCode(deviceReqDTO.getProvinceCode())
.cityCode(deviceReqDTO.getCityCode()) .cityCode(deviceReqDTO.getCityCode())
.countyCode(deviceReqDTO.getCountyCode()) .countyCode(deviceReqDTO.getCountyCode())
.deviceName(deviceReqDTO.getDeviceName()).build(); .deviceName(deviceReqDTO.getDeviceName())
.manufacturer(deviceReqDTO.getManufacturer()).build();
log.info("device search info : [{}]", searchDTO); log.info("device search info : [{}]", searchDTO);
List<DeviceDO> deviceDOList = deviceMapper.selectDeviceByLoc(searchDTO); List<DeviceDO> deviceDOList = deviceMapper.selectDeviceByLoc(searchDTO);

View File

@ -20,7 +20,7 @@
<result property="state" column="state" jdbcType="INTEGER"/> <result property="state" column="state" jdbcType="INTEGER"/>
<result property="model" column="model" jdbcType="VARCHAR"/> <result property="model" column="model" jdbcType="VARCHAR"/>
<result property="type" column="type" jdbcType="INTEGER"/> <result property="type" column="type" jdbcType="INTEGER"/>
<result property="manufacturer" column="manufacturer" jdbcType="VARCHAR"/> <result property="manufacturer" column="manufacturer" jdbcType="INTEGER"/>
<result property="power" column="power" jdbcType="INTEGER"/> <result property="power" column="power" jdbcType="INTEGER"/>
<result property="alarmStatus" column="alarm_status" jdbcType="INTEGER"/> <result property="alarmStatus" column="alarm_status" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
@ -44,6 +44,9 @@
<if test="deviceName != null and deviceName != ''"> <if test="deviceName != null and deviceName != ''">
and device_name like CONCAT('%', #{deviceName}, '%') and device_name like CONCAT('%', #{deviceName}, '%')
</if> </if>
<if test="manufacturer != null and manufacturer != ''">
and manufacturer = #{manufacturer}
</if>
</where> </where>
</select> </select>