Commit 058963b6 authored by maoying's avatar maoying

合并电力站端代码

parents a32d0d83 26ed17dc
......@@ -81,9 +81,13 @@ public class EquipmentIndexVO {
@ApiModelProperty(value = "网关标识")
private String gatewayId;
@ApiModelProperty(value = "是否是告警设备")
private String isAlarm;
@ApiModelProperty(value = "装备名称")
private String equipmentSpecificName;
@ApiModelProperty(value = "指标名称")
@ApiModelProperty(value = "装备指标名称")
private String equipmentIndexName;
}
......@@ -7,36 +7,54 @@ import java.util.List;
public enum PressurePumpEnum {
ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC", "", LocalDateTime.now().getSecond() + " " + (LocalDateTime.now().getMinute()) + "/5 * * * ?", "5",
PressurePumpValueEnum.PUMP_START_TIME.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode(), "【5】分钟"),
ALONE_START_QT("FHS_PressurePump_Start_ALONE_START_QT", PressurePumpCheckEnum.LE.getCode(), "", "5",
PressurePumpValueEnum.LAST_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【5】分钟"),
ALONE_STOP_QT("FHS_PressurePump_Stop_ALONE_STOP_QT", PressurePumpCheckEnum.GE.getCode(), "5", "",
PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode(), "【5】分钟"),
PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【5】分钟"),
ALL_START_QT_WJ("FHS_PressurePump_Start_ALL_START_QT_WJ", PressurePumpCheckEnum.LE.getCode(), "", "30",
PressurePumpValueEnum.LATELY_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【30】分钟"),
ALONE_START_QT_WJ("FHS_PressurePump_Start_ALONE_START_QT_WJ", PressurePumpCheckEnum.BE.getCode(), "5", "30",
PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【30】分钟"),
ALL_START_QT_YZ("FHS_PressurePump_Start_ALL_START_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60",
PressurePumpValueEnum.LATELY_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时"),
ALONE_START_QT_YZ("FHS_PressurePump_Start_ALONE_START_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60",
PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时"),
ALL_START_QT_YB("FHS_PressurePump_Start_ALL_START_QT_YB", PressurePumpCheckEnum.BE.getCode(), "60", "240",
PressurePumpValueEnum.LATELY_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YB.getCode(), "【4】小时"),
ALL_START_QT_WJ("FHS_PressurePump_Start_ALL_START_QT_WJ", PressurePumpCheckEnum.LE.getCode(), "", "5",
PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【5】分钟"),
ALL_STOP_QT_WJ("FHS_PressurePump_Stop_ALL_STOP_QT_WJ", PressurePumpCheckEnum.LE.getCode(), "", "30",
START_QT_WJ_ALL("FHS_PressurePump_Start_ALL_START_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "5", "30",
PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【30】分钟"),
ALL_STOP_QT_YZ("FHS_PressurePump_Stop_ALL_STOP_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60",
PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时"),
ALL_STOP_QT_YB("FHS_PressurePump_Stop_ALL_STOP_QT_YB", PressurePumpCheckEnum.BE.getCode(), "60", "240",
PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YB.getCode(), "【4】小时");
ALL_STOP_QT_YZ("FHS_PressurePump_Start_ALL_STOP_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60",
PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时");
// 备份2023-07-13
// ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC", "", LocalDateTime.now().getSecond() + " " + (LocalDateTime.now().getMinute()) + "/5 * * * ?", "5",
// PressurePumpValueEnum.PUMP_START_TIME.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode(), "【5】分钟"),
//
// ALONE_START_QT("FHS_PressurePump_Start_ALONE_START_QT", PressurePumpCheckEnum.LE.getCode(), "", "5",
// PressurePumpValueEnum.LAST_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【5】分钟"),
//
// ALONE_STOP_QT("FHS_PressurePump_Stop_ALONE_STOP_QT", PressurePumpCheckEnum.GE.getCode(), "5", "",
// PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode(), "【5】分钟"),
//
// ALL_START_QT_WJ("FHS_PressurePump_Start_ALL_START_QT_WJ", PressurePumpCheckEnum.LE.getCode(), "", "30",
// PressurePumpValueEnum.LATELY_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【30】分钟"),
//
// ALL_START_QT_YZ("FHS_PressurePump_Start_ALL_START_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60",
// PressurePumpValueEnum.LATELY_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时"),
//
// ALL_START_QT_YB("FHS_PressurePump_Start_ALL_START_QT_YB", PressurePumpCheckEnum.BE.getCode(), "60", "240",
// PressurePumpValueEnum.LATELY_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YB.getCode(), "【4】小时"),
//
// ALL_STOP_QT_WJ("FHS_PressurePump_Stop_ALL_STOP_QT_WJ", PressurePumpCheckEnum.LE.getCode(), "", "30",
// PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【30】分钟"),
//
// ALL_STOP_QT_YZ("FHS_PressurePump_Stop_ALL_STOP_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60",
// PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时"),
//
// ALL_STOP_QT_YB("FHS_PressurePump_Stop_ALL_STOP_QT_YB", PressurePumpCheckEnum.BE.getCode(), "60", "240",
// PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YB.getCode(), "【4】小时");
private String code;
private String operator;
......
......@@ -5,7 +5,7 @@ public enum PressurePumpValueEnum {
LAST_STOP("lastStop", "上次停泵时间"),
LAST_START("lastStart", "上次启泵时间"),
LATELY_STOP("latelyStop", "所有泵最近一次停泵时间"),
PUMP_START_TIME("pumpStartTime", "计算启动时"),
PUMP_START_TIME("pumpStartTime", "计算启动时"),
LATELY_START("latelyStart", "所有泵最近一次启泵时间");
private String code;
......
......@@ -46,4 +46,7 @@ public class OrganizationUser extends BaseEntity {
@ApiModelProperty(value = "排序")
private int sort;
@ApiModelProperty(value = "是否是值长")
private boolean dutyLeader;
}
......@@ -8,9 +8,13 @@ public interface IOrganizationUserService {
OrganizationUser updateModelById(OrganizationUser organizationUser);
void updateModelByTel(OrganizationUser organizationUser);
OrganizationUser getDetailsById(Long id);
IPage<OrganizationUser> getListPage(int pageNumber, int pageSize, Long id);
IPage<OrganizationUser> getPage(int pageNumber, int pageSize, String tel);
int deleteById(Long id);
}
......@@ -17,58 +17,7 @@
LIMIT 5
</select>
<select id="getTeamLeader" resultType="Map">
SELECT
(
SELECT
Ifnull (GROUP_CONCAT( cou.biz_org_name ),'') AS value
FROM
(
SELECT
cdfi.field_value AS userId
FROM
cb_dynamic_form_instance cdfi
WHERE
cdfi.instance_id IN (
SELECT
cdps.instance_id
FROM
cb_duty_person_shift cdps
LEFT JOIN cb_dynamic_form_instance cdfi ON cdps.instance_id = cdfi.instance_id
WHERE
cdfi.field_code = 'postType'
AND field_value = '1676'
AND cdps.duty_date = ( SELECT DATE_FORMAT(NOW(),"%Y-%m-%d"))
)
AND cdfi.field_code = 'userId'
) temp
LEFT JOIN cb_org_usr cou ON cou.sequence_nbr = temp.userId WHERE cou.is_delete = 0
) AS value,
(
SELECT
Ifnull(GROUP_CONCAT( dfi.field_value ),'') AS tel
FROM
(
SELECT
cdfi.field_value AS userId
FROM
cb_dynamic_form_instance cdfi
WHERE
cdfi.instance_id IN (
SELECT
cdps.instance_id
FROM
cb_duty_person_shift cdps
LEFT JOIN cb_dynamic_form_instance cdfi ON cdps.instance_id = cdfi.instance_id
WHERE
cdfi.field_code = 'postType'
AND field_value = '1676'
AND cdps.duty_date = ( SELECT DATE_FORMAT(NOW(),"%Y-%m-%d"))
)
AND cdfi.field_code = 'userId'
) temp
LEFT JOIN cb_dynamic_form_instance dfi ON dfi.instance_id = temp.userId WHERE dfi.field_code = 'telephone'
) AS tel,
'当值值长' AS name
SELECT cou.member_name AS `value`, cou.telephone AS tel, '当值值长' AS `name` FROM cb_organization_user cou WHERE cou.duty_leader = true LIMIT 1
</select>
<select id="getOrganizationList" resultType="java.util.Map">
SELECT
......
......@@ -99,10 +99,10 @@ public class FireFightingSystemController extends AbstractBaseController {
@Autowired
EquipmentSpecificIndexMapper equipmentSpecificIndexMapper;
@Autowired
ICarService carService;
@RequestMapping(value = "/getEquiplistBySystemId", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("根据系统id查询设备列表")
......@@ -533,7 +533,7 @@ public class FireFightingSystemController extends AbstractBaseController {
equipmentCategory = equipmentCategoryService.getById(equipmentCategory.getParentId());
}
}
return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode().replaceAll("0+$", ""), equipTypeAmountPage);
return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode(), equipTypeAmountPage);
//String classificationCode = equipTypeAmountPage.getEquipmentClassificationCode().replaceAll("0+$", "");
//return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, classificationCode.length() % 2 == 0 ? classificationCode : classificationCode + "0", equipTypeAmountPage);
......@@ -877,7 +877,7 @@ public class FireFightingSystemController extends AbstractBaseController {
}
/**
* 获取人员部门树7
* 获取人员部门树7
*
* @return list
*/
......@@ -948,7 +948,7 @@ public class FireFightingSystemController extends AbstractBaseController {
/**
* 获取装备类型和统计值
* @throws Exception
* @throws Exception
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取装备类型和统计值", notes = "获取装备类型和统计值")
......@@ -956,10 +956,10 @@ public class FireFightingSystemController extends AbstractBaseController {
public Object getEquipmentTypeAndCount( @RequestParam(required = false) String bizOrgCode) throws Exception {
return fireFightingSystemService.getEquipmentTypeAndCount(bizOrgCode);
}
/**
* 获取车辆类型和统计值
* @throws Exception
* @throws Exception
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取车辆类型和统计值", notes = "获取车辆类型和统计值")
......@@ -1018,7 +1018,7 @@ public class FireFightingSystemController extends AbstractBaseController {
public Object getSystemAlarmInfoList(@RequestParam(required = false) String startDate, @RequestParam(required = false) String endDate) throws Exception {
return fireFightingSystemService.getSystemAlarmInfoList(startDate, endDate);
}
/**
* 重置画布数据
*
......
......@@ -19,6 +19,4 @@ public interface VideoImportantEquipmentMapper extends BaseMapper<VideoImportant
List<VideoImportantEquipmentVo> getVideoList(Map<String, Object> map);
List<String> getVideoAddressGroupList(Map<String, Object> map);
}
......@@ -2,12 +2,15 @@ package com.yeejoin.equipmanage.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.equipmanage.common.dto.EquiplistSpecificBySystemESVO;
import com.yeejoin.equipmanage.common.entity.EquipmentIndex;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.dto.EquipmentAlarmLogDto;
import com.yeejoin.equipmanage.common.exception.BaseException;
import com.yeejoin.equipmanage.dao.ESequiplistSpecificBySystemRepository;
import com.yeejoin.equipmanage.mapper.EquipmentIndexMapper;
import com.yeejoin.equipmanage.service.IESeqService;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
......@@ -46,7 +49,8 @@ public class ESeqServiceImpl implements IESeqService {
@Autowired
private ESequiplistSpecificBySystemRepository esequiplistSpecificBySystemRepository;
@Autowired
private EquipmentIndexMapper equipmentIndexMapper;
@Value("${es.ESEquiplistSpecific.flag}")
private Boolean flag;
......@@ -101,9 +105,14 @@ public class ESeqServiceImpl implements IESeqService {
Date daf =new Date(equiplistSpecificBySystemESVO.getTime());
String time=ft.format(daf);
da.setTime(time);
String value=equiplistSpecificBySystemESVO.getValue();
value= getReadableStatus(value );
da.setContent(equiplistSpecificBySystemESVO.getEquipmentIndexName()+":"+value);
// String value=equiplistSpecificBySystemESVO.getValue();
// value= getReadableStatus(value );
// da.setContent(equiplistSpecificBySystemESVO.getEquipmentIndexName()+":"+value);
QueryWrapper<EquipmentIndex> wrapper = new QueryWrapper<>();
wrapper.eq("name_key", equiplistSpecificBySystemESVO.getEquipmentIndexKey());
wrapper.last("limit 1");
EquipmentIndex index = equipmentIndexMapper.selectOne(wrapper);
da.setContent(index.getTypeName());
list.add(da);
}
pageBean.setRecords(list);
......
......@@ -201,6 +201,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Value("classpath:/json/equipmentCode.json")
private Resource equipmentCode;
@Value("${equipment.pressurepump.start}")
private String pressurePumpStart;
private final String injection = "{\n" +
"\n" +
......@@ -1924,17 +1927,18 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
if (!ObjectUtils.isEmpty(equipmentSpecificIndex)) {
IotIndexInfoVo iotIndexInfoVo = new IotIndexInfoVo();
iotIndexInfoVo.setType(equipmentSpecificIndex.getTypeName()!=null?equipmentSpecificIndex.getTypeName(): equipmentSpecificIndex.getIndexName());
iotIndexInfoVo.setNumber(deviceName);
if (equipmentSpecificIndex.getIsTrend() == 1) {
iotIndexInfoVo.setContent(equipmentSpecificIndex.getIndexName() + entry.getValue() + equipmentSpecificIndex.getIndexUnitName());
} else {
iotIndexInfoVo.setContent(equipmentSpecificIndex.getEquipmentIndexName());
if (pressurePumpStart.equals(equipmentSpecificIndex.getNameKey())) {
iotIndexInfoVo.setContent(TrueOrFalseEnum.real.value.equals(entry.getValue()) ? equipmentSpecificIndex.getEquipmentIndexName() : PressurePumpRelateEnum.STOP.getDesc());
} else {
iotIndexInfoVo.setContent(equipmentSpecificIndex.getEquipmentIndexName());
}
}
iotIndexInfoVo.setSendTime(dateStr);
infoVoList.add(iotIndexInfoVo);
}
......
......@@ -7,12 +7,7 @@ import com.yeejoin.equipmanage.mapper.VideoImportantEquipmentMapper;
import com.yeejoin.equipmanage.service.IVideoImportantEquipmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -33,19 +28,12 @@ public class VideoImportantEquipmentServiceImpl extends ServiceImpl<VideoImporta
@Override
public List<Map<String, List<VideoImportantEquipmentVo>>> getVideoList(Map<String, Object> map) {
ArrayList<Map<String, List<VideoImportantEquipmentVo>>> maps = new ArrayList<>();
List<VideoImportantEquipmentVo> videoList = videoImportantEquipmentMapper.getVideoList(map);
List<String> videoAddressGroupList = videoImportantEquipmentMapper.getVideoAddressGroupList(map);
for (String address : videoAddressGroupList) {
if (!ObjectUtils.isEmpty(address)) {
List<VideoImportantEquipmentVo> collect = videoList.stream().filter(item -> item.getAddress().equals(address)).collect(Collectors.toList());
if (collect.size() > 0) {
HashMap<String, List<VideoImportantEquipmentVo>> listMap = new HashMap<>();
listMap.put(address, collect);
maps.add(listMap);
}
}
}
return maps;
return videoList.stream()
.collect(Collectors.groupingBy(VideoImportantEquipmentVo::getAddress,LinkedHashMap::new,Collectors.toList()))
.entrySet().stream()
.map(entry -> Collections.singletonMap(entry.getKey(), entry.getValue()))
.collect(Collectors.toList());
}
}
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jcs.api.entity.Organization;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrganizationUser;
import com.yeejoin.amos.boot.module.jcs.api.mapper.OrganizationMapper;
......@@ -51,6 +52,18 @@ public class OrganizationUserController extends BaseController {
return ResponseHelper.buildResponse(organizationUserService.updateModelById(organizationUser));
}
/**
* 编辑应急小组成员
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/updateByTel", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "编辑应急小组成员", notes = "编辑应急小组成员")
public ResponseModel updateModelByTel(@RequestBody OrganizationUser organizationUser){
organizationUserService.updateModelByTel(organizationUser);
return CommonResponseUtil.success();
}
@GetMapping(value = "/getDetailsById")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "获取详情", notes = "获取详情")
......@@ -66,6 +79,15 @@ public class OrganizationUserController extends BaseController {
return ResponseHelper.buildResponse(organizationUserService.getListPage(pageNumber, pageSize, id));
}
@GetMapping(value = "/page")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "卡片值长列表", notes = "卡片值长列表")
public ResponseModel<IPage<OrganizationUser>> getPage(@RequestParam(value = "pageNumber", required = false) int pageNumber,
@RequestParam(value = "pageSize", required = false) int pageSize,
@RequestParam(value = "tel", required = false) String tel) {
return ResponseHelper.buildResponse(organizationUserService.getPage(pageNumber, pageSize, tel));
}
@GetMapping(value = "/deleteById")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "删除", notes = "根据id删除")
......
......@@ -53,7 +53,7 @@ public class OrganizationImpl extends BaseService<Organization, Organization, Or
} else {
// 跟现场确认此处值长只有一人,所以只做一人处理
leaderMap.put("name", resMap.get("name") + " " + "1人");
leaderMap.put("value", resMap.get("value") + "-" + resMap.get("tel"));
leaderMap.put("value", resMap.get("value") + ( ObjectUtils.isNotEmpty(resMap.get("tel")) ? "-" + resMap.get("tel") : "" ));
}
res.add(leaderMap);
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.util.StringUtil;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrganizationUser;
import com.yeejoin.amos.boot.module.jcs.api.mapper.OrganizationUserMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IOrganizationUserService;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class OrganizationUserImpl extends BaseService<OrganizationUser,OrganizationUser, OrganizationUserMapper> implements IOrganizationUserService {
@Override
......@@ -24,6 +30,31 @@ public class OrganizationUserImpl extends BaseService<OrganizationUser,Organizat
}
@Override
public void updateModelByTel(OrganizationUser organizationUser) {
QueryWrapper<OrganizationUser> oldQuery = new QueryWrapper<>();
oldQuery.eq("duty_leader", 1);
List<OrganizationUser> oldList = this.baseMapper.selectList(oldQuery);
if (0 < oldList.size()) {
oldList.forEach(x -> {
x.setDutyLeader(false);
this.baseMapper.updateById(x);
});
}
LambdaQueryWrapper<OrganizationUser> wrapper = new LambdaQueryWrapper<>();
if (!ObjectUtils.isEmpty(organizationUser.getTelephone())) {
wrapper.eq(OrganizationUser::getTelephone, organizationUser.getTelephone());
} else if (!ObjectUtils.isEmpty(organizationUser.getSequenceNbr())) {
wrapper.eq(OrganizationUser::getSequenceNbr, organizationUser.getSequenceNbr());
}
List<OrganizationUser> newList = this.baseMapper.selectList(wrapper);
newList.forEach(x -> {
x.setDutyLeader(true);
this.baseMapper.updateById(x);
});
}
@Override
public OrganizationUser getDetailsById(Long id) {
return this.baseMapper.selectById(id);
}
......@@ -44,6 +75,22 @@ public class OrganizationUserImpl extends BaseService<OrganizationUser,Organizat
}
@Override
public IPage<OrganizationUser> getPage(int pageNumber, int pageSize, String tel) {
Page<OrganizationUser> page = new Page<>();
page.setSize(pageSize);
page.setCurrent(pageNumber);
LambdaQueryWrapper<OrganizationUser> wrapper = new LambdaQueryWrapper<>();
if (StringUtil.isNotEmpty(tel)) {
wrapper.eq(OrganizationUser::getTelephone, tel);
}
wrapper.eq(OrganizationUser::getIsDelete, false);
wrapper.orderByDesc(OrganizationUser::getSort);
wrapper.groupBy(OrganizationUser::getTelephone);
return this.baseMapper.selectPage(page, wrapper);
}
@Override
public int deleteById(Long id) {
return this.baseMapper.deleteById(id);
}
......
......@@ -8,7 +8,7 @@
</parent>
<artifactId>amos-boot-system-equip</artifactId>
<version>3.7.0.9</version>
<version>3.7.1.0</version>
<dependencies>
<dependency>
<groupId>com.amosframework.boot</groupId>
......
......@@ -241,7 +241,9 @@
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE
wes.equipment_code LIKE concat( '920322', '%' )
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
<if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) temp
</select>
......@@ -319,8 +321,10 @@
wl_equipment_specific wes
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE
wes.equipment_code LIKE concat( '921003', '%' )
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
wes.equipment_code LIKE concat( '921003', '%')
<if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' ) UNION
(
SELECT
......@@ -344,7 +348,9 @@
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE
wes.equipment_code LIKE concat( '921002', '%' )
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
<if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) UNION
(
......@@ -369,7 +375,9 @@
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE
wes.equipment_code LIKE concat( '921004', '%' )
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
<if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) UNION
(
......@@ -394,7 +402,9 @@
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE
wes.equipment_code LIKE concat( '921005', '%' )
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
<if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
)
</select>
......
......@@ -727,7 +727,15 @@
(SELECT name from wl_equipment_specific where id = wlesal.equipment_specific_id) AS fireEquipmentName,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
(
SELECT
type_name
FROM
wl_signal_classify sc
WHERE
sc.type_code = wlesal.type
LIMIT 1
) AS fireEquipmentSpecificIndexName,
if(wlesal.confirm_type IS NULL, 0, 1) AS confirmType,
if(wlesal.clean_time IS NULL, 0, 1) AS cleanStatus,
CASE
......
......@@ -44,18 +44,4 @@
</where>
ORDER BY v.create_date DESC
</select>
<select id="getVideoAddressGroupList" resultType="java.lang.String">
SELECT
v.address
FROM
wl_video v
<where>
<if test="importantEquipmentId != null">
v.id in (select video_id from wl_video_important_equipment
where important_equipment_id = #{importantEquipmentId})
</if>
</where>
GROUP BY v.address
ORDER BY v.create_date DESC
</select>
</mapper>
......@@ -9,7 +9,7 @@
<artifactId>amos-boot-system-jcs</artifactId>
<version>3.7.0.9</version>
<version>3.7.1.0</version>
<dependencies>
<dependency>
......
......@@ -3894,4 +3894,16 @@
</sql>
</changeSet>
<changeSet author="ky" id="2023-07-24">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="cb_organization_user" columnName="duty_leader"/>
</not>
</preConditions>
<comment>cb_organization_user add column</comment>
<sql>
alter table `cb_organization_user` add column `duty_leader` bit(1) NULL DEFAULT b'0' COMMENT '是否是值长'
</sql>
</changeSet>
</databaseChangeLog>
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