Commit f1d2b985 by hayden

后台管理系统设备管理-设备网关信息:新增筛选条件门店

parent 8320a55c
......@@ -18,6 +18,7 @@ import share.common.core.domain.AjaxResult;
import share.common.enums.BusinessType;
import share.common.utils.SecurityUtils;
import share.system.domain.DeviceGateway;
import share.system.domain.DeviceGatewayDto;
import share.system.service.DeviceGatewayService;
import share.common.utils.poi.ExcelUtil;
import share.common.core.page.TableDataInfo;
......@@ -43,10 +44,10 @@ public class DeviceGatewayController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('system:gateway:list')")
@GetMapping("/list")
public TableDataInfo list(DeviceGateway deviceGateway)
public TableDataInfo list(DeviceGatewayDto deviceGatewayDto)
{
startPage();
List<DeviceGateway> list = deviceGatewayService.selectDeviceGatewayList(deviceGateway);
List<DeviceGateway> list = deviceGatewayService.selectDeviceGatewayList(deviceGatewayDto);
return getDataTable(list);
}
......@@ -56,10 +57,10 @@ public class DeviceGatewayController extends BaseController
@PreAuthorize("@ss.hasPermi('system:gateway:export')")
@Log(title = "设备网关信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DeviceGateway deviceGateway)
public void export(HttpServletResponse response, DeviceGatewayDto deviceGateway)
{
List<DeviceGateway> list = deviceGatewayService.selectDeviceGatewayList(deviceGateway);
ExcelUtil<DeviceGateway> util = new ExcelUtil<DeviceGateway>(DeviceGateway.class);
ExcelUtil<DeviceGateway> util = new ExcelUtil<>(DeviceGateway.class);
util.exportExcel(response, list, "设备网关信息数据");
}
......
package share.system.domain;
import lombok.Data;
/**
* @author lichenghu
* @date 2024/1/25
*/
@Data
public class DeviceGatewayDto extends DeviceGateway {
/**
* 门店id
*/
private String storeId;
}
......@@ -36,21 +36,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectDeviceGatewayList" parameterType="DeviceGateway" resultMap="DeviceGatewayResult">
<include refid="selectDeviceGatewayVo"/>
<where>
<if test="devName != null and devName != ''"> and dev_name like concat('%', #{devName}, '%')</if>
<if test="devMac != null and devMac != ''"> and dev_mac = #{devMac}</if>
<if test="devId != null and devId != ''"> and dev_id = #{devId}</if>
<if test="devPsw != null and devPsw != ''"> and dev_psw = #{devPsw}</if>
<if test="devVer != null and devVer != ''"> and dev_ver = #{devVer}</if>
<if test="devType != null and devType != ''"> and dev_type = #{devType}</if>
<if test="group != null and group != ''"> and `group` = #{group}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="mqttIp != null and mqttIp != ''"> and mqtt_iP = #{mqttIp}</if>
<if test="mqttPort != null and mqttPort != ''"> and mqtt_port = #{mqttPort}</if>
<if test="mqttUser != null and mqttUser != ''"> and mqtt_user = #{mqttUser}</if>
<if test="mqttPaswd != null and mqttPaswd != ''"> and mqtt_paswd = #{mqttPaswd}</if>
<if test="devPosition != null and devPosition != ''"> and dev_position = #{devPosition}</if>
select
t1.id,
t1.dev_name,
t1.dev_mac,
t1.dev_id,
t1.dev_psw,
t1.dev_ver,
t1.dev_type,
t1.`group`,
t1.status,
t1.mqtt_iP,
t1.mqtt_port,
t1.mqtt_user,
t1.mqtt_paswd,
t1.create_by,
t1.create_time,
t1.update_by,
t1.update_time,
t1.remark,
t1.dev_position,
t1.last_report_date,
t1.last_report_content
from s_device_gateway t1
left join s_store t2 on t1.group = t2.device_group
<where>
<if test="devName != null and devName != ''">and t1.dev_name like concat('%', #{devName}, '%')</if>
<if test="devMac != null and devMac != ''">and t1.dev_mac = #{devMac}</if>
<if test="devId != null and devId != ''">and t1.dev_id = #{devId}</if>
<if test="devPsw != null and devPsw != ''">and t1.dev_psw = #{devPsw}</if>
<if test="devVer != null and devVer != ''">and t1.dev_ver = #{devVer}</if>
<if test="devType != null and devType != ''">and t1.dev_type = #{devType}</if>
<if test="group != null and group != ''">and `groupt1.` = #{group}</if>
<if test="status != null and status != ''">and t1.status = #{status}</if>
<if test="mqttIp != null and mqttIp != ''">and t1.mqtt_iP = #{mqttIp}</if>
<if test="mqttPort != null and mqttPort != ''">and t1.mqtt_port = #{mqttPort}</if>
<if test="mqttUser != null and mqttUser != ''">and t1.mqtt_user = #{mqttUser}</if>
<if test="mqttPaswd != null and mqttPaswd != ''">and t1.mqtt_paswd = #{mqttPaswd}</if>
<if test="devPosition != null and devPosition != ''">and t1.dev_position = #{devPosition}</if>
<if test="storeId != null">and t2.id = #{storeId}</if>
</where>
</select>
......
......@@ -58,8 +58,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t1.signal_value,
t1.room_id
from s_device t1
join s_room t2 on t1.room_id = t2.id
join s_store t3 on t2.store_id = t3.id
left join s_room t2 on t1.room_id = t2.id
left join s_store t3 on t2.store_id = t3.id
<where>
<if test="devName != null and devName != ''">and t1.dev_name like concat('%', #{devName}, '%')</if>
<if test="devMac != null and devMac != ''">and t1.dev_mac = #{devMac}</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment