APP用户设备类型列表
This commit is contained in:
@ -19,6 +19,15 @@ import java.util.List;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface APPDeviceMapper extends BaseMapper<APPDevice> {
|
public interface APPDeviceMapper extends BaseMapper<APPDevice> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APP用户设备列表
|
||||||
|
*
|
||||||
|
* @param page
|
||||||
|
* @param criteria
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<APPDevice> appDeviceList(Page<APPDevice> page,@Param("criteria") DeviceQueryCriteria criteria);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询APP/小程序设备
|
* 分页查询APP/小程序设备
|
||||||
@ -29,4 +38,5 @@ public interface APPDeviceMapper extends BaseMapper<APPDevice> {
|
|||||||
*/
|
*/
|
||||||
IPage<APPDevice> queryAll(Page<APPDevice> page, @Param("criteria") DeviceQueryCriteria criteria);
|
IPage<APPDevice> queryAll(Page<APPDevice> page, @Param("criteria") DeviceQueryCriteria criteria);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,11 @@ package com.fuyuanshen.modules.system.mapper.app;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.fuyuanshen.modules.system.domain.app.APPDeviceType;
|
import com.fuyuanshen.modules.system.domain.app.APPDeviceType;
|
||||||
|
import com.fuyuanshen.modules.system.domain.dto.DeviceQueryCriteria;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 97433
|
* @author 97433
|
||||||
* @description 针对表【app_device_type(设备类型表)】的数据库操作Mapper
|
* @description 针对表【app_device_type(设备类型表)】的数据库操作Mapper
|
||||||
@ -14,5 +17,12 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface AppDeviceTypeMapper extends BaseMapper<APPDeviceType> {
|
public interface AppDeviceTypeMapper extends BaseMapper<APPDeviceType> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备类型列表
|
||||||
|
*
|
||||||
|
* @param criteria 查询条件
|
||||||
|
* @return 设备类型列表
|
||||||
|
*/
|
||||||
|
List<APPDeviceType> appTypeList(DeviceQueryCriteria criteria);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import com.fuyuanshen.modules.system.constant.UserConstants;
|
|||||||
import com.fuyuanshen.modules.system.domain.Device;
|
import com.fuyuanshen.modules.system.domain.Device;
|
||||||
import com.fuyuanshen.modules.system.domain.User;
|
import com.fuyuanshen.modules.system.domain.User;
|
||||||
import com.fuyuanshen.modules.system.domain.app.APPDevice;
|
import com.fuyuanshen.modules.system.domain.app.APPDevice;
|
||||||
|
import com.fuyuanshen.modules.system.domain.app.APPDeviceType;
|
||||||
import com.fuyuanshen.modules.system.domain.dto.CustomerVo;
|
import com.fuyuanshen.modules.system.domain.dto.CustomerVo;
|
||||||
import com.fuyuanshen.modules.system.domain.dto.DeviceExcelImportDTO;
|
import com.fuyuanshen.modules.system.domain.dto.DeviceExcelImportDTO;
|
||||||
import com.fuyuanshen.modules.system.domain.dto.DeviceForm;
|
import com.fuyuanshen.modules.system.domain.dto.DeviceForm;
|
||||||
@ -67,6 +68,29 @@ public class APPDeviceController {
|
|||||||
private final APPDeviceService appDeviceService;
|
private final APPDeviceService appDeviceService;
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(value = "/list")
|
||||||
|
@ApiOperation("APP用户设备列表")
|
||||||
|
public ResponseVO<PageResult<APPDevice>> appDeviceList(@RequestBody DeviceQueryCriteria criteria) {
|
||||||
|
Page<APPDevice> page = new Page<>(criteria.getPage(), criteria.getSize());
|
||||||
|
PageResult<APPDevice> devices = null;
|
||||||
|
try {
|
||||||
|
devices = appDeviceService.appDeviceList(page, criteria);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("queryDevice error: " + e.getMessage());
|
||||||
|
return ResponseVO.fail("");
|
||||||
|
}
|
||||||
|
return ResponseVO.success(devices);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping(value = "/typeList")
|
||||||
|
@ApiOperation("APP用户设备类型列表")
|
||||||
|
public ResponseVO<List<APPDeviceType>> appTypeList(@RequestBody DeviceQueryCriteria criteria) {
|
||||||
|
List<APPDeviceType> typeList = appDeviceService.appTypeList(criteria);
|
||||||
|
return ResponseVO.success(typeList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping(value = "/bind")
|
@PostMapping(value = "/bind")
|
||||||
@ApiOperation("APP用户设备绑定")
|
@ApiOperation("APP用户设备绑定")
|
||||||
public ResponseVO<String> appBindDevice(@RequestBody DeviceQueryCriteria criteria) {
|
public ResponseVO<String> appBindDevice(@RequestBody DeviceQueryCriteria criteria) {
|
||||||
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.fuyuanshen.modules.system.domain.Device;
|
import com.fuyuanshen.modules.system.domain.Device;
|
||||||
import com.fuyuanshen.modules.system.domain.app.APPDevice;
|
import com.fuyuanshen.modules.system.domain.app.APPDevice;
|
||||||
|
import com.fuyuanshen.modules.system.domain.app.APPDeviceType;
|
||||||
import com.fuyuanshen.modules.system.domain.dto.CustomerVo;
|
import com.fuyuanshen.modules.system.domain.dto.CustomerVo;
|
||||||
import com.fuyuanshen.modules.system.domain.dto.DeviceForm;
|
import com.fuyuanshen.modules.system.domain.dto.DeviceForm;
|
||||||
import com.fuyuanshen.modules.system.domain.dto.DeviceQueryCriteria;
|
import com.fuyuanshen.modules.system.domain.dto.DeviceQueryCriteria;
|
||||||
@ -22,6 +23,22 @@ import java.util.List;
|
|||||||
**/
|
**/
|
||||||
public interface APPDeviceService extends IService<APPDevice> {
|
public interface APPDeviceService extends IService<APPDevice> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APP用户设备列表
|
||||||
|
*
|
||||||
|
* @param criteria
|
||||||
|
*/
|
||||||
|
PageResult<APPDevice> appDeviceList(Page<APPDevice> page, DeviceQueryCriteria criteria);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APP用户设备类型列表
|
||||||
|
*
|
||||||
|
* @param criteria
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<APPDeviceType> appTypeList(DeviceQueryCriteria criteria);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APP/小程序用户设备绑定
|
* APP/小程序用户设备绑定
|
||||||
*
|
*
|
||||||
@ -29,7 +46,6 @@ public interface APPDeviceService extends IService<APPDevice> {
|
|||||||
*/
|
*/
|
||||||
void appBindDevice(DeviceQueryCriteria criteria);
|
void appBindDevice(DeviceQueryCriteria criteria);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询APP/小程序设备绑定
|
* 分页查询APP/小程序设备绑定
|
||||||
*
|
*
|
||||||
|
@ -49,6 +49,29 @@ public class APPDeviceServiceImpl extends ServiceImpl<APPDeviceMapper, APPDevice
|
|||||||
private final AppDeviceTypeMapper appDeviceTypeMapper;
|
private final AppDeviceTypeMapper appDeviceTypeMapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APP用户设备列表
|
||||||
|
*
|
||||||
|
* @param criteria
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PageResult<APPDevice> appDeviceList(Page<APPDevice> page, DeviceQueryCriteria criteria) {
|
||||||
|
IPage<APPDevice> devices = appDeviceMapper.appDeviceList(page, criteria);
|
||||||
|
return new PageResult<>(devices.getRecords(), devices.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APP用户设备类型列表
|
||||||
|
*
|
||||||
|
* @param criteria
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<APPDeviceType> appTypeList(DeviceQueryCriteria criteria) {
|
||||||
|
return appDeviceTypeMapper.appTypeList(criteria);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APP/小程序用户设备绑定
|
* APP/小程序用户设备绑定
|
||||||
*
|
*
|
||||||
|
@ -19,6 +19,40 @@
|
|||||||
<result column="binding_status" property="bindingStatus"/>
|
<result column="binding_status" property="bindingStatus"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- APP用户设备列表 -->
|
||||||
|
<select id="appDeviceList" resultType="com.fuyuanshen.modules.system.domain.app.APPDevice">
|
||||||
|
select d.* from app_device as d
|
||||||
|
<where>
|
||||||
|
<!-- 时间范围等其他条件保持原样 -->
|
||||||
|
<if test="criteria.deviceName != null and criteria.deviceName.trim() != ''">
|
||||||
|
and d.device_name like concat('%', TRIM(#{criteria.deviceName}), '%')
|
||||||
|
</if>
|
||||||
|
<if test="criteria.deviceMac != null and criteria.deviceMac.trim() != ''">
|
||||||
|
and d.device_mac = #{criteria.deviceMac}
|
||||||
|
</if>
|
||||||
|
<if test="criteria.deviceImei != null and criteria.deviceImei.trim() != ''">
|
||||||
|
and d.device_imei = #{criteria.deviceImei}
|
||||||
|
</if>
|
||||||
|
<if test="criteria.deviceSn != null">
|
||||||
|
and d.device_sn = #{criteria.deviceSn}
|
||||||
|
</if>
|
||||||
|
<if test="criteria.deviceType != null">
|
||||||
|
and d.device_type = #{criteria.deviceType}
|
||||||
|
</if>
|
||||||
|
<if test="criteria.deviceStatus != null">
|
||||||
|
and d.device_status = #{criteria.deviceStatus}
|
||||||
|
</if>
|
||||||
|
<if test="criteria.createTime != null and criteria.createTime.size() != 0">
|
||||||
|
and d.create_time between #{criteria.createTime[0]} and #{criteria.createTime[1]}
|
||||||
|
</if>
|
||||||
|
<if test="criteria.tenantId != null">
|
||||||
|
AND tenant_id = #{criteria.tenantId}
|
||||||
|
</if>
|
||||||
|
and d.customer_id = #{criteria.customerId}
|
||||||
|
</where>
|
||||||
|
order by d.create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
<!-- 分页查询APP/小程序设备 -->
|
<!-- 分页查询APP/小程序设备 -->
|
||||||
<select id="queryAll" resultType="com.fuyuanshen.modules.system.domain.app.APPDevice">
|
<select id="queryAll" resultType="com.fuyuanshen.modules.system.domain.app.APPDevice">
|
||||||
select d.* from app_device as d
|
select d.* from app_device as d
|
||||||
@ -45,7 +79,6 @@
|
|||||||
<if test="criteria.createTime != null and criteria.createTime.size() != 0">
|
<if test="criteria.createTime != null and criteria.createTime.size() != 0">
|
||||||
and d.create_time between #{criteria.createTime[0]} and #{criteria.createTime[1]}
|
and d.create_time between #{criteria.createTime[0]} and #{criteria.createTime[1]}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="criteria.tenantId != null">
|
<if test="criteria.tenantId != null">
|
||||||
AND tenant_id = #{criteria.tenantId}
|
AND tenant_id = #{criteria.tenantId}
|
||||||
</if>
|
</if>
|
||||||
@ -54,4 +87,5 @@
|
|||||||
order by d.create_time desc
|
order by d.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -22,4 +22,38 @@
|
|||||||
id,type_name,is_support_ble,locate_mode,network_way,create_by,
|
id,type_name,is_support_ble,locate_mode,network_way,create_by,
|
||||||
update_by,create_time,update_time,customer_id,communication_mode
|
update_by,create_time,update_time,customer_id,communication_mode
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<!-- 查询设备类型列表 -->
|
||||||
|
<select id="appTypeList" resultType="com.fuyuanshen.modules.system.domain.app.APPDeviceType">
|
||||||
|
select d.* from app_device_type as d
|
||||||
|
<where>
|
||||||
|
<!-- 时间范围等其他条件保持原样 -->
|
||||||
|
<if test="criteria.deviceName != null and criteria.deviceName.trim() != ''">
|
||||||
|
and d.device_name like concat('%', TRIM(#{criteria.deviceName}), '%')
|
||||||
|
</if>
|
||||||
|
<if test="criteria.deviceMac != null and criteria.deviceMac.trim() != ''">
|
||||||
|
and d.device_mac = #{criteria.deviceMac}
|
||||||
|
</if>
|
||||||
|
<if test="criteria.deviceImei != null and criteria.deviceImei.trim() != ''">
|
||||||
|
and d.device_imei = #{criteria.deviceImei}
|
||||||
|
</if>
|
||||||
|
<if test="criteria.deviceSn != null">
|
||||||
|
and d.device_sn = #{criteria.deviceSn}
|
||||||
|
</if>
|
||||||
|
<if test="criteria.deviceType != null">
|
||||||
|
and d.device_type = #{criteria.deviceType}
|
||||||
|
</if>
|
||||||
|
<if test="criteria.deviceStatus != null">
|
||||||
|
and d.device_status = #{criteria.deviceStatus}
|
||||||
|
</if>
|
||||||
|
<if test="criteria.createTime != null and criteria.createTime.size() != 0">
|
||||||
|
and d.create_time between #{criteria.createTime[0]} and #{criteria.createTime[1]}
|
||||||
|
</if>
|
||||||
|
<if test="criteria.tenantId != null">
|
||||||
|
AND tenant_id = #{criteria.tenantId}
|
||||||
|
</if>
|
||||||
|
and d.customer_id = #{criteria.customerId}
|
||||||
|
</where>
|
||||||
|
order by d.create_time desc
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Reference in New Issue
Block a user