APP用户设备类型列表
This commit is contained in:
@ -19,6 +19,15 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface APPDeviceMapper extends BaseMapper<APPDevice> {
|
||||
|
||||
/**
|
||||
* APP用户设备列表
|
||||
*
|
||||
* @param page
|
||||
* @param criteria
|
||||
* @return
|
||||
*/
|
||||
IPage<APPDevice> appDeviceList(Page<APPDevice> page,@Param("criteria") DeviceQueryCriteria criteria);
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询APP/小程序设备
|
||||
@ -27,6 +36,7 @@ public interface APPDeviceMapper extends BaseMapper<APPDevice> {
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
IPage<APPDevice> queryAll(Page<APPDevice> page, @Param("criteria")DeviceQueryCriteria criteria );
|
||||
IPage<APPDevice> queryAll(Page<APPDevice> page, @Param("criteria") DeviceQueryCriteria criteria);
|
||||
|
||||
|
||||
}
|
||||
|
@ -3,16 +3,26 @@ package com.fuyuanshen.modules.system.mapper.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fuyuanshen.modules.system.domain.app.APPDeviceType;
|
||||
import com.fuyuanshen.modules.system.domain.dto.DeviceQueryCriteria;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 97433
|
||||
* @description 针对表【app_device_type(设备类型表)】的数据库操作Mapper
|
||||
* @createDate 2025-06-24 11:16:18
|
||||
* @Entity system.domain.AppDeviceType
|
||||
*/
|
||||
* @author 97433
|
||||
* @description 针对表【app_device_type(设备类型表)】的数据库操作Mapper
|
||||
* @createDate 2025-06-24 11:16:18
|
||||
* @Entity system.domain.AppDeviceType
|
||||
*/
|
||||
@Mapper
|
||||
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.User;
|
||||
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.DeviceExcelImportDTO;
|
||||
import com.fuyuanshen.modules.system.domain.dto.DeviceForm;
|
||||
@ -67,9 +68,32 @@ public class APPDeviceController {
|
||||
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")
|
||||
@ApiOperation("APP用户设备绑定")
|
||||
public ResponseVO<String> appBindDevice( @RequestBody DeviceQueryCriteria criteria) {
|
||||
public ResponseVO<String> appBindDevice(@RequestBody DeviceQueryCriteria criteria) {
|
||||
appDeviceService.appBindDevice(criteria);
|
||||
return ResponseVO.success("绑定成功!");
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuyuanshen.modules.system.domain.Device;
|
||||
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.DeviceForm;
|
||||
import com.fuyuanshen.modules.system.domain.dto.DeviceQueryCriteria;
|
||||
@ -22,6 +23,22 @@ import java.util.List;
|
||||
**/
|
||||
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/小程序用户设备绑定
|
||||
*
|
||||
@ -29,7 +46,6 @@ public interface APPDeviceService extends IService<APPDevice> {
|
||||
*/
|
||||
void appBindDevice(DeviceQueryCriteria criteria);
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询APP/小程序设备绑定
|
||||
*
|
||||
|
@ -49,6 +49,29 @@ public class APPDeviceServiceImpl extends ServiceImpl<APPDeviceMapper, APPDevice
|
||||
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/小程序用户设备绑定
|
||||
*
|
||||
|
@ -19,6 +19,40 @@
|
||||
<result column="binding_status" property="bindingStatus"/>
|
||||
</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/小程序设备 -->
|
||||
<select id="queryAll" resultType="com.fuyuanshen.modules.system.domain.app.APPDevice">
|
||||
select d.* from app_device as d
|
||||
@ -45,7 +79,6 @@
|
||||
<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>
|
||||
@ -54,4 +87,5 @@
|
||||
order by d.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
@ -5,21 +5,55 @@
|
||||
<mapper namespace="com.fuyuanshen.modules.system.mapper.app.AppDeviceTypeMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.fuyuanshen.modules.system.domain.app.APPDeviceType">
|
||||
<id property="id" column="id" />
|
||||
<result property="typeName" column="type_name" />
|
||||
<result property="isSupportBle" column="is_support_ble" />
|
||||
<result property="locateMode" column="locate_mode" />
|
||||
<result property="networkWay" column="network_way" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="customerId" column="customer_id" />
|
||||
<result property="communicationMode" column="communication_mode" />
|
||||
<id property="id" column="id"/>
|
||||
<result property="typeName" column="type_name"/>
|
||||
<result property="isSupportBle" column="is_support_ble"/>
|
||||
<result property="locateMode" column="locate_mode"/>
|
||||
<result property="networkWay" column="network_way"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="customerId" column="customer_id"/>
|
||||
<result property="communicationMode" column="communication_mode"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,type_name,is_support_ble,locate_mode,network_way,create_by,
|
||||
update_by,create_time,update_time,customer_id,communication_mode
|
||||
</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>
|
||||
|
Reference in New Issue
Block a user