10 changed files with 3033 additions and 0 deletions
@ -0,0 +1,94 @@
@@ -0,0 +1,94 @@
|
||||
package com.ecell.internationalize.system.constant; |
||||
|
||||
public class DeviceModelConstants { |
||||
public static final String ZERO ="0"; |
||||
public static final String ONE ="1"; |
||||
public static final String TWO ="2"; |
||||
public static final String THREE ="3"; |
||||
public static final String FOUR ="4"; |
||||
public static final String TWO_ZERO ="20000"; |
||||
public static final String JU_FENG ="菊风"; |
||||
public static final String SHENG_WANG ="声网"; |
||||
public static final String BAI_RUI ="佰锐"; |
||||
public static final String TI_HU ="鹈鹕"; |
||||
public static final String VIDEO_CALL="视频通话规则"; |
||||
public static final String DEFAULT_CONFIG="(默认配置)"; |
||||
public static final String WATCH_ALARM_CLOCK="手表闹钟"; |
||||
public static final String CLASS_DISABLE="上课禁用"; |
||||
public static final String SOS_PHONE="sos号码"; |
||||
public static final String ELECTRONIC_FENCE="电子围栏"; |
||||
public static final String STEP_RECORDER="计步"; |
||||
public static final String CHAT_FUN="微聊"; |
||||
public static final String LOOKUP_FUN="查找设备"; |
||||
public static final String WATCH_WIFF="手表WIFI"; |
||||
public static final String HEART_RATE="心率"; |
||||
public static final String TEMPERATURE="体温"; |
||||
public static final String BLOOD_PRESSURE="血压"; |
||||
public static final String BLOOD_OXYGEN="血氧"; |
||||
public static final String WHITE_LIST="白名单"; |
||||
public static final String DIAL="拨号盘"; |
||||
public static final String TIMING_SWITCH="定时开关机"; |
||||
public static final String TELECOM="电信"; |
||||
|
||||
public static final String MINUTE="分钟"; |
||||
|
||||
public static final String USER_NAME="admin"; |
||||
|
||||
public static final String DELLETE_MODE_ZERO ="根据imei批量删除"; |
||||
public static final String DELLETE_MODE_ONE ="根据IMEI导入删除"; |
||||
|
||||
public static final String UNBING_MODE_ZERO ="根据imei单个解绑"; |
||||
public static final String UNBING_MODE_ONE ="根据IMEI批量解绑"; |
||||
|
||||
/** 校验返回结果码 */ |
||||
public final static String UNIQUE = "0"; |
||||
|
||||
public final static String NOT_UNIQUE = "1"; |
||||
|
||||
|
||||
/** |
||||
* 用户ID字段 |
||||
*/ |
||||
public static final String DETAILS_USER_ID = "user_id"; |
||||
|
||||
/** |
||||
* 用户名字段 |
||||
*/ |
||||
public static final String DETAILS_USERNAME = "username"; |
||||
|
||||
/** |
||||
* 授权信息字段 |
||||
*/ |
||||
public static final String AUTHORIZATION_HEADER = "authorization"; |
||||
|
||||
/** |
||||
* 请求来源 |
||||
*/ |
||||
public static final String FROM_SOURCE = "from-source"; |
||||
|
||||
/** |
||||
* 内部请求 |
||||
*/ |
||||
public static final String INNER = "inner"; |
||||
|
||||
/** |
||||
* 用户标识 |
||||
*/ |
||||
public static final String USER_KEY = "user_key"; |
||||
|
||||
/** |
||||
* 登录用户 |
||||
*/ |
||||
public static final String LOGIN_USER = "login_user"; |
||||
|
||||
public static final int NUMBER_ZERO =0; |
||||
public static final int NUMBER_ONE =1; |
||||
|
||||
/** redis key*/ |
||||
public static final String AGENT="agent"; |
||||
public static final String V="v"; |
||||
|
||||
/**TCP-TOPIC*/ |
||||
public static final String WATCHPUSH_KAFKA="jianyou_tongxin_WatchPUSH_Kafka"; |
||||
|
||||
} |
@ -0,0 +1,377 @@
@@ -0,0 +1,377 @@
|
||||
package com.ecell.internationalize.system.controller; |
||||
import com.ecell.internationalize.common.core.context.SecurityContextHolder; |
||||
import com.ecell.internationalize.common.core.exception.ServiceException; |
||||
import com.ecell.internationalize.common.core.utils.StringUtils; |
||||
import com.ecell.internationalize.common.core.utils.locale.LocaleUtil; |
||||
import com.ecell.internationalize.common.core.utils.poi.ExcelUtil; |
||||
import com.ecell.internationalize.common.core.web.domain.AjaxResult; |
||||
import com.ecell.internationalize.common.security.annotation.RequiresPermissions; |
||||
import com.ecell.internationalize.common.security.utils.SecurityUtils; |
||||
import com.ecell.internationalize.common.system.constant.FieldConstant; |
||||
import com.ecell.internationalize.system.annotation.DelImeiLog; |
||||
import com.ecell.internationalize.system.annotation.FactoryLog; |
||||
import com.ecell.internationalize.system.annotation.InputLog; |
||||
import com.ecell.internationalize.system.constant.DeviceModelConstants; |
||||
import com.ecell.internationalize.system.entity.DeviceInfo; |
||||
import com.ecell.internationalize.system.entity.dto.*; |
||||
import com.ecell.internationalize.system.service.DeviceInfoService; |
||||
import io.swagger.annotations.Api; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
|
||||
|
||||
/** |
||||
* <p> |
||||
* 设备信息表 前端控制器 |
||||
* </p> |
||||
* |
||||
* @author ${author} |
||||
* @since 2022-07-10 |
||||
*/ |
||||
@Api(value="设备管理",tags={"设备管理接口"}) |
||||
@RestController |
||||
@RequestMapping("/device-info") |
||||
public class DeviceInfoController { |
||||
@Autowired |
||||
private DeviceInfoService deviceInfoService; |
||||
|
||||
/** |
||||
* 设备单个录入 |
||||
* @return |
||||
*/ |
||||
@InputLog(inputType = DeviceModelConstants.ZERO) //如果是单个录入
|
||||
@PostMapping("/input/imei") |
||||
public AjaxResult singleEntry(@RequestBody DeviceDTO dto){ |
||||
return deviceInfoService.singleEntry(dto) ? AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS)) : AjaxResult.error(LocaleUtil.getMessage(FieldConstant.MESSAGES_ERROR)); |
||||
} |
||||
|
||||
/** |
||||
* 设备批量录入 |
||||
* @return |
||||
*/ |
||||
@InputLog(inputType = DeviceModelConstants.ONE) //如果是批量录入
|
||||
@PostMapping("/import/imei") |
||||
public AjaxResult importImei(MultipartFile file, DeviceDTO dto) throws Exception{ |
||||
if (!StringUtils.isNotEmpty(dto.getDeviceModelId())){ |
||||
throw new ServiceException("messages.parameter.error"); |
||||
} |
||||
if (!StringUtils.isNotEmpty(dto.getFirmId())){ |
||||
throw new ServiceException("messages.parameter.error"); |
||||
} |
||||
|
||||
ExcelUtil<DeviceDTO> util = new ExcelUtil<DeviceDTO>(DeviceDTO.class); |
||||
if (StringUtils.isNull(file)){ |
||||
throw new ServiceException("接收到的 MultipartFile 为空,请重试"); |
||||
} |
||||
List<DeviceDTO> imeiList = util.importExcel(file.getInputStream()); |
||||
|
||||
|
||||
return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS), deviceInfoService.importImei(imeiList,dto)); |
||||
|
||||
|
||||
} |
||||
|
||||
/** |
||||
* 设备批量录入 |
||||
* @return |
||||
*/ |
||||
@InputLog(inputType = DeviceModelConstants.ONE) //如果是批量录入
|
||||
@PostMapping("/import/imei/two") |
||||
public AjaxResult importImeiTwo(MultipartFile file, DeviceDTO dto) throws Exception{ |
||||
if (!StringUtils.isNotEmpty(dto.getDeviceModelId())){ |
||||
throw new ServiceException("messages.parameter.error"); |
||||
} |
||||
if (!StringUtils.isNotEmpty(dto.getFirmId())){ |
||||
throw new ServiceException("messages.parameter.error"); |
||||
} |
||||
|
||||
ExcelUtil<DeviceDTO> util = new ExcelUtil<DeviceDTO>(DeviceDTO.class); |
||||
if (StringUtils.isNull(file)){ |
||||
throw new ServiceException("接收到的 MultipartFile 为空,请重试"); |
||||
} |
||||
List<DeviceDTO> imeiList = util.importExcel(file.getInputStream()); |
||||
|
||||
|
||||
return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS), deviceInfoService.importImeiTwo(file,imeiList,dto)); |
||||
|
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
/** |
||||
* 设备分页查询 |
||||
* @return |
||||
*/ |
||||
@GetMapping("/page/list") |
||||
public AjaxResult queryByPageList(DevicePageDTO dto) { |
||||
|
||||
return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS), deviceInfoService.queryByPageList(dto)); |
||||
|
||||
} |
||||
|
||||
|
||||
/** |
||||
* 设备审核 |
||||
* @return |
||||
*/ |
||||
@RequiresPermissions(value="system:equipmentexamination:list") |
||||
@GetMapping("/update/status/{id}/{status}") |
||||
public AjaxResult updateStatus(@PathVariable String id,@PathVariable String status){ |
||||
|
||||
return deviceInfoService.updateStatus(id,status) ? AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS)) : AjaxResult.error(LocaleUtil.getMessage(FieldConstant.MESSAGES_ERROR)); |
||||
|
||||
} |
||||
|
||||
|
||||
/** |
||||
* 设备批次审核 |
||||
* @return |
||||
*/ |
||||
@RequiresPermissions(value="system:equipmentexamination:list") |
||||
@GetMapping("/update/inputBach/status/{inputBach}/{status}") |
||||
public AjaxResult updateInputBachStatus(@PathVariable String inputBach,@PathVariable String status){ |
||||
|
||||
return deviceInfoService.updateInputBachStatus(inputBach,status) ? AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS)) : AjaxResult.error(LocaleUtil.getMessage(FieldConstant.MESSAGES_ERROR)); |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 根据批次号分页查询 |
||||
* @param dto |
||||
* @return |
||||
*/ |
||||
@GetMapping("/query/inputBach/List") |
||||
public AjaxResult queryInputBatchList(DevicePageDTO dto){ |
||||
|
||||
return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),deviceInfoService.queryInputBatchList(dto)); |
||||
|
||||
} |
||||
|
||||
|
||||
/** |
||||
* 批次初始化 |
||||
* @return |
||||
*/ |
||||
@GetMapping("/update/initInputBach") |
||||
public AjaxResult initInputBach(){ |
||||
|
||||
return AjaxResult.success(deviceInfoService.initInputBach()); |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
/** |
||||
* 分页查询设备激活信息 |
||||
* @return |
||||
*/ |
||||
@PostMapping("/query/list") |
||||
public AjaxResult queryActivationInfoPageList(@RequestBody DeviceActivaPageDTO dto) { |
||||
|
||||
return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS), deviceInfoService.queryActivationInfoPageList(dto)); |
||||
|
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
/** |
||||
* 根据设备Imei批量删除设备 |
||||
* @return |
||||
*/ |
||||
@DelImeiLog(delType = DeviceModelConstants.ZERO) |
||||
@DeleteMapping("/del/list") |
||||
public AjaxResult delDeviceByIds(@RequestBody List<String> imeis) { |
||||
|
||||
if (!SecurityUtils.isAdminString(SecurityContextHolder.getStringUserId()) && imeis.size()>1){ |
||||
// 不是管理员只能删除单个设备
|
||||
throw new ServiceException("messages.delete.device.sing.error"); |
||||
} |
||||
return deviceInfoService.delDeviceByIds(imeis) ? AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS)) : AjaxResult.error(LocaleUtil.getMessage(FieldConstant.MESSAGES_ERROR)); |
||||
|
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
/** |
||||
* 根据设备IMEI批量删除设备(导入删除) |
||||
* @return |
||||
*/ |
||||
@DelImeiLog(delType = DeviceModelConstants.ONE) |
||||
@DeleteMapping("/del/imei") |
||||
public AjaxResult delDeviceByImei(MultipartFile file) throws Exception { |
||||
ExcelUtil<DeviceDTO> util = new ExcelUtil<DeviceDTO>(DeviceDTO.class); |
||||
if (StringUtils.isNull(file)){ |
||||
throw new ServiceException("接收到的 MultipartFile 为空,请重试"); |
||||
} |
||||
List<DeviceDTO> imeiList = util.importExcel(file.getInputStream()); |
||||
if (StringUtils.isEmpty(imeiList) || imeiList.size()<=0){ |
||||
throw new ServiceException("接收到的 参数 为空,请重试"); |
||||
} |
||||
List<String> imeis = imeiList.parallelStream().filter(s->StringUtils.isNotEmpty(s.getImei())).map(DeviceDTO::getImei).collect(Collectors.toList()); |
||||
|
||||
return deviceInfoService.delDeviceByImei(imeis,DeviceModelConstants.ZERO) ? AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS)) : AjaxResult.error(LocaleUtil.getMessage(FieldConstant.MESSAGES_ERROR)); |
||||
|
||||
} |
||||
|
||||
|
||||
/** |
||||
* 根据设备批次删除设备 |
||||
* @return |
||||
*/ |
||||
@DelImeiLog(delType = DeviceModelConstants.ZERO) |
||||
@DeleteMapping("/del/inputBach/list/{inputBach}") |
||||
public AjaxResult delDeviceInputBach(@PathVariable String inputBach) { |
||||
//根据批次号查询设备
|
||||
List<DeviceInfo> infos = deviceInfoService.queryInputBatchListTwo(inputBach); |
||||
List<String> imeiList=new ArrayList<>(); |
||||
if (StringUtils.isNotEmpty(infos) && infos.size()>0){ |
||||
imeiList = infos.stream().map(DeviceInfo::getImei).collect(Collectors.toList()); |
||||
} |
||||
|
||||
if (!SecurityUtils.isAdminString(SecurityContextHolder.getStringUserId()) && imeiList.size()>1){ |
||||
// 不是管理员只能删除单个设备
|
||||
throw new ServiceException("messages.delete.device.sing.error"); |
||||
} |
||||
return deviceInfoService.delDeviceByIds(imeiList) ? AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS)) : AjaxResult.error(LocaleUtil.getMessage(FieldConstant.MESSAGES_ERROR)); |
||||
|
||||
|
||||
} |
||||
|
||||
/** |
||||
* 单个设备Imei解绑 |
||||
* @return |
||||
*/ |
||||
@FactoryLog |
||||
@GetMapping("/device/unBing/{imei}") |
||||
public AjaxResult deviceUnBingByImei(@PathVariable String imei) { |
||||
return deviceInfoService.deviceUnBingByImei(imei,DeviceModelConstants.ONE) ? AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS)) : AjaxResult.error(LocaleUtil.getMessage(FieldConstant.MESSAGES_ERROR)); |
||||
|
||||
|
||||
} |
||||
|
||||
/** |
||||
* 批量设备Imei解绑 |
||||
* @return |
||||
*/ |
||||
@FactoryLog(unBingType = DeviceModelConstants.ONE) |
||||
@PostMapping("/device/unBing/list") |
||||
public AjaxResult deviceUnBingListByImei(MultipartFile file) throws Exception { |
||||
ExcelUtil<DeviceDTO> util = new ExcelUtil<DeviceDTO>(DeviceDTO.class); |
||||
if (StringUtils.isNull(file)){ |
||||
throw new ServiceException("接收到的 MultipartFile 为空,请重试"); |
||||
} |
||||
List<DeviceDTO> imeiList = util.importExcel(file.getInputStream()); |
||||
if (StringUtils.isEmpty(imeiList) || imeiList.size()<=0){ |
||||
throw new ServiceException("接收到的 参数 为空,请重试"); |
||||
} |
||||
List<String> list = imeiList.parallelStream().filter(s->StringUtils.isNotEmpty(s.getImei())).map(DeviceDTO::getImei).collect(Collectors.toList()); |
||||
return deviceInfoService.delDeviceByImei(list,DeviceModelConstants.ONE) ? AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS)) : AjaxResult.error(LocaleUtil.getMessage(FieldConstant.MESSAGES_ERROR)); |
||||
|
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** |
||||
* 查询所有审核通过未删除的设备 |
||||
* @return |
||||
*/ |
||||
@GetMapping("/query/device/approve") |
||||
public AjaxResult queryApprovedDevice(){ |
||||
return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS), deviceInfoService.queryApprovedDevice()); |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 根据imei 查询设备信息 对APP使用 |
||||
* @return |
||||
*/ |
||||
@GetMapping("/query/deviceInfo/{imei}") |
||||
public DeviceInfo queryDeviceInfoByImei(@PathVariable String imei){ |
||||
return deviceInfoService.queryDeviceInfoByImei(imei); |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
/** |
||||
* 根据imei和日期查询轨迹信息 |
||||
* @return |
||||
*/ |
||||
@PostMapping("/query/track") |
||||
public AjaxResult queryTrackInfo(@RequestBody TrackDTO dto){ |
||||
return AjaxResult.success(deviceInfoService.queryTrackInfo(dto)); |
||||
|
||||
} |
||||
|
||||
|
||||
/** |
||||
* 远程控制 |
||||
* @return |
||||
*/ |
||||
@PostMapping("/query/remote") |
||||
public AjaxResult queryRemoteControl(@RequestBody RemoteControlDTO dto){ |
||||
return AjaxResult.success(deviceInfoService.queryRemoteControl(dto)); |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 远程控制指令下发 |
||||
* @return |
||||
*/ |
||||
@PostMapping("/send/instructions") |
||||
public AjaxResult sendInstructions(@RequestBody sendInstructionDTO dto){ |
||||
return AjaxResult.success(deviceInfoService.sendInstructions(dto)); |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 查询设备功能信息 |
||||
* @param dto |
||||
* @return |
||||
*/ |
||||
|
||||
@PostMapping("/query/equipmentFunction") |
||||
public AjaxResult queryEquipmentFunction(@RequestBody RemoteControlDTO dto){ |
||||
return AjaxResult.success(deviceInfoService.queryEquipmentFunction(dto)); |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 设备使用状况统计 |
||||
* @return |
||||
*/ |
||||
@GetMapping("/query/deviceNumber") |
||||
public AjaxResult queryDeviceNumberInfo(){ |
||||
return AjaxResult.success(deviceInfoService.queryDeviceNumberInfo()); |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
// /**
|
||||
// * 根据设备imei批量删除设备
|
||||
// * @return
|
||||
// */
|
||||
// @DelImeiLog(delType = DeviceModelConstants.ZERO)
|
||||
// @DeleteMapping("/del/list")
|
||||
// public AjaxResult delDeviceByImei(@RequestBody List<String> imeis) {
|
||||
//
|
||||
// return deviceInfoService.delDeviceByIds(ids) ? success(I18nUtil.getMessage(FieldConstant.MESSAGES_SUCCESS)) : error(I18nUtil.getMessage(FieldConstant.MESSAGES_ERROR));
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
} |
||||
|
@ -0,0 +1,71 @@
@@ -0,0 +1,71 @@
|
||||
package com.ecell.internationalize.system.controller; |
||||
import com.ecell.internationalize.common.core.constant.UserConstants; |
||||
import com.ecell.internationalize.common.core.web.controller.BaseController; |
||||
import com.ecell.internationalize.common.core.web.domain.AjaxResult; |
||||
import com.ecell.internationalize.common.core.web.page.TableDataInfo; |
||||
import com.ecell.internationalize.common.security.utils.SecurityUtils; |
||||
import com.ecell.internationalize.system.entity.DeviceModel; |
||||
import com.ecell.internationalize.system.entity.vo.DeviceModelVO; |
||||
import com.ecell.internationalize.system.service.DeviceModelService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.validation.annotation.Validated; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 设备类型管理信息 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/deviceModel") |
||||
@Deprecated |
||||
public class DeviceModelController extends BaseController { |
||||
@Autowired |
||||
private DeviceModelService modelService; |
||||
/** |
||||
* 新增设备类型 |
||||
*/ |
||||
@PostMapping("/add") |
||||
public AjaxResult add(@Validated @RequestBody DeviceModel model) { |
||||
if (UserConstants.NOT_UNIQUE.equals(modelService.checkModelNameUnique(model))) |
||||
{ |
||||
return AjaxResult.error("新增设备型号'" + model.getDeviceModelName() + "'失败,同一厂商下该名称已存在"); |
||||
} |
||||
return toAjax(modelService.insertDeviceModel(model)); |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 根据条件分页查询设备型号 |
||||
* @param model |
||||
* @return |
||||
*/ |
||||
@GetMapping("/list") |
||||
public TableDataInfo list(DeviceModel model) { |
||||
|
||||
startPage(); |
||||
List<DeviceModelVO> list = modelService.selectModelList(model); |
||||
return getDataTable(list); |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 更新设备型号信息 |
||||
* @param model |
||||
* @return |
||||
*/ |
||||
@PostMapping("/edit") |
||||
public AjaxResult edit( @RequestBody DeviceModel model) { |
||||
model.setUpdateBy(SecurityUtils.getUsername()); |
||||
return toAjax(modelService.updateDeviceModel(model)); |
||||
} |
||||
|
||||
@DeleteMapping("/del/{id}") |
||||
public AjaxResult remove(@PathVariable String id) { |
||||
//TODO 这里要判断录入总数是否为0 不为0就不能删除
|
||||
|
||||
return toAjax(modelService.deleteDeviceModelById(id)); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,137 @@
@@ -0,0 +1,137 @@
|
||||
package com.ecell.internationalize.system.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
||||
import javax.validation.constraints.NotEmpty; |
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* <p> |
||||
* 设备信息表 |
||||
* </p> |
||||
* |
||||
* @author ${author} |
||||
* @since 2022-07-10 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@ApiModel(value="DeviceInfo对象", description="设备信息表") |
||||
public class DeviceInfo implements Serializable { |
||||
|
||||
private static final long serialVersionUID=1L; |
||||
|
||||
@TableId(value = "device_id",type = IdType.INPUT) |
||||
@ApiModelProperty(value = "设备ID") |
||||
private String deviceId; |
||||
|
||||
@ApiModelProperty(value = "IMEI") |
||||
private String imei; |
||||
|
||||
@NotEmpty(message = "厂商id不能为空") |
||||
@ApiModelProperty(value = "厂商id") |
||||
private String firmId; |
||||
|
||||
@NotEmpty(message = "厂商名称不能为空") |
||||
@ApiModelProperty(value = "厂商名称") |
||||
private String firmName; |
||||
|
||||
@NotEmpty(message = "设备型号id不能为空") |
||||
@ApiModelProperty(value = "设备型号id") |
||||
private String deviceModelId; |
||||
|
||||
@NotEmpty(message = "设备型号名称不能为空") |
||||
@ApiModelProperty(value = "设备型号名称") |
||||
private String deviceModelName; |
||||
|
||||
@ApiModelProperty(value = "导入数量") |
||||
private Integer totalImport; |
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "审核时间") |
||||
private Date auditTime; |
||||
|
||||
@ApiModelProperty(value = "审核者") |
||||
private String reviewer; |
||||
|
||||
@ApiModelProperty(value = "审核设备(1.单个录入这里存的是设备的IMEI,如果是批量录入这里存的是文件的唯一标识)") |
||||
private String auditDevice; |
||||
|
||||
@ApiModelProperty(value = "录入标志(0.是单个录入,1.是批量录入") |
||||
private String inputFlag; |
||||
|
||||
@ApiModelProperty(value = "审核状态(0.是拒绝,1.是待审核,2.是通过,默认为1)") |
||||
private String auditStatus; |
||||
|
||||
@ApiModelProperty(value = "是否删除(0.是,1.否。默认为1)") |
||||
private String delFlag; |
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "授权时间") |
||||
private Date authorizaTime; |
||||
|
||||
@ApiModelProperty(value = "代理商id") |
||||
private String agentId; |
||||
|
||||
@ApiModelProperty(value = "代理商名称") |
||||
private String agentName; |
||||
|
||||
@ApiModelProperty(value = "授权标志(0.未授权,1.是已授权。默认为0)") |
||||
private String authorizaFlag; |
||||
|
||||
@ApiModelProperty(value = "创建人") |
||||
@TableField(value = "create_user",fill = FieldFill.INSERT) |
||||
private String createUser; |
||||
|
||||
@ApiModelProperty(value = "修改人") |
||||
@TableField(value = "update_user",fill = FieldFill.UPDATE) |
||||
private String updateUser; |
||||
|
||||
@TableField(value = "create_time",fill = FieldFill.INSERT) |
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建时间") |
||||
private Date createTime; |
||||
|
||||
@TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE) |
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "修改时间") |
||||
private Date updateTime; |
||||
|
||||
@ApiModelProperty(value = "录入批次号") |
||||
private String inputBatch; |
||||
|
||||
@ApiModelProperty(value = "是否激活(0.未激活,1.是已激活。默认为0 这个字段没用)") |
||||
private String whetherActivation; |
||||
|
||||
@ApiModelProperty(value = "是否绑定(0.未绑定,1.是已绑定。默认为0 这个字段没用)") |
||||
private String whetherBinding; |
||||
@TableField(value = "firstLoginTime") |
||||
@ApiModelProperty(value = "设备首次登录时间") |
||||
private Date firstLoginTime; |
||||
|
||||
@TableField(value = "lastLoginTime") |
||||
@ApiModelProperty(value = "设备最后登录时间") |
||||
private Date lastLoginTime; |
||||
|
||||
/** 功能模块说明 */ |
||||
@TableField(exist = false) |
||||
private String funDescription; |
||||
/** 录入成功条数 */ |
||||
@TableField(exist = false) |
||||
private int inputSuccessTotal; |
||||
|
||||
|
||||
} |
@ -0,0 +1,82 @@
@@ -0,0 +1,82 @@
|
||||
package com.ecell.internationalize.system.entity; |
||||
|
||||
import com.ecell.internationalize.common.core.web.domain.BaseEntity; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
|
||||
import javax.validation.constraints.NotBlank; |
||||
|
||||
@Data |
||||
@AllArgsConstructor |
||||
@NoArgsConstructor |
||||
@ApiModel(description = "设备型号信息") |
||||
@Deprecated |
||||
public class DeviceModel extends BaseEntity { |
||||
/**设备型号id */ |
||||
@ApiModelProperty("设备型号id ") |
||||
private String deviceModelId; |
||||
/** 设备型号名称 */ |
||||
@NotBlank(message = "设备型号名称不能为空") |
||||
@ApiModelProperty("设备型号名称 ") |
||||
private String deviceModelName; |
||||
/** 厂商id */ |
||||
@NotBlank(message = "厂商id不能为空") |
||||
private String firmId; |
||||
/** 厂商名称 */ |
||||
@ApiModelProperty("厂商名称 ") |
||||
private String firmName; |
||||
/** 定位功能(1.基站,2.基站+wiff,3.基站+GPS,4.基站+wiff+GPS) */ |
||||
private String locationFun; |
||||
/** 视频类型名称(0.不支持,其余就是类型的名称) */ |
||||
private String videoModelName; |
||||
/** 视频规则(0.默认,其余就是类型的名称) */ |
||||
private String videoRule; |
||||
/** 公视频类型id */ |
||||
private String videoModelId; |
||||
/** 设备类型(0.默认 1.手表,2.学生卡,3.老人机) */ |
||||
private String deviceType; |
||||
/** 公众号平台名称(0.不支持,其余就是公众号的名称) */ |
||||
private String officialAccountName; |
||||
/** 手表闹钟(0.不支持,1.支持) */ |
||||
private String watchAlarmClock; |
||||
/** 上课禁用(0.不支持,1.支持)*/ |
||||
private String classDisable; |
||||
/** SOS号码(0.不支持,1.支持) */ |
||||
private String sosPhone; |
||||
/** 电子围栏(0.不支持,1.支持)*/ |
||||
private String electronicFence; |
||||
/** 记步功能(0.不支持,1.支持) */ |
||||
private String stepRecorder; |
||||
/** 微聊功能(0.不支持,1.支持) */ |
||||
private String chatFun; |
||||
/** 查找设备功能(0.不支持,1.支持) */ |
||||
private String lookupFun; |
||||
/** 手表WIFF(0.不支持,1.支持) */ |
||||
private String watchWiff; |
||||
/** 心率(0.不支持,1.支持)*/ |
||||
private String heartRate; |
||||
/** 体温(0.不支持,1.支持) */ |
||||
private String temperature; |
||||
/** 血压(0.不支持,1.支持)*/ |
||||
private String bloodPressure; |
||||
/** 血氧(0.不支持,1.支持 */ |
||||
private String bloodOxygen; |
||||
/** 白名单(0.不支持,1.支持) */ |
||||
private String whiteList; |
||||
/** 拨号盘(0.不支持,1.支持)*/ |
||||
private String dial; |
||||
/** 定时开关机(0.不支持,1.支持) */ |
||||
private String timingSwitch; |
||||
/** 电信版本号(0,否,1.是)*/ |
||||
private String telecomVersion; |
||||
/** 是否删除(0,是,1.否)*/ |
||||
private String delFlag; |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
package com.ecell.internationalize.system.entity.dto; |
||||
|
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
|
||||
@ApiModel(description = "设备家庭情况分页对象") |
||||
@Data |
||||
@AllArgsConstructor |
||||
@NoArgsConstructor |
||||
public class DeviceFamilyPageDTO { |
||||
|
||||
@ApiModelProperty("设备imei ") |
||||
private String imei; |
||||
|
||||
@ApiModelProperty(value = "设备手机号") |
||||
private String phone; |
||||
|
||||
@ApiModelProperty(value = "每页展示的条数") |
||||
private Integer pageSize; |
||||
|
||||
@ApiModelProperty(value = "当前的页码") |
||||
private Integer current; |
||||
|
||||
} |
@ -0,0 +1,229 @@
@@ -0,0 +1,229 @@
|
||||
package com.ecell.internationalize.system.mapper; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.ecell.internationalize.system.entity.DeviceInfo; |
||||
import com.ecell.internationalize.system.entity.LatestLocationApp; |
||||
import com.ecell.internationalize.system.entity.dto.*; |
||||
import com.ecell.internationalize.system.entity.vo.*; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* <p> |
||||
* 设备信息表 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author ${author} |
||||
* @since 2022-07-10 |
||||
*/ |
||||
public interface DeviceInfoMapper extends BaseMapper<DeviceInfo> { |
||||
|
||||
Page<DeviceActivaVO> queryActivationInfoPageList(@Param("page") Page page, @Param("dto") DeviceActivaPageDTO dto); |
||||
|
||||
/** |
||||
* 根据批次分组查询审批通过的总数 |
||||
* @param page |
||||
* @param dto |
||||
* @return |
||||
*/ |
||||
Page<DeviceActivaVO> queryActivationInfoList(@Param("page") Page page, @Param("dto") DeviceActivaPageDTO dto); |
||||
|
||||
/** |
||||
* 根据imeis查询最新位置信息表统计激活数据 |
||||
* @param list |
||||
* @return |
||||
*/ |
||||
int queryActivateDeviceCount(@Param("list") List<String> list); |
||||
/** |
||||
* 根据imeis查询绑定表统计绑定数据 |
||||
* @param list |
||||
* @return |
||||
*/ |
||||
int queryBindDeviceCount(@Param("list") List<String> list); |
||||
|
||||
void updateDeviceOwnerInfo(@Param("pId")String positioningModelId, @Param("mId")String deviceModelId); |
||||
/** |
||||
* 查询管理员id,设备拥有者名称,imei |
||||
*/ |
||||
List<DeviceAdminOwnerInfo> queryBingOrOwnerInfo(@Param("imei") List<String>imei); |
||||
/** |
||||
* 根据群组id 管理id 查询群组成员信息表 |
||||
*/ |
||||
List<String> queryChatMemberById(@Param("groupId")String groupId,@Param("adminId")String adminId); |
||||
|
||||
/** |
||||
* 查询已绑定的imei |
||||
* @param list |
||||
* @return |
||||
*/ |
||||
List<String> queryBindImeiByList(@Param("list") List<String>list); |
||||
/** |
||||
* 查询绑定表管理员id (暂时不用) |
||||
*/ |
||||
List<DeviceUserBingInfo> queryBindAdminInfoByImei(@Param("list") List<String>list); |
||||
|
||||
/** |
||||
* 删除设备拥有者信息表deleteDeviceOwnerInfo |
||||
* @param imei |
||||
*/ |
||||
void deleteDeviceOwnerInfo(@Param("imei") List<String>imei); |
||||
|
||||
/** |
||||
* 删除绑定数据 |
||||
*/ |
||||
void deleteUserBindInfo(@Param("imei") List<String>imei); |
||||
/** |
||||
* 删除群组表 |
||||
*/ |
||||
void deleteChatGroup(@Param("imei") List<String>imei); |
||||
|
||||
/** |
||||
* 根据imei查询聊天群组表ID |
||||
* @param imei |
||||
* @return |
||||
*/ |
||||
List<String> queryChatGroupIdByImei(@Param("imei") List<String>imei); |
||||
/** |
||||
* 删除聊天成员表 |
||||
*/ |
||||
void deleteGroupMember(@Param("ids") List<String>ids); |
||||
/** |
||||
* 删除聊天信息表 |
||||
*/ |
||||
void deleteMessage(@Param("ids") List<String>ids); |
||||
/** |
||||
* 删除通讯录表 |
||||
*/ |
||||
void deleteAddressBook(@Param("imei") List<String>imei); |
||||
/** |
||||
* 删除申请关注记录表 |
||||
*/ |
||||
void deleteDeviceAttention(@Param("imei") List<String>imei); |
||||
/** |
||||
* 删除最新位置表 |
||||
*/ |
||||
void deleteLatestLocation(@Param("imei") List<String>imei); |
||||
/** |
||||
* 删除解析后的位置表 |
||||
*/ |
||||
void deleteDeviceLocation(@Param("imei") List<String>imei); |
||||
/** |
||||
* 删除闹钟信息 |
||||
*/ |
||||
void deleteAlarm(@Param("imei") List<String>imei); |
||||
/** |
||||
* 删除上课免打扰信息表 |
||||
*/ |
||||
void deleteDeviceDisable(@Param("imei") List<String>imei); |
||||
/** |
||||
* 删除定时开关机信息表 |
||||
*/ |
||||
void deleteDeviceTimeSwitch(@Param("imei") List<String>imei); |
||||
/** |
||||
* 删除安全信息围栏表 |
||||
*/ |
||||
void deleteSafetyRail(@Param("imei") List<String>imei); |
||||
/** |
||||
* 删除SOS信息表 |
||||
*/ |
||||
void deleteSOSInfo(@Param("imei") List<String>imei); |
||||
/** |
||||
* 删除消息提醒信息表 |
||||
*/ |
||||
void deleteReminderMessage(@Param("imei") List<String>imei); |
||||
/** |
||||
* 删除可是视频信息表 |
||||
*/ |
||||
void deleteVideoInfo(@Param("imei") List<String>imei); |
||||
/** |
||||
* 删除轨迹信息 |
||||
*/ |
||||
void deleteTrackInfo(@Param("imei") List<String>imei); |
||||
|
||||
/** |
||||
* 根据imei 日期查询轨迹信息 |
||||
* @param dto |
||||
*/ |
||||
List<TrackVO> queryTrackInfo(@Param("dto") TrackDTO dto); |
||||
|
||||
/** |
||||
* 查询远程控制 |
||||
* @param page |
||||
* @param dto |
||||
* @return |
||||
*/ |
||||
Page<RemoteControlVO> queryRemoteControl(@Param("page")Page page, @Param("dto") RemoteControlDTO dto); |
||||
|
||||
/** |
||||
* 查询设备功能信息 |
||||
* @param page |
||||
* @param dto |
||||
* @return |
||||
*/ |
||||
Page<EquipmentFunctionVO> queryEquipmentFunction(@Param("page") IPage page, @Param("dto")RemoteControlDTO dto); |
||||
|
||||
/** |
||||
* 根据imei查询电话本信息 |
||||
* @param imei |
||||
* @return |
||||
*/ |
||||
List<TelephoneBookVO> queryBookByImei(@Param("imei")String imei); |
||||
|
||||
/** |
||||
* //根据imei查询闹钟信息
|
||||
* @param imei |
||||
* @return |
||||
*/ |
||||
List<AlarmVO>queryAlarmByImei( @Param("imei")String imei); |
||||
|
||||
/** |
||||
* //根据imei查询上课禁用信息
|
||||
* @param imei |
||||
* @return |
||||
*/ |
||||
List<DisableVO>queryDisableByImei( @Param("imei")String imei); |
||||
|
||||
/** |
||||
* //根据imei查询安全围栏信息
|
||||
* @param imei |
||||
* @return |
||||
*/ |
||||
List<SafetyRailVO>querySafetyRaliByImei( @Param("imei")String imei); |
||||
|
||||
List<LatestLocationApp> queryByiMei(@Param("imei") String imei, @Param("iMeiList") List<String> iMeiList); |
||||
|
||||
List<LocationDto> locationTotal(@Param("iMeiList") List<String> iMeiList); |
||||
|
||||
List<LocationChildDto> provinceTotal(@Param("country") String country,@Param("iMeiList") List<String> iMeiList); |
||||
/** |
||||
* 查询设备激活数 |
||||
* @return |
||||
*/ |
||||
int queryDeviceActivate(@Param("dto")RemoteControlDTO dto); |
||||
/** |
||||
* 查询设备今日新增数量 |
||||
*/ |
||||
int queryDeviceTodayAdd(@Param("dto")RemoteControlDTO dto); |
||||
|
||||
/** |
||||
* 厂商列表录入统计专用 |
||||
* @param firmId |
||||
* @param agentId |
||||
* @return |
||||
*/ |
||||
List<String> queryFirmInputCountDevice(@Param("firmId") String firmId, @Param("agentId")String agentId); |
||||
/** |
||||
* 厂商列表录激活计专用 |
||||
* @param firmId |
||||
* @param agentId |
||||
* @return |
||||
*/ |
||||
int queryFirmActivateCountDevice(@Param("firmId") String firmId, @Param("agentId")String agentId); |
||||
|
||||
List<LocationFindDto> queryByCountryOrProvince(@Param("countryOrProvince") String countryOrProvince,@Param("type") String type,@Param("iMeiList") List<String> iMeiList); |
||||
List<DeviceInfo> initInputBach(); |
||||
} |
@ -0,0 +1,139 @@
@@ -0,0 +1,139 @@
|
||||
package com.ecell.internationalize.system.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.ecell.internationalize.system.entity.DeviceInfo; |
||||
import com.ecell.internationalize.system.entity.LatestLocationApp; |
||||
import com.ecell.internationalize.system.entity.dto.*; |
||||
import com.ecell.internationalize.system.entity.vo.DeviceCountInfo; |
||||
import com.ecell.internationalize.system.entity.vo.TrackVO; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* <p> |
||||
* 设备信息表 服务类 |
||||
* </p> |
||||
* |
||||
* @author ${author} |
||||
* @since 2022-07-10 |
||||
*/ |
||||
public interface DeviceInfoService extends IService<DeviceInfo> { |
||||
|
||||
boolean singleEntry(DeviceDTO dto); |
||||
|
||||
String importImei(List<DeviceDTO> userList, DeviceDTO dto); |
||||
|
||||
IPage queryByPageList(DevicePageDTO dto); |
||||
|
||||
/** |
||||
* 根据IMEI查询批次号 |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
String queryInputBatchById(String ids); |
||||
|
||||
/** |
||||
* 审批状态更新 |
||||
* @param id |
||||
* @param status |
||||
* @return |
||||
*/ |
||||
boolean updateStatus(String id,String status); |
||||
|
||||
DeviceInfo queryDeviceByImei(String imei); |
||||
|
||||
IPage queryActivationInfoPageList(DeviceActivaPageDTO dto); |
||||
|
||||
boolean delDeviceByIds(List<String> imei); |
||||
|
||||
boolean delDeviceByImei(List<String> imeis,String sign); |
||||
|
||||
List<DeviceInfo> queryApprovedDevice(); |
||||
|
||||
/** |
||||
* 根据 imei 查询设备信息 对APP使用 |
||||
* @return |
||||
*/ |
||||
DeviceInfo queryDeviceInfoByImei(String imei); |
||||
|
||||
/** |
||||
* 单个解绑 |
||||
* @param imei |
||||
* @param one |
||||
* @return |
||||
*/ |
||||
boolean deviceUnBingByImei(String imei, String one); |
||||
|
||||
/** |
||||
* 查询轨迹信息 |
||||
* @param dto |
||||
* @return |
||||
*/ |
||||
List<TrackVO> queryTrackInfo(TrackDTO dto); |
||||
|
||||
/** |
||||
* 设备远程控制查询 |
||||
* @param dto |
||||
* @return |
||||
*/ |
||||
IPage queryRemoteControl(RemoteControlDTO dto); |
||||
|
||||
/** |
||||
* 远程控制指令下发 |
||||
* @param dto |
||||
* @return |
||||
*/ |
||||
Map<String,String>sendInstructions(sendInstructionDTO dto); |
||||
|
||||
/** |
||||
* 查询设备功能信息 |
||||
* @param dto |
||||
* @return |
||||
*/ |
||||
IPage queryEquipmentFunction(RemoteControlDTO dto); |
||||
|
||||
/** |
||||
* 设备使用状况统计 |
||||
* @return |
||||
*/ |
||||
DeviceCountInfo queryDeviceNumberInfo(); |
||||
|
||||
List<LatestLocationApp> queryByiMei(String imei); |
||||
|
||||
List<LocationDto> locationTotal(); |
||||
|
||||
List<LocationFindDto> queryByCountryOrProvince(String countryOrProvince, String type); |
||||
|
||||
Object importImeiTwo(MultipartFile file, List<DeviceDTO> imeiList, DeviceDTO dto); |
||||
|
||||
/** |
||||
* 根据批次审核 |
||||
* @param inputBach |
||||
* @param status |
||||
* @return |
||||
*/ |
||||
boolean updateInputBachStatus(String inputBach, String status); |
||||
|
||||
/** |
||||
* 初始化批次号 |
||||
* @return |
||||
*/ |
||||
List<DeviceInfo> initInputBach(); |
||||
|
||||
/** |
||||
* 根据批次分页查询设备信息 |
||||
* @param dto |
||||
* @return |
||||
*/ |
||||
IPage queryInputBatchList(DevicePageDTO dto); |
||||
|
||||
/** |
||||
* 根据批次号查询设备信息 |
||||
* @param inputBach |
||||
* @return |
||||
*/ |
||||
List<DeviceInfo> queryInputBatchListTwo(String inputBach); |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,481 @@
@@ -0,0 +1,481 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.ecell.internationalize.system.mapper.DeviceInfoMapper"> |
||||
<resultMap id="activationMap" type="com.ecell.internationalize.system.entity.vo.DeviceActivaVO"> |
||||
<result property="firmName" column="firm_name"/> |
||||
<result property="inputBatch" column="input_batch"/> |
||||
<result property="inputDevice" column="input_device"/> |
||||
<result property="activateDevice" column="activate_device"/> |
||||
<result property="whetherBinding" column="whether_binding"/> |
||||
<result property="dial" column="telecom_version"/> |
||||
<result property="importTime" column="create_time"/> |
||||
|
||||
</resultMap> |
||||
|
||||
<select id="queryActivationInfoPageList" resultMap="activationMap"> |
||||
select s.*,w.dial from |
||||
(SELECT d.*,c.firm_name from |
||||
(select COUNT(*) as input_device, b.input_batch, b.firm_id, b.device_model_id,b.create_time, |
||||
(select COUNT(1) from device_info where del_flag='1' and whether_activation='1'and input_batch =b.Input_batch) as activate_device, |
||||
(select COUNT(1) from device_info where del_flag='1' and whether_binding='1'and input_batch =b.Input_batch) as whether_binding |
||||
from device_info as b WHERE b.audit_status='2' GROUP BY b.input_batch) d LEFT JOIN firm_manage c on d.firm_id = c.firm_id) s |
||||
LEFT JOIN device_model_info w on s.device_model_id = w.device_model_id |
||||
<where> |
||||
<if test="dto.inputBatch != null and dto.inputBatch !='' "> |
||||
and s.input_batch =#{dto.inputBatch} |
||||
</if> |
||||
<if test="dto.firmName != null and dto.firmName !='' "> |
||||
and s.firm_name =#{dto.firmName} |
||||
</if> |
||||
<if test="dto.dial != null and dto.dial !='' "> |
||||
and w.dial =#{dto.dial} |
||||
</if> |
||||
<if test="dto.startTime != null and dto.startTime !='' "> |
||||
and <![CDATA[DATE_FORMAT(s.create_time,'%Y-%m-%d')>=DATE_FORMAT(#{dto.startTime},'%Y-%m-%d')]]> |
||||
</if> |
||||
<if test="dto.endTime != null and dto.endTime !='' "> |
||||
and <![CDATA[DATE_FORMAT(s.create_time,'%Y-%m-%d')>=DATE_FORMAT(#{dto.endTime},'%Y-%m-%d')]]> |
||||
</if> |
||||
|
||||
</where> |
||||
</select> |
||||
|
||||
|
||||
<select id="queryActivationInfoList" resultMap="activationMap"> |
||||
select s.*,w.telecom_version from |
||||
(SELECT d.*,c.firm_name from |
||||
(select COUNT(*) as input_device, b.input_batch, b.firm_id, b.device_model_id,b.create_time |
||||
from device_info as b WHERE b.audit_status='2' and del_flag ='1' |
||||
<if test="dto.firmId !=null and dto.firmId != '' "> |
||||
and firm_id=#{dto.firmId} |
||||
</if> |
||||
<if test="dto.agentId !=null and dto.agentId != '' "> |
||||
and agent_id=#{dto.agentId} |
||||
</if> |
||||
GROUP BY b.input_batch) d INNER JOIN firm_manage c on d.firm_id = c.firm_id) s |
||||
INNER JOIN device_model_info w on s.device_model_id = w.device_model_id |
||||
<where> |
||||
<if test="dto.inputBatch != null and dto.inputBatch !='' "> |
||||
and s.input_batch =#{dto.inputBatch} |
||||
</if> |
||||
<if test="dto.firmName != null and dto.firmName !='' "> |
||||
and s.firm_name =#{dto.firmName} |
||||
</if> |
||||
<if test="dto.dial != null and dto.dial !='' "> |
||||
and w.telecom_version =#{dto.dial} |
||||
</if> |
||||
<if test="dto.startTime != null and dto.startTime !='' "> |
||||
and <![CDATA[DATE_FORMAT(s.create_time,'%Y-%m-%d')>=DATE_FORMAT(#{dto.startTime},'%Y-%m-%d')]]> |
||||
</if> |
||||
<if test="dto.endTime != null and dto.endTime !='' "> |
||||
and <![CDATA[DATE_FORMAT(s.create_time,'%Y-%m-%d')>=DATE_FORMAT(#{dto.endTime},'%Y-%m-%d')]]> |
||||
</if> |
||||
</where> |
||||
ORDER BY create_time DESC |
||||
</select> |
||||
|
||||
|
||||
<select id="queryActivateDeviceCount" parameterType="java.util.List" resultType="java.lang.Integer"> |
||||
select count(1) from latest_location_app where imei in |
||||
<foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</select> |
||||
|
||||
|
||||
<select id="queryBindDeviceCount" parameterType="java.util.List" resultType="java.lang.Integer"> |
||||
select count(1) from (select distinct(imei) from user_device_bind_app) s where s.imei in |
||||
<foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</select> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="queryBingOrOwnerInfo" parameterType="java.util.List" resultType="com.ecell.internationalize.system.entity.dto.DeviceAdminOwnerInfo"> |
||||
select s.imei,s.user_id,o.`name`,c.id as groupId from |
||||
(select d.user_id,d.imei from user_device_bind_app d where d.identity='2' and d.imei in |
||||
<foreach collection="imei" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
) as s |
||||
INNER JOIN device_owner_info_app o on s.imei=o.imei |
||||
INNER JOIN chant_group_app c on s.imei=c.imei |
||||
</select> |
||||
|
||||
|
||||
<select id="queryChatMemberById" resultType="java.lang.String"> |
||||
select user_id from chat_group_member_app where group_id=#{groupId} and user_id !=#{adminId} |
||||
|
||||
</select> |
||||
|
||||
|
||||
|
||||
<update id="updateDeviceOwnerInfo" > |
||||
update device_owner_info_app set positioning_model_id=#{pId} where imei in (select imei from device_info where del_flag ='1'and device_model_id=#{mId}) |
||||
</update> |
||||
|
||||
<!--查询已绑定的imei--> |
||||
<select id="queryBindImeiByList" parameterType="java.util.List" resultType="java.lang.String" > |
||||
select distinct(d.imei) from user_device_bind_app d where d.imei in |
||||
<foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</select> |
||||
|
||||
|
||||
<!--查询已绑定的管理员信息--> |
||||
<select id="queryBindAdminInfoByImei" parameterType="java.util.List" resultType="com.ecell.internationalize.system.entity.dto.DeviceUserBingInfo" > |
||||
select d.id,d.user_id,d.imei from user_device_bind_app d where d.identity='2' and d.imei in |
||||
<foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</select> |
||||
|
||||
<delete id="deleteDeviceOwnerInfo" parameterType="java.util.List"> |
||||
delete from device_owner_info_app where imei in |
||||
<foreach collection="imei" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</delete> |
||||
|
||||
<delete id="deleteUserBindInfo" parameterType="java.util.List"> |
||||
delete from user_device_bind_app where imei in |
||||
<foreach collection="imei" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</delete> |
||||
|
||||
<delete id="deleteChatGroup" parameterType="java.util.List"> |
||||
delete from chant_group_app where imei in |
||||
<foreach collection="imei" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</delete> |
||||
|
||||
<select id="queryChatGroupIdByImei" parameterType="java.util.List" resultType="java.lang.String"> |
||||
select id from chant_group_app where imei in |
||||
<foreach collection="imei" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</select> |
||||
|
||||
|
||||
<delete id="deleteGroupMember" parameterType="java.util.List"> |
||||
delete from chat_group_member_app where group_id in |
||||
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</delete> |
||||
|
||||
<delete id="deleteMessage" parameterType="java.util.List"> |
||||
delete from chat_group_message_app where group_id in |
||||
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</delete> |
||||
|
||||
<delete id="deleteAddressBook" parameterType="java.util.List"> |
||||
delete from address_book_app where imei in |
||||
<foreach collection="imei" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</delete> |
||||
|
||||
|
||||
<delete id="deleteDeviceAttention" parameterType="java.util.List"> |
||||
delete from device_attention_app where imei in |
||||
<foreach collection="imei" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</delete> |
||||
|
||||
|
||||
<delete id="deleteLatestLocation" parameterType="java.util.List"> |
||||
delete from latest_location_app where imei in |
||||
<foreach collection="imei" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</delete> |
||||
|
||||
|
||||
<delete id="deleteDeviceLocation" parameterType="java.util.List"> |
||||
delete from device_location_app where imei in |
||||
<foreach collection="imei" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</delete> |
||||
|
||||
<delete id="deleteAlarm" parameterType="java.util.List"> |
||||
delete from device_alarm where i_mei in |
||||
<foreach collection="imei" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</delete> |
||||
|
||||
|
||||
<delete id="deleteDeviceDisable" parameterType="java.util.List"> |
||||
delete from device_disable_app where imei in |
||||
<foreach collection="imei" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</delete> |
||||
|
||||
|
||||
|
||||
<delete id="deleteDeviceTimeSwitch" parameterType="java.util.List"> |
||||
delete from device_time_switch_app where imei in |
||||
<foreach collection="imei" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</delete> |
||||
|
||||
<delete id="deleteSafetyRail" parameterType="java.util.List"> |
||||
delete from safety_rail_app where imei in |
||||
<foreach collection="imei" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</delete> |
||||
|
||||
<delete id="deleteSOSInfo" parameterType="java.util.List"> |
||||
delete from imei_sos_info where imei in |
||||
<foreach collection="imei" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</delete> |
||||
|
||||
|
||||
<delete id="deleteReminderMessage" parameterType="java.util.List"> |
||||
delete from reminder_message_app where imei in |
||||
<foreach collection="imei" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</delete> |
||||
|
||||
<delete id="deleteVideoInfo" parameterType="java.util.List"> |
||||
delete from device_video_app where imei in |
||||
<foreach collection="imei" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</delete> |
||||
|
||||
|
||||
<delete id="deleteTrackInfo" parameterType="java.util.List"> |
||||
delete from track_info_app where imei in |
||||
<foreach collection="imei" index="index" item="item" open="(" separator="," close=")"> |
||||
#{item} |
||||
</foreach> |
||||
|
||||
</delete> |
||||
|
||||
<select id="queryTrackInfo" resultType="com.ecell.internationalize.system.entity.vo.TrackVO"> |
||||
select imei,longitude,latitude from track_info_app |
||||
<where> |
||||
<if test="dto.imei !=null and dto.imei !=''"> |
||||
and imei =#{dto.imei} |
||||
</if> |
||||
<if test="dto.start != null and dto.start !=''"> |
||||
and date_format(create_time,'%Y-%m-%d') = #{dto.start} |
||||
</if> |
||||
</where> |
||||
ORDER BY create_time |
||||
</select> |
||||
|
||||
<select id="queryRemoteControl" resultType="com.ecell.internationalize.system.entity.vo.RemoteControlVO"> |
||||
select d.imei,l.addr,f.firm_code as code from |
||||
( |
||||
select imei,firm_id,agent_id,device_model_id,create_time from device_info where audit_status='2' and del_flag |
||||
='1' |
||||
<if test="dto.firmId !=null and dto.firmId != '' "> |
||||
and firm_id=#{dto.firmId} |
||||
</if> |
||||
<if test="dto.agentId !=null and dto.agentId != '' "> |
||||
and agent_id=#{dto.agentId} |
||||
</if> |
||||
<if test="dto.imei !=null and dto.imei != '' "> |
||||
and imei=#{dto.imei} |
||||
</if> |
||||
group by imei |
||||
) d |
||||
INNER JOIN firm_manage f on d.firm_id =f.firm_id |
||||
LEFT JOIN latest_location_app l on d.imei =l.imei |
||||
</select> |
||||
|
||||
<select id="queryEquipmentFunction" resultType="com.ecell.internationalize.system.entity.vo.EquipmentFunctionVO"> |
||||
select d.imei,s.sos_phone_one as sosPhoneOne,s.sos_phone_two as sosPhoneTwo,s.sos_phone_three as sosPhoneThree,o.rejectStrange,o.positioning_interval as positioningInterval from |
||||
( |
||||
select imei from device_info where audit_status='2' and del_flag |
||||
='1' |
||||
<if test="dto.firmId !=null and dto.firmId != '' "> |
||||
and firm_id=#{dto.firmId} |
||||
</if> |
||||
<if test="dto.agentId !=null and dto.agentId != '' "> |
||||
and agent_id=#{dto.agentId} |
||||
</if> |
||||
<if test="dto.imei !=null and dto.imei != '' "> |
||||
and imei=#{dto.imei} |
||||
</if> |
||||
group by imei |
||||
) d |
||||
LEFT JOIN device_owner_info_app o on d.imei =o.imei |
||||
LEFT JOIN imei_sos_info s on d.imei =s.imei |
||||
</select> |
||||
|
||||
<select id="queryBookByImei" resultType="com.ecell.internationalize.system.entity.vo.TelephoneBookVO"> |
||||
select `name`,relation,phone from address_book_app where imei =#{imei} |
||||
|
||||
</select> |
||||
|
||||
<select id="queryAlarmByImei" resultType="com.ecell.internationalize.system.entity.vo.AlarmVO"> |
||||
select tag,alarm_time ,alarm_week,alarm_status from device_alarm_app where imei=#{imei} |
||||
</select> |
||||
|
||||
<select id="queryDisableByImei" resultType="com.ecell.internationalize.system.entity.vo.DisableVO"> |
||||
select alarm_start_time,alarm_week,alarm_status,alarm_end_time from device_disable_app where imei =#{imei} |
||||
|
||||
</select> |
||||
|
||||
<select id="querySafetyRaliByImei" resultType="com.ecell.internationalize.system.entity.vo.SafetyRailVO"> |
||||
select `name`,radius,address,week,start_time,end_time,status from safety_rail_app where imei =#{imei} |
||||
|
||||
</select> |
||||
<select id="queryByiMei" resultType="com.ecell.internationalize.system.entity.LatestLocationApp" parameterType="java.lang.String"> |
||||
select * from latest_location_app where 1=1 |
||||
<if test="imei !=null and imei != '' "> |
||||
and imei=#{imei} |
||||
</if> |
||||
|
||||
<if test="iMeiList!=null and iMeiList.size>0"> |
||||
and imei in |
||||
<foreach collection="iMeiList" item="iMeiList" open="(" close=")" separator=","> |
||||
#{iMeiList} |
||||
</foreach> |
||||
</if> |
||||
|
||||
</select> |
||||
|
||||
<select id="locationTotal" resultType="com.ecell.internationalize.system.entity.dto.LocationDto"> |
||||
select count(1) as countryNum,country from latest_location_app where 1=1 |
||||
<if test="iMeiList!=null and iMeiList.size>0"> |
||||
and imei in |
||||
<foreach collection="iMeiList" item="iMeiList" open="(" close=")" separator=","> |
||||
#{iMeiList} |
||||
</foreach> |
||||
</if> |
||||
GROUP BY country |
||||
</select> |
||||
|
||||
<select id="provinceTotal" resultType="com.ecell.internationalize.system.entity.dto.LocationChildDto"> |
||||
select count(1) as provinceNum,province from latest_location_app where country=#{country} |
||||
<if test="iMeiList!=null and iMeiList.size>0"> |
||||
and imei in |
||||
<foreach collection="iMeiList" item="iMeiList" open="(" close=")" separator=","> |
||||
#{iMeiList} |
||||
</foreach> |
||||
</if> |
||||
GROUP BY province |
||||
</select> |
||||
|
||||
|
||||
<select id="queryDeviceActivate" resultType="java.lang.Integer"> |
||||
select count(1) from ( |
||||
select imei from device_info where audit_status ='2' and del_flag='1' |
||||
<if test="dto.firmId !=null and dto.firmId !=''"> |
||||
and firm_id=#{dto.firmId} |
||||
</if> |
||||
<if test="dto.agentId !=null and dto.agentId !=''"> |
||||
and agent_id=#{dto.agentId} |
||||
</if> |
||||
) d |
||||
INNER JOIN latest_location_app a on d.imei =a.imei |
||||
</select> |
||||
|
||||
|
||||
<select id="queryDeviceTodayAdd" resultType="java.lang.Integer"> |
||||
select count(1) from device_info |
||||
where audit_status ='2' and del_flag='1' and DATE_FORMAT(create_time,'%Y-%m-%d') = DATE_FORMAT(now(),'%Y-%m-%d') |
||||
<if test="dto.firmId !=null and dto.firmId !=''"> |
||||
and firm_id=#{dto.firmId} |
||||
</if> |
||||
<if test="dto.agentId !=null and dto.agentId !=''"> |
||||
and agent_id=#{dto.agentId} |
||||
</if> |
||||
|
||||
</select> |
||||
|
||||
|
||||
<select id="queryFirmInputCountDevice" resultType="java.lang.String"> |
||||
select imei from device_info where audit_status='2' and del_flag='1' |
||||
<if test="firmId != null and firmId !=''"> |
||||
and firm_id= #{firmId} |
||||
</if> |
||||
<if test="agentId != null and agentId != ''"> |
||||
and agent_id= #{agentId} |
||||
</if> |
||||
</select> |
||||
|
||||
<select id="queryFirmActivateCountDevice" resultType="java.lang.Integer"> |
||||
select COUNT(1) from( |
||||
( select imei from device_info where audit_status='2' and del_flag='1' |
||||
<if test="firmId != null and firmId !=''"> |
||||
and firm_id= #{firmId} |
||||
</if> |
||||
<if test="agentId != null and agentId != ''"> |
||||
and agent_id= #{agentId} |
||||
</if> |
||||
) d |
||||
INNER JOIN latest_location_app a on d.imei =a.imei |
||||
) |
||||
|
||||
</select> |
||||
<select id="queryByCountryOrProvince" resultType="com.ecell.internationalize.system.entity.dto.LocationFindDto"> |
||||
select imei,longitude,latitude,country,province from latest_location_app where 1=1 |
||||
<if test=" type =='1'.toString() "> |
||||
and country=#{countryOrProvince} |
||||
</if> |
||||
<if test=" type =='2'.toString() "> |
||||
and province=#{countryOrProvince} |
||||
</if> |
||||
<if test="iMeiList!=null and iMeiList.size>0"> |
||||
and imei in |
||||
<foreach collection="iMeiList" item="iMeiList" open="(" close=")" separator=","> |
||||
#{iMeiList} |
||||
</foreach> |
||||
</if> |
||||
</select> |
||||
|
||||
<select id="initInputBach" resultType="com.ecell.internationalize.system.entity.DeviceInfo"> |
||||
select input_batch,firm_id,agent_id,create_user,create_time from device_info where audit_status='1' and del_flag='1' |
||||
group by input_batch |
||||
order by input_batch DESC; |
||||
|
||||
</select> |
||||
|
||||
</mapper> |
Loading…
Reference in new issue