APP用户设备类型列表

This commit is contained in:
2025-06-25 13:28:27 +08:00
parent ec03919c78
commit 6a6adc5ec1
6 changed files with 9 additions and 30 deletions

View File

@ -38,4 +38,5 @@ public interface GenConfigService extends IService<GenConfig> {
* @return 表配置
*/
GenConfig update(String tableName, GenConfig genConfig);
}

View File

@ -4,7 +4,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;

View File

@ -5,6 +5,7 @@ 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 org.apache.ibatis.annotations.Param;
import java.util.List;
@ -23,6 +24,6 @@ public interface AppDeviceTypeMapper extends BaseMapper<APPDeviceType> {
* @param criteria 查询条件
* @return 设备类型列表
*/
List<APPDeviceType> appTypeList(DeviceQueryCriteria criteria);
List<APPDeviceType> appTypeList(@Param("criteria")DeviceQueryCriteria criteria);
}

View File

@ -86,7 +86,7 @@ public class APPDeviceController {
@PostMapping(value = "/typeList")
@ApiOperation("APP用户设备类型列表")
public ResponseVO<List<APPDeviceType>> appTypeList(@RequestBody DeviceQueryCriteria criteria) {
List<APPDeviceType> typeList = appDeviceService.appTypeList(criteria);
List<APPDeviceType> typeList = appDeviceService.appTypeList(criteria);
return ResponseVO.success(typeList);
}

View File

@ -68,7 +68,8 @@ public class APPDeviceServiceImpl extends ServiceImpl<APPDeviceMapper, APPDevice
*/
@Override
public List<APPDeviceType> appTypeList(DeviceQueryCriteria criteria) {
return appDeviceTypeMapper.appTypeList(criteria);
criteria.setCustomerId(SecurityUtils.getCurrentUserId());
return appDeviceTypeMapper.appTypeList(criteria);
}
@ -124,6 +125,7 @@ public class APPDeviceServiceImpl extends ServiceImpl<APPDeviceMapper, APPDevice
DeviceType deviceType = deviceTypeMapper.selectById(device.getDeviceType());
APPDeviceType type = new APPDeviceType();
BeanUtil.copyProperties(deviceType, type);
type.setCustomerId(currentUserId);
appDeviceTypeMapper.insert(type);
}

View File

@ -19,7 +19,8 @@
</resultMap>
<sql id="Base_Column_List">
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
</sql>
@ -27,31 +28,6 @@
<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