Commit 0fe04b5e authored by helinlin's avatar helinlin

Merge remote-tracking branch 'origin/developer' into developer

parents 312014eb 06bada17
...@@ -60,8 +60,11 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> { ...@@ -60,8 +60,11 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
@Param("appKey") String appKey, @Param("appKey") String appKey,
@Param("groupCode") String groupCode @Param("groupCode") String groupCode
); );
List<Map<String, Object>> newStationViewData(
@Param("dutyDate") String dutyDate,
@Param("groupCode") String groupCode
);
/** /**
* 利用mysql 生成连续时间区间 * 利用mysql 生成连续时间区间
* *
...@@ -137,4 +140,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> { ...@@ -137,4 +140,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
List<Map<String, Object>> queryByCompanyId(@Param(value="bizNames") List<String> bizNames); List<Map<String, Object>> queryByCompanyId(@Param(value="bizNames") List<String> bizNames);
List<Map<String, Object>> queryByCompanyNew(String bizOrgName); List<Map<String, Object>> queryByCompanyNew(String bizOrgName);
List<Map<String, Object>> getNewEquipmentForSpecifyDate(String dutyDate,String groupCode,String equipmentId,String equipmentName,String groupByName);
} }
...@@ -30,7 +30,14 @@ public interface IDutyCommonService { ...@@ -30,7 +30,14 @@ public interface IDutyCommonService {
* @return ResponseModel * @return ResponseModel
*/ */
List<Map<String, Object>> statisticsDay(String beginDate, String endDate) throws ParseException; List<Map<String, Object>> statisticsDay(String beginDate, String endDate) throws ParseException;
/**
* 新值班月视图
* @param beginDate
* @param endDate
* @return
* @throws ParseException
*/
List<Map<String, Object>> newStatisticsDay(String beginDate, String endDate) throws ParseException;
/** /**
* 不分页查询 * 不分页查询
* *
......
...@@ -87,6 +87,21 @@ ...@@ -87,6 +87,21 @@
and i.group_code =#{groupCode} and i.group_code =#{groupCode}
GROUP BY i.field_value GROUP BY i.field_value
</select> </select>
<select id="newStationViewData" resultType="java.util.Map">
select
i.field_value as postTypeName,
count(1) as total
from
cb_duty_person_shift s,
cb_dynamic_form_instance i
where
s.instance_id = i.instance_id
and i.field_code = 'postTypeName'
AND s.duty_date = #{dutyDate}
AND s.shift_id is not null
and i.group_code =#{groupCode}
GROUP BY i.field_value
</select>
<select id="genRangeDate" resultType="map"> <select id="genRangeDate" resultType="map">
SELECT SELECT
DATE_FORMAT(DATE( DATE_ADD( #{beginDate}, INTERVAL @s DAY )),'%Y-%m-%d') AS date, DATE_FORMAT(DATE( DATE_ADD( #{beginDate}, INTERVAL @s DAY )),'%Y-%m-%d') AS date,
...@@ -187,6 +202,50 @@ select * from ( ...@@ -187,6 +202,50 @@ select * from (
group by ${groupByName} group by ${groupByName}
</if> </if>
</select> </select>
<select id='getNewEquipmentForSpecifyDate' resultType='map'>
select * from (
SELECT
MAX(
CASE
WHEN cd.FIELD_CODE = #{equipmentId} THEN
cd.FIELD_VALUE
END
) AS #{equipmentId},
MAX(
CASE
WHEN cd.FIELD_CODE = 'userName' THEN
cd.FIELD_VALUE
END
) AS 'userName',
MAX(
CASE
WHEN cd.FIELD_CODE = #{equipmentName} THEN
cd.FIELD_VALUE
END
) AS #{equipmentName}
FROM
cb_dynamic_form_instance cd
LEFT JOIN (
SELECT
dp.instance_id,
ds.`name`
FROM
cb_duty_person_shift dp
LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr
WHERE
dp.duty_date = #{dutyDate} and dp.is_delete=0
) cds ON cd.instance_id = cds.instance_id
where cd.group_code =#{groupCode} and cds.instance_id is not null and
cd.is_delete=0
group by cd.instance_id
) result
<if test="groupByName != null and groupByName!='' ">
group by ${groupByName}
</if>
</select>
<select id='getInstanceIdForSpecifyDateAndEquipment' <select id='getInstanceIdForSpecifyDateAndEquipment'
resultType='map'> resultType='map'>
SELECT SELECT
...@@ -288,7 +347,7 @@ FROM ...@@ -288,7 +347,7 @@ FROM
GROUP BY GROUP BY
cd.instance_id cd.instance_id
) ss ) ss
LEFT JOIN ( <!-- LEFT JOIN (
SELECT SELECT
dp.instance_id, dp.instance_id,
ds.`name` ds.`name`
...@@ -301,7 +360,7 @@ LEFT JOIN ( ...@@ -301,7 +360,7 @@ LEFT JOIN (
AND NAME IS NOT NULL AND NAME IS NOT NULL
) cds ON ss.instance_id = cds.instance_id ) cds ON ss.instance_id = cds.instance_id
WHERE WHERE
cds.NAME =#{duty} cds.NAME =#{duty} -->
GROUP BY GROUP BY
ss.postTypeName ss.postTypeName
</select> </select>
......
...@@ -43,5 +43,6 @@ public class BuildingVideoVO { ...@@ -43,5 +43,6 @@ public class BuildingVideoVO {
@ApiModelProperty("详细地址") @ApiModelProperty("详细地址")
private String presetPosition; private String presetPosition;
@ApiModelProperty("视频转码")
private String vedioFormat;
} }
...@@ -28,4 +28,6 @@ public class EquipmentAlarmBySystemIdOrSourceIdVO { ...@@ -28,4 +28,6 @@ public class EquipmentAlarmBySystemIdOrSourceIdVO {
* 告警类型 * 告警类型
*/ */
private String type; private String type;
private Integer cleanStatus;
} }
package com.yeejoin.equipmanage.common.vo;
import lombok.Data;
import java.util.List;
/**
* @ProjectName: amos-biz-boot
* @Package: com.yeejoin.equipmanage.common.vo
* @ClassName: VideoOnEquipmentSpecificVo
* @Author: Jianqiang Gao
* @Description: 摄像头绑定设备
* @Date: 2022/1/7 17:35
* @Version: 1.0
*/
@Data
public class VideoOnEquipmentSpecificVo {
/**
* 设备ID
*/
private Long equipmentSpecificId;
/**
* 摄像头Id集合
*/
private List<Long> videoIdList;
}
\ No newline at end of file
...@@ -94,6 +94,20 @@ public class DutyCarController extends BaseController { ...@@ -94,6 +94,20 @@ public class DutyCarController extends BaseController {
} }
/** /**
* 值班月视图
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/new-statistics-day")
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
) throws ParseException {
return ResponseHelper.buildResponse(iDutyCarService.newStatisticsDay(beginDate, endDate));
}
/**
* 调班 * 调班
* *
* @return ResponseModel * @return ResponseModel
......
...@@ -92,7 +92,20 @@ public class DutyFireFightingController extends BaseController{ ...@@ -92,7 +92,20 @@ public class DutyFireFightingController extends BaseController{
) throws ParseException { ) throws ParseException {
return ResponseHelper.buildResponse(iDutyFireFightingService.statisticsDay(beginDate, endDate)); return ResponseHelper.buildResponse(iDutyFireFightingService.statisticsDay(beginDate, endDate));
} }
/**
* 新值班月视图
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/new-statistics-day")
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
) throws ParseException {
return ResponseHelper.buildResponse(iDutyFireFightingService.newStatisticsDay(beginDate, endDate));
}
/** /**
* 调班 * 调班
* *
......
...@@ -84,7 +84,15 @@ public class DutyFirstAidController extends BaseController{ ...@@ -84,7 +84,15 @@ public class DutyFirstAidController extends BaseController{
) throws ParseException { ) throws ParseException {
return ResponseHelper.buildResponse(iDutyFirstAidService.statisticsDay(beginDate, endDate)); return ResponseHelper.buildResponse(iDutyFirstAidService.statisticsDay(beginDate, endDate));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/new-statistics-day")
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
) throws ParseException {
return ResponseHelper.buildResponse(iDutyFirstAidService.newStatisticsDay(beginDate, endDate));
}
/** /**
* 调班 * 调班
* *
......
...@@ -93,7 +93,20 @@ public class DutyPersonController extends BaseController { ...@@ -93,7 +93,20 @@ public class DutyPersonController extends BaseController {
) throws ParseException { ) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.statisticsDay(beginDate, endDate)); return ResponseHelper.buildResponse(iDutyPersonService.statisticsDay(beginDate, endDate));
} }
/**
* 值班月视图
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/new-duty-detail")
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.newStatisticsDay(beginDate, endDate));
}
/** /**
* 调班 * 调班
...@@ -168,7 +181,14 @@ public class DutyPersonController extends BaseController { ...@@ -168,7 +181,14 @@ public class DutyPersonController extends BaseController {
@ApiParam(value = "岗位") @RequestParam(required = false) String postType) { @ApiParam(value = "岗位") @RequestParam(required = false) String postType) {
return ResponseHelper.buildResponse(iDutyPersonService.dayDutyPersonList(dutyDay, shiftId, postType)); return ResponseHelper.buildResponse(iDutyPersonService.dayDutyPersonList(dutyDay, shiftId, postType));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("新查询指定日期值班人信息列表")
@GetMapping("/new-person/{dutyDay}/list")
public ResponseModel newListDutyPerson(@ApiParam(value = "值班日期", required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType) {
return ResponseHelper.buildResponse(iDutyPersonService.getSchedulingDutyForSpecifyDate(dutyDay, shiftId, postType));
}
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("查询当前值班人信息列表") @ApiOperation("查询当前值班人信息列表")
@GetMapping("/person/on_duty/list") @GetMapping("/person/on_duty/list")
......
...@@ -170,21 +170,23 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -170,21 +170,23 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
if (StringUtils.isNotBlank(instanceId)) { if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(","); String[] instanceIds = instanceId.split(",");
List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay); // List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
if(dutyList!=null && dutyList.size()>0) { // if(dutyList!=null && dutyList.size()>0) {
for (Map<String, Object> dutyDetail : dutyList) { // for (Map<String, Object> dutyDetail : dutyList) {
if(!dutyDetail.containsKey("name")) { // if(!dutyDetail.containsKey("name")) {
continue; // continue;
} // }
// 获取当前装备ID下的排版数据 // 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay, List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay,
this.getGroupCode(), instanceIds,dutyDetail.get("name").toString()); this.getGroupCode(), instanceIds,null);
if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) { if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) {
continue; continue;
} }
LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>(); LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>();
infoMap_1.put(dutyDetail.get("name").toString(), ""); //取消掉班次的显示---2022-01-16 by chenhao ---start
resultList.add(infoMap_1); //infoMap_1.put(dutyDetail.get("name").toString(), "");
//resultList.add(infoMap_1);
//取消掉班次的显示---2022-01-16 by chenhao ---end
for (Map<String, Object> specify : specifyDateList) { for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>(); LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>();
// infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString()); // infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
...@@ -194,32 +196,8 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -194,32 +196,8 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
resultList.add(infoMap_2); resultList.add(infoMap_2);
} }
} }
} // }
} //}
// 获取当前装备ID下的排版数据
// List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getSpecifyDateList(dutyDay,
// this.getGroupCode(), instanceIds,null);
// for (Map<String, Object> specify : specifyDateList) {
//
// if(!specify.containsKey("name") || specify.get("name").toString()==null) {
// continue;
// }
// LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>();
// infoMap_1.put(specify.get("name").toString(), "");
// resultList.add(infoMap_1);
// Map<String, Object> equipmentOperatorMap = dutyPersonShiftMapper.getEquipmentOperator(dutyDay,
// this.getGroupCode(), instanceIds, "消防车驾驶员", specify.get("name").toString());
// String operator =null;
// if (equipmentOperatorMap!=null && equipmentOperatorMap.containsKey("userName")) {
// operator = equipmentOperatorMap.get("equipmentOperatorMap").toString();
// }
// LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>();
// infoMap_2.put("驾驶员", operator!=null?operator:"");
// resultList.add(infoMap_2);
// LinkedHashMap<String, Object> infoMap_3 =new LinkedHashMap<String, Object>();
// infoMap_3.put("战斗员",specify.get("value").toString());
// resultList.add(infoMap_3);
// }
} }
detailList.add(resultList); detailList.add(resultList);
} }
......
...@@ -46,6 +46,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn; ...@@ -46,6 +46,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.enums.DutyViewTypeEnum; import com.yeejoin.amos.boot.module.common.api.enums.DutyViewTypeEnum;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyCommonService; import com.yeejoin.amos.boot.module.common.api.service.IDutyCommonService;
/** /**
...@@ -75,6 +76,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -75,6 +76,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
@Autowired @Autowired
OrgUsrServiceImpl orgUsrService; OrgUsrServiceImpl orgUsrService;
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
/** /**
* 每天单个班次执勤人数全部小于等于3人 * 每天单个班次执勤人数全部小于等于3人
...@@ -213,7 +217,126 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -213,7 +217,126 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
return resultMap; return resultMap;
/*bug2468 值班排班,日历视图单班次执勤人数满足≤3且班次≤2时,值班显示方式错误 陈召 结束*/ /*bug2468 值班排班,日历视图单班次执勤人数满足≤3且班次≤2时,值班显示方式错误 陈召 结束*/
} }
public List<Map<String, Object>> newStatisticsDay(String beginDate, String endDate) throws ParseException {
Date dateBegin = DateUtils.dateParse(beginDate, DateUtils.DATE_PATTERN);
String timeStart = DateUtils.dateTimeToDateString(dateBegin);
Date dateEnd = DateUtils.dateParse(endDate, DateUtils.DATE_PATTERN);
String timeEnd = DateUtils.dateTimeToDateString(dateEnd);
List<String> betweenDate = getBetweenDate(timeStart, timeEnd);
//拿到每一天的视图展示
String beginTime = null;
String endTime = null;
List<Map<String, Object>> viewTypeResult = new ArrayList<>();
for (String time : betweenDate) {
beginTime = time + " 00:00:00";
endTime = time + " 23:59:59";
Map<String, Object> viewTypeMap = new HashMap<>();
viewTypeMap.put("date",time);
viewTypeResult.add(viewTypeMap);
}
List<Map<String, Object>> rangeDate = dutyPersonShiftService.getBaseMapper().genRangeDate(beginDate, endDate);
List<Map<String, Object>> resultMap = new ArrayList<>();
for (Map<String, Object> stringObjectMap : viewTypeResult) {
for (Map<String, Object> objectMap : rangeDate) {
if (stringObjectMap.get("date").equals(objectMap.get("date"))){
Map<String, Object> result = new LinkedHashMap<>();
result.put("key", objectMap.get("date"));
String dateString = objectMap.get("date").toString();
if(this.getGroupCode().equals("dutyPerson")) {
result.put("data", getPersonPostTypeNameAndCount(dateString));
}else if(this.getGroupCode().equals("dutyCar")) {
result.put("data", getCarPostTypeNameAndCount(dateString));
}else if(this.getGroupCode().equals("dutyFireFighting")) {
result.put("data", getFireFightingPostTypeNameAndCount(dateString));
}else if(this.getGroupCode().equals("dutyFirstAid")) {
result.put("data", getFirstAidPostTypeNameAndCount(dateString));
}
resultMap.add(result);
}
}
}
return resultMap;
}
/**
* 排班值班人员的统计类型为:
* 岗位: 岗位人员数量
* @param dutyDate
* @return
*/
public Object getPersonPostTypeNameAndCount(String dutyDate) {
return dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode());
}
/**
* 车辆值班人员左侧的统计: 只有几辆车
* @param dutyDate
* @return
*/
public Object getCarPostTypeNameAndCount(String dutyDate) {
Map<String, Object> map = new HashMap<String, Object>();
int station =0;
int person=0;
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDate,
this.getGroupCode(), "carId", "carName", "teamName","result.carId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
station =0;
}else {
station=equipmentList.size();
}
map.put("station", station);
List<Map<String, Object>> list = dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode());
for (Map<String, Object> map2 : list) {
person = person +Integer.parseInt(map2.get("total").toString());
}
map.put("person", person);
return map;
}
public Object getFireFightingPostTypeNameAndCount(String dutyDate) {
Map<String, Object> map = new HashMap<String, Object>();
int station =0;
int person=0;
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDate,
this.getGroupCode(), "fireFightingId", "fireFighting", "teamName","result.fireFightingId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
station =0;
}else {
station=equipmentList.size();
}
map.put("station", station);
List<Map<String, Object>> list = dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode());
for (Map<String, Object> map2 : list) {
person = person +Integer.parseInt(map2.get("total").toString());
}
map.put("person", person);
return map;
}
public Object getFirstAidPostTypeNameAndCount(String dutyDate) {
Map<String, Object> map = new HashMap<String, Object>();
int station =0;
int person=0;
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDate,
this.getGroupCode(), "firstAidId", "firstAid", "teamName", "result.firstAidId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
station =0;
}else {
station=equipmentList.size();
}
map.put("station", station);
List<Map<String, Object>> list = dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode());
for (Map<String, Object> map2 : list) {
person = person +Integer.parseInt(map2.get("total").toString());
}
map.put("person", person);
return map;
}
private Object buildViewData(DutyViewTypeEnum viewTypeEnum, String dutyDate, String appKey) { private Object buildViewData(DutyViewTypeEnum viewTypeEnum, String dutyDate, String appKey) {
List<Map<String, Object>> result = new ArrayList<>(); List<Map<String, Object>> result = new ArrayList<>();
switch (viewTypeEnum) { switch (viewTypeEnum) {
......
package com.yeejoin.amos.boot.module.common.biz.service.impl; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import static org.hamcrest.CoreMatchers.nullValue;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
...@@ -15,7 +13,6 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -15,7 +13,6 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto; import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto; import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
...@@ -85,29 +82,29 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement ...@@ -85,29 +82,29 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
if (StringUtils.isNotBlank(instanceId)) { if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(","); String[] instanceIds = instanceId.split(",");
List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay); // List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
if(dutyList!=null && dutyList.size()>0) { // if(dutyList!=null && dutyList.size()>0) {
for (Map<String, Object> dutyDetail : dutyList) { // for (Map<String, Object> dutyDetail : dutyList) {
if(!dutyDetail.containsKey("name")) { // if(!dutyDetail.containsKey("name")) {
continue; // continue;
} // }
// 获取当前装备ID下的排版数据 // 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay, List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay,
this.getGroupCode(), instanceIds,dutyDetail.get("name").toString()); this.getGroupCode(), instanceIds,null);
if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) { if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) {
continue; continue;
} }
LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>(); // LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>();
infoMap_1.put(dutyDetail.get("name").toString(), ""); // infoMap_1.put(dutyDetail.get("name").toString(), "");
resultList.add(infoMap_1); // resultList.add(infoMap_1);
for (Map<String, Object> specify : specifyDateList) { for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>(); LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>();
if( specify.containsKey("postTypeName")&& specify.get("postTypeName")!=null && specify.containsKey("userName")&& specify.get("userName")!=null ) { if( specify.containsKey("postTypeName")&& specify.get("postTypeName")!=null && specify.containsKey("userName")&& specify.get("userName")!=null ) {
infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString()); infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
resultList.add(infoMap_2); resultList.add(infoMap_2);
} }
} // }
} // }
} }
} }
detailList.add(resultList); detailList.add(resultList);
......
...@@ -18,8 +18,6 @@ import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; ...@@ -18,8 +18,6 @@ import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper; import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService; import com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService;
import ch.qos.logback.core.joran.conditional.IfAction;
@Service @Service
public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements IDutyFirstAidService { public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements IDutyFirstAidService {
...@@ -67,15 +65,15 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID ...@@ -67,15 +65,15 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
} }
List<Object> detailList = new ArrayList<Object>(); List<Object> detailList = new ArrayList<Object>();
for (Map<String, Object> map : equipmentList) { for (Map<String, Object> map : equipmentList) {
List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>(); List<Object> resultList = new ArrayList<Object>();
LinkedHashMap<String, Object> titleMap_1 = new LinkedHashMap<String, Object>(); //LinkedHashMap<String, Object> titleMap_1 = new LinkedHashMap<String, Object>();
titleMap_1.put("120急救站", map.get("firstAid").toString()); //titleMap_1.put("120急救站", map.get("firstAid").toString());
resultList.add(titleMap_1); resultList.add( map.get("firstAid").toString());
LinkedHashMap<String, Object> titleMap_2 = new LinkedHashMap<String, Object>(); // LinkedHashMap<String, Object> titleMap_2 = new LinkedHashMap<String, Object>();
if(map.containsKey("teamName") && map.get("teamName") != null){ // if(map.containsKey("teamName") && map.get("teamName") != null){
titleMap_2.put("单位/部门", map.get("teamName").toString()); // titleMap_2.put("单位/部门", map.get("teamName").toString());
} // }
resultList.add(titleMap_2); // resultList.add(titleMap_2);
String carId = map.get("firstAidId").toString(); String carId = map.get("firstAidId").toString();
Map<String, Object> instanceMap = dutyPersonShiftMapper.getInstanceIdForSpecifyDateAndEquipment(dutyDay, Map<String, Object> instanceMap = dutyPersonShiftMapper.getInstanceIdForSpecifyDateAndEquipment(dutyDay,
this.getGroupCode(), carId); this.getGroupCode(), carId);
...@@ -86,22 +84,22 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID ...@@ -86,22 +84,22 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
if (StringUtils.isNotBlank(instanceId)) { if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(","); String[] instanceIds = instanceId.split(",");
List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay); // List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
if (dutyList != null && dutyList.size() > 0) { // if (dutyList != null && dutyList.size() > 0) {
for (Map<String, Object> dutyDetail : dutyList) { // for (Map<String, Object> dutyDetail : dutyList) {
if (!dutyDetail.containsKey("name")) { // if (!dutyDetail.containsKey("name")) {
continue; // continue;
} // }
// 获取当前装备ID下的排版数据 // 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper
.getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds, .getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds,
dutyDetail.get("name").toString()); null);
if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) { if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) {
continue; continue;
} }
LinkedHashMap<String, Object> infoMap_1 = new LinkedHashMap<String, Object>(); // LinkedHashMap<String, Object> infoMap_1 = new LinkedHashMap<String, Object>();
infoMap_1.put(dutyDetail.get("name").toString(), ""); // infoMap_1.put(dutyDetail.get("name").toString(), "");
resultList.add(infoMap_1); // resultList.add(infoMap_1);
for (Map<String, Object> specify : specifyDateList) { for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 = new LinkedHashMap<String, Object>(); LinkedHashMap<String, Object> infoMap_2 = new LinkedHashMap<String, Object>();
// infoMap_2.put(specify.get("postTypeName").toString(), specify.get("userName").toString()); // infoMap_2.put(specify.get("postTypeName").toString(), specify.get("userName").toString());
...@@ -110,9 +108,9 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID ...@@ -110,9 +108,9 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString()); infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
resultList.add(infoMap_2); resultList.add(infoMap_2);
} }
} // }
//
} // }
} }
} }
detailList.add(resultList); detailList.add(resultList);
......
...@@ -304,7 +304,48 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType ...@@ -304,7 +304,48 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
} }
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getNewEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "deptId", "deptName", "result.deptId");
if (equipmentList == null || equipmentList.size() < 1 || equipmentList.get(0) == null) {
return null;
}
List<Object> detailList = new ArrayList<Object>();
for (Map<String, Object> map : equipmentList) {
List<Object> resultList = new ArrayList<Object>();
LinkedHashMap<String, Object> titleMap_2 = new LinkedHashMap<String, Object>();
if(map.containsKey("deptName") && map.get("deptName") != null){
resultList.add( map.get("deptName").toString());
}
String carId = map.get("deptId").toString();
Map<String, Object> instanceMap = dutyPersonShiftMapper.getInstanceIdForSpecifyDateAndEquipment(dutyDay,
this.getGroupCode(), carId);
if (instanceMap == null) {
continue;
}
String instanceId = instanceMap.get("instanceIds").toString();
if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(",");
// 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper
.getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds,
null);
if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) {
continue;
}
for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 = new LinkedHashMap<String, Object>();
if( specify.containsKey("postTypeName")&& specify.get("postTypeName")!=null && specify.containsKey("userName")&& specify.get("userName")!=null ) {
infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
resultList.add(infoMap_2);
}
}
}
detailList.add(resultList);
}
return detailList;
}
......
...@@ -211,6 +211,7 @@ public class EquipmentAlarmController extends AbstractBaseController { ...@@ -211,6 +211,7 @@ public class EquipmentAlarmController extends AbstractBaseController {
@RequestParam(value = "buildId", required = false) String buildId, @RequestParam(value = "buildId", required = false) String buildId,
// @RequestParam(value = "equipmentCode", required = false) String equipmentCode, // @RequestParam(value = "equipmentCode", required = false) String equipmentCode,
@RequestParam(value = "id", required = false) String id, @RequestParam(value = "id", required = false) String id,
@RequestParam(value = "cleanStatus", required = false) String cleanStatus,
CommonPageable commonPageable) { CommonPageable commonPageable) {
List<CommonRequest> queryRequests = new ArrayList<>(); List<CommonRequest> queryRequests = new ArrayList<>();
CommonRequest request = new CommonRequest(); CommonRequest request = new CommonRequest();
...@@ -250,6 +251,10 @@ public class EquipmentAlarmController extends AbstractBaseController { ...@@ -250,6 +251,10 @@ public class EquipmentAlarmController extends AbstractBaseController {
request10.setName("id"); request10.setName("id");
request10.setValue(StringUtil.isNotEmpty(id) ? StringUtils.trimToNull(id) : null); request10.setValue(StringUtil.isNotEmpty(id) ? StringUtils.trimToNull(id) : null);
queryRequests.add(request10); queryRequests.add(request10);
CommonRequest request11 = new CommonRequest();
request11.setName("cleanStatus");
request11.setValue(StringUtil.isNotEmpty(cleanStatus) ? StringUtils.trimToNull(cleanStatus) : null);
queryRequests.add(request11);
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable); CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
org.springframework.data.domain.Page<AlarmListDataVO> list = iEquipmentSpecificAlarmService.listAlarmsPage(param); org.springframework.data.domain.Page<AlarmListDataVO> list = iEquipmentSpecificAlarmService.listAlarmsPage(param);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
......
package com.yeejoin.equipmanage.controller; package com.yeejoin.equipmanage.controller;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.equipmanage.common.dto.EquipmentSpecificDto; import com.yeejoin.equipmanage.common.dto.EquipmentSpecificDto;
import com.yeejoin.equipmanage.common.entity.EquipmentDetail; import com.yeejoin.equipmanage.common.entity.EquipmentDetail;
...@@ -29,16 +7,28 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecific; ...@@ -29,16 +7,28 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO; import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO;
import com.yeejoin.equipmanage.common.entity.dto.SourceNameListDTO; import com.yeejoin.equipmanage.common.entity.dto.SourceNameListDTO;
import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO; import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO;
import com.yeejoin.equipmanage.common.entity.vo.DetailPaneVO;
import com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO; import com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil; import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo; import com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo;
import com.yeejoin.equipmanage.common.vo.VideoOnEquipmentSpecificVo;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper; import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.service.IEquipmentDetailService; import com.yeejoin.equipmanage.service.IEquipmentDetailService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce; import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @author ZeHua Li * @author ZeHua Li
...@@ -153,8 +143,8 @@ public class EquipmentSpecificController extends AbstractBaseController { ...@@ -153,8 +143,8 @@ public class EquipmentSpecificController extends AbstractBaseController {
@RequestMapping(value = "/getOneCard", method = RequestMethod.GET) @RequestMapping(value = "/getOneCard", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "组装组态使用装备卡片数据") @ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "组装组态使用装备卡片数据")
public Object getOneCard(Long id , String type) { public Object getOneCard(Long id, String type) {
return equipmentSpecificSerivce.getOneCard(id , type); return equipmentSpecificSerivce.getOneCard(id, type);
} }
/** /**
...@@ -240,31 +230,33 @@ public class EquipmentSpecificController extends AbstractBaseController { ...@@ -240,31 +230,33 @@ public class EquipmentSpecificController extends AbstractBaseController {
/** /**
* 根据specificId删除装备相关数据 * 根据specificId删除装备相关数据
*
* @param specificId id * @param specificId id
* @return ResponseModel * @return ResponseModel
*/ */
@DeleteMapping(value = "/delEquipmentBySpecificId") @DeleteMapping(value = "/delEquipmentBySpecificId")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation( value = "删除装备相关所有数据", notes = "删除装备相关所有数据") @ApiOperation(value = "删除装备相关所有数据", notes = "删除装备相关所有数据")
public ResponseModel delEquipmentBySpecificId(@RequestParam Long specificId) { public ResponseModel delEquipmentBySpecificId(@RequestParam Long specificId) {
return CommonResponseUtil.success(equipmentSpecificSerivce.delEquipmentBySpecificId(specificId)); return CommonResponseUtil.success(equipmentSpecificSerivce.delEquipmentBySpecificId(specificId));
} }
/** /**
* 根据specificIds删除装备相关数据 * 根据specificIds删除装备相关数据
*
* @param specificIds id * @param specificIds id
* @return ResponseModel * @return ResponseModel
*/ */
@DeleteMapping(value = "/delAllEquipmentBySpecificIds") @DeleteMapping(value = "/delAllEquipmentBySpecificIds")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation( value = "批量删除装备相关所有数据", notes = "批量删除装备相关所有数据") @ApiOperation(value = "批量删除装备相关所有数据", notes = "批量删除装备相关所有数据")
public ResponseModel delEquipmentBySpecificId(@RequestBody List<Long> specificIds) { public ResponseModel delEquipmentBySpecificId(@RequestBody List<Long> specificIds) {
if(ObjectUtils.isEmpty(specificIds)){ if (ObjectUtils.isEmpty(specificIds)) {
return CommonResponseUtil.failure("参数为空"); return CommonResponseUtil.failure("参数为空");
} }
specificIds.forEach(specificId->{ specificIds.forEach(specificId -> {
equipmentSpecificSerivce.delEquipmentBySpecificId(specificId); equipmentSpecificSerivce.delEquipmentBySpecificId(specificId);
}); });
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
...@@ -274,4 +266,11 @@ public class EquipmentSpecificController extends AbstractBaseController { ...@@ -274,4 +266,11 @@ public class EquipmentSpecificController extends AbstractBaseController {
public ResponseModel getFessIndexDetails() { public ResponseModel getFessIndexDetails() {
return CommonResponseUtil.success(equipmentSpecificSerivce.getFessIndexDetails()); return CommonResponseUtil.success(equipmentSpecificSerivce.getFessIndexDetails());
} }
@RequestMapping(value = "/videoOnEquipmentSpecific", method = RequestMethod.POST)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "摄像头绑定设备", notes = "摄像头绑定设备")
public ResponseModel videoOnEquipmentSpecific(@RequestBody VideoOnEquipmentSpecificVo videoOnEquipmentSpecificVo) {
return CommonResponseUtil.success(equipmentSpecificSerivce.videoOnEquipmentSpecific(videoOnEquipmentSpecificVo));
}
} }
...@@ -483,7 +483,7 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -483,7 +483,7 @@ public class FireFightingSystemController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "按照组态格式获取系统报警,或者建筑报警列表", notes = "按照组态格式获取系统报警,或者建筑报警列表") @ApiOperation(value = "按照组态格式获取系统报警,或者建筑报警列表", notes = "按照组态格式获取系统报警,或者建筑报警列表")
@GetMapping(value = "/getEquipmentAlarmBySystemIdOrSourceIdVO/{Systemtype}/{id}") @GetMapping(value = "/getEquipmentAlarmBySystemIdOrSourceIdVO/{Systemtype}/{id}")
public IPage<EquipmentAlarmBySystemIdOrSourceIdVO> getEquipmentAlarmBySystemIdOrSourceIdVO(int pageSize, int current, Integer confirmType, String createDate, String type, @PathVariable String Systemtype, @PathVariable Long id) { public IPage<EquipmentAlarmBySystemIdOrSourceIdVO> getEquipmentAlarmBySystemIdOrSourceIdVO(Integer pageSize, Integer current, Integer confirmType, String createDate, String type, @PathVariable String Systemtype, @PathVariable Long id) {
Page<EquipmentAlarmBySystemIdOrSourceIdVO> page = new Page(); Page<EquipmentAlarmBySystemIdOrSourceIdVO> page = new Page();
page.setCurrent(current); page.setCurrent(current);
page.setSize(pageSize); page.setSize(pageSize);
......
...@@ -3,6 +3,9 @@ package com.yeejoin.equipmanage.mapper; ...@@ -3,6 +3,9 @@ package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific; import com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* @author ZeHua Li * @author ZeHua Li
...@@ -11,4 +14,5 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -11,4 +14,5 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface VideoEquipmentSpecificMapper extends BaseMapper<VideoEquipmentSpecific> { public interface VideoEquipmentSpecificMapper extends BaseMapper<VideoEquipmentSpecific> {
List<VideoEquipmentSpecific> findBySpecificIdAndVideoIdIn(@Param("equipmentSpecificId") Long equipmentSpecificId, @Param("list") List<Long> videoIdList);
} }
package com.yeejoin.equipmanage.service; package com.yeejoin.equipmanage.service;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
...@@ -16,14 +12,13 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecific; ...@@ -16,14 +12,13 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex; import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO; import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO;
import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO; import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO;
import com.yeejoin.equipmanage.common.entity.vo.DetailPaneVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo; import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo;
import com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO; import com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO;
import com.yeejoin.equipmanage.common.vo.EquipFor3DVO; import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.common.vo.EquipmentDate;
import com.yeejoin.equipmanage.common.vo.EquipmentDetailVo; import java.util.LinkedHashMap;
import com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo; import java.util.List;
import com.yeejoin.equipmanage.common.vo.EquipmentSpecific3dVo; import java.util.Map;
/** /**
* @author ZeHua Li * @author ZeHua Li
...@@ -168,30 +163,41 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> { ...@@ -168,30 +163,41 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
/** /**
* 根据specificId删除相关数据 * 根据specificId删除相关数据
*
* @param specificId specificId * @param specificId specificId
* @return Boolean * @return Boolean
*/ */
Boolean delEquipmentBySpecificId(Long specificId); Boolean delEquipmentBySpecificId(Long specificId);
/** /**
* 集成页面刷新,发送数据时调用 * 集成页面刷新,发送数据时调用
* @param systemTypeCode *
*/ * @param systemTypeCode
void integrationPageSysDataRefresh(String systemTypeCode); */
void integrationPageSysDataRefresh(String systemTypeCode);
/**
* 更新设备表实时指标状态 /**
* @param indexs * 更新设备表实时指标状态
*/ *
void updateEquipmentSpecIndexRealtimeData(List<EquipmentSpecificIndex> indexs); * @param indexs
*/
void updateEquipmentSpecIndexRealtimeData(List<EquipmentSpecificIndex> indexs);
List<EquipmentSpecificVo> getEquipAndCarIotcodeByIotcode(String iotCode); List<EquipmentSpecificVo> getEquipAndCarIotcodeByIotcode(String iotCode);
/** /**
* 获取中州环境监测指标详情 * 获取中州环境监测指标详情
*
* @return * @return
*/ */
Map<String, List<Map<String, String>>> getFessIndexDetails(); Map<String, List<Map<String, String>>> getFessIndexDetails();
/**
* 设备绑定摄像头
*
* @param videoOnEquipmentSpecificVo
* @return
*/
Boolean videoOnEquipmentSpecific(VideoOnEquipmentSpecificVo videoOnEquipmentSpecificVo);
} }
...@@ -3,10 +3,19 @@ package com.yeejoin.equipmanage.service; ...@@ -3,10 +3,19 @@ package com.yeejoin.equipmanage.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific; import com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific;
import java.util.List;
/** /**
* @author ZeHua Li * @author ZeHua Li
* @date 2020/11/23 15:42 * @date 2020/11/23 15:42
* @since v2.0 * @since v2.0
*/ */
public interface IVideoEquipmentSpecificService extends IService<VideoEquipmentSpecific> { public interface IVideoEquipmentSpecificService extends IService<VideoEquipmentSpecific> {
/**
* 获取设备或摄像头ID绑定集合
* @param equipmentSpecificId
* @param videoIdList
* @return
*/
List<VideoEquipmentSpecific> findBySpecificIdAndVideoIdIn(Long equipmentSpecificId, List<Long> videoIdList);
} }
...@@ -115,6 +115,9 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -115,6 +115,9 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Value("${systemctl.sync.switch}") @Value("${systemctl.sync.switch}")
private Boolean syncSwitch; private Boolean syncSwitch;
@Value("${window.vedioFormat}")
private String vedioFormat;
@Autowired @Autowired
private SourceSceneMapper sourceSceneMapper; private SourceSceneMapper sourceSceneMapper;
...@@ -763,6 +766,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -763,6 +766,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
x.setLocation(x.getAddress()); x.setLocation(x.getAddress());
} }
} }
x.setVedioFormat(vedioFormat);
x.setUrl(videoService.getVideoUrl(x.getName(), x.getPresetPosition(), x.getUrl(), x.getCode())); x.setUrl(videoService.getVideoUrl(x.getName(), x.getPresetPosition(), x.getUrl(), x.getCode()));
}); });
} }
......
...@@ -12,6 +12,9 @@ import java.util.List; ...@@ -12,6 +12,9 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.service.*;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -39,23 +42,6 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; ...@@ -39,23 +42,6 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipment; import com.yeejoin.equipmanage.common.datasync.entity.FireEquipment;
import com.yeejoin.equipmanage.common.dto.EquipmentSpecificDto; import com.yeejoin.equipmanage.common.dto.EquipmentSpecificDto;
import com.yeejoin.equipmanage.common.dto.UserDto; import com.yeejoin.equipmanage.common.dto.UserDto;
import com.yeejoin.equipmanage.common.entity.EquProperty;
import com.yeejoin.equipmanage.common.entity.Equipment;
import com.yeejoin.equipmanage.common.entity.EquipmentCategory;
import com.yeejoin.equipmanage.common.entity.EquipmentDetail;
import com.yeejoin.equipmanage.common.entity.EquipmentIndex;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.EquipmentSystemSourceStatistics;
import com.yeejoin.equipmanage.common.entity.Stock;
import com.yeejoin.equipmanage.common.entity.StockBill;
import com.yeejoin.equipmanage.common.entity.StockBillDetail;
import com.yeejoin.equipmanage.common.entity.StockDetail;
import com.yeejoin.equipmanage.common.entity.UploadFile;
import com.yeejoin.equipmanage.common.entity.Video;
import com.yeejoin.equipmanage.common.entity.Warehouse;
import com.yeejoin.equipmanage.common.entity.WarehouseStructure;
import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO; import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO;
import com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO; import com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO;
import com.yeejoin.equipmanage.common.entity.vo.AlarmInfoVO; import com.yeejoin.equipmanage.common.entity.vo.AlarmInfoVO;
...@@ -85,11 +71,6 @@ import com.yeejoin.equipmanage.common.exception.BaseException; ...@@ -85,11 +71,6 @@ import com.yeejoin.equipmanage.common.exception.BaseException;
import com.yeejoin.equipmanage.common.utils.DateUtils; import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.common.utils.QRCodeUtil; import com.yeejoin.equipmanage.common.utils.QRCodeUtil;
import com.yeejoin.equipmanage.common.utils.StringUtil; import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.EquipFor3DVO;
import com.yeejoin.equipmanage.common.vo.EquipmentDate;
import com.yeejoin.equipmanage.common.vo.EquipmentDetailVo;
import com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo;
import com.yeejoin.equipmanage.common.vo.EquipmentSpecific3dVo;
import com.yeejoin.equipmanage.config.EquipmentIotMqttReceiveConfig; import com.yeejoin.equipmanage.config.EquipmentIotMqttReceiveConfig;
import com.yeejoin.equipmanage.fegin.VideoFeignClient; import com.yeejoin.equipmanage.fegin.VideoFeignClient;
import com.yeejoin.equipmanage.mapper.EquipmentIndexMapper; import com.yeejoin.equipmanage.mapper.EquipmentIndexMapper;
...@@ -97,25 +78,6 @@ import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper; ...@@ -97,25 +78,6 @@ import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper; import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.mapper.UploadFileMapper; import com.yeejoin.equipmanage.mapper.UploadFileMapper;
import com.yeejoin.equipmanage.mapper.VideoMapper; import com.yeejoin.equipmanage.mapper.VideoMapper;
import com.yeejoin.equipmanage.service.IEquPropertyService;
import com.yeejoin.equipmanage.service.IEquipmentCategoryService;
import com.yeejoin.equipmanage.service.IEquipmentDetailService;
import com.yeejoin.equipmanage.service.IEquipmentIndexService;
import com.yeejoin.equipmanage.service.IEquipmentService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce;
import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
import com.yeejoin.equipmanage.service.IEquipmentSystemSourceStatisticsService;
import com.yeejoin.equipmanage.service.IFireFightingSystemService;
import com.yeejoin.equipmanage.service.IStockBillDetailService;
import com.yeejoin.equipmanage.service.IStockBillService;
import com.yeejoin.equipmanage.service.IStockDetailService;
import com.yeejoin.equipmanage.service.IStockService;
import com.yeejoin.equipmanage.service.ISyncDataService;
import com.yeejoin.equipmanage.service.ISystemDicService;
import com.yeejoin.equipmanage.service.IUploadFileService;
import com.yeejoin.equipmanage.service.IVideoService;
import com.yeejoin.equipmanage.service.IWarehouseService;
import com.yeejoin.equipmanage.service.IWarehouseStructureService;
import com.yeejoin.equipmanage.utils.RelationRedisUtil; import com.yeejoin.equipmanage.utils.RelationRedisUtil;
/** /**
...@@ -184,6 +146,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -184,6 +146,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired @Autowired
private IVideoService videoService; private IVideoService videoService;
@Autowired
private IVideoEquipmentSpecificService videoEquipmentSpecificService;
@Value("${systemctl.dict.iot-core-param}") @Value("${systemctl.dict.iot-core-param}")
private String iotCoreParam; private String iotCoreParam;
...@@ -1659,4 +1624,46 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1659,4 +1624,46 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
map.put("tropics", tropicsIndexDetails); map.put("tropics", tropicsIndexDetails);
return map; return map;
} }
@Override
public Boolean videoOnEquipmentSpecific(VideoOnEquipmentSpecificVo videoOnEquipmentSpecificVo) {
Long equipmentSpecificId = videoOnEquipmentSpecificVo.getEquipmentSpecificId();
List<Long> videoIdList = videoOnEquipmentSpecificVo.getVideoIdList();
if (equipmentSpecificId != null && !CollectionUtils.isEmpty(videoIdList)) {
EquipmentSpecific equipmentSpecific = this.baseMapper.selectById(equipmentSpecificId);
if (!ObjectUtils.isEmpty(equipmentSpecific)) {
List<VideoEquipmentSpecific> videoSpecificList = new ArrayList<>();
List<VideoEquipmentSpecific> list = videoEquipmentSpecificService.findBySpecificIdAndVideoIdIn(equipmentSpecificId, videoIdList);
if (!CollectionUtils.isEmpty(list)) {
List<Long> collect = list.stream().map(VideoEquipmentSpecific::getVideoId).collect(Collectors.toList());
// videoIdList - collect
List<Long> reduce = videoIdList.stream().filter(item -> !collect.contains(item)).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(reduce)) {
reduce.parallelStream().forEach(x -> {
VideoEquipmentSpecific videoEquipmentSpecific = new VideoEquipmentSpecific();
videoEquipmentSpecific.setVideoId(x);
videoEquipmentSpecific.setEquipmentSpecificId(equipmentSpecificId);
videoSpecificList.add(videoEquipmentSpecific);
});
videoEquipmentSpecificService.saveBatch(videoSpecificList);
return Boolean.TRUE;
}
} else {
videoIdList.parallelStream().forEach(x -> {
VideoEquipmentSpecific videoEquipmentSpecific = new VideoEquipmentSpecific();
videoEquipmentSpecific.setVideoId(x);
videoEquipmentSpecific.setEquipmentSpecificId(equipmentSpecificId);
videoSpecificList.add(videoEquipmentSpecific);
});
videoEquipmentSpecificService.saveBatch(videoSpecificList);
return Boolean.TRUE;
}
} else {
throw new RuntimeException("未获取到此设备!");
}
} else {
throw new RuntimeException("设备ID或摄像头ID集合为空!");
}
return Boolean.FALSE;
}
} }
...@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific; import com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific;
import com.yeejoin.equipmanage.mapper.VideoEquipmentSpecificMapper; import com.yeejoin.equipmanage.mapper.VideoEquipmentSpecificMapper;
import com.yeejoin.equipmanage.service.IVideoEquipmentSpecificService; import com.yeejoin.equipmanage.service.IVideoEquipmentSpecificService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* @author ZeHua Li * @author ZeHua Li
* @date 2020/11/23 15:43 * @date 2020/11/23 15:43
...@@ -13,4 +16,11 @@ import org.springframework.stereotype.Service; ...@@ -13,4 +16,11 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
public class VideoEquipmentSpecificImpl extends ServiceImpl<VideoEquipmentSpecificMapper,VideoEquipmentSpecific> implements IVideoEquipmentSpecificService { public class VideoEquipmentSpecificImpl extends ServiceImpl<VideoEquipmentSpecificMapper,VideoEquipmentSpecific> implements IVideoEquipmentSpecificService {
@Autowired
private VideoEquipmentSpecificMapper videoEquipmentSpecificMapper;
@Override
public List<VideoEquipmentSpecific> findBySpecificIdAndVideoIdIn(Long equipmentSpecificId, List<Long> videoIdList) {
return videoEquipmentSpecificMapper.findBySpecificIdAndVideoIdIn(equipmentSpecificId, videoIdList);
}
} }
...@@ -403,13 +403,16 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -403,13 +403,16 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
record.setExecuteUserName(userName); record.setExecuteUserName(userName);
record.setExecuteDepartmentId(departmentId); record.setExecuteDepartmentId(departmentId);
record.setExecuteDepartmentName(departmentName); record.setExecuteDepartmentName(departmentName);
record.setFlowJson(flowJson != null ? flowJson.toJSONString() : null);
record.setFlowTaskName(taskName); record.setFlowTaskName(taskName);
record.setDangerId(dangerId); record.setDangerId(dangerId);
record.setExecuteState(executeState); record.setExecuteState(executeState);
record.setExecuteResult(executeResult); record.setExecuteResult(executeResult);
record.setActionFlag(dangerState); record.setActionFlag(dangerState);
record.setRemark(remark); record.setRemark(remark);
if (!ValidationUtil.isEmpty(flowJson)) {
record.setFlowJson(flowJson.toJSONString());
record.setRemark(ValidationUtil.isEmpty(remark) ? flowJson.getString("remark") : remark);
}
record.setUpdateDate(new Date()); record.setUpdateDate(new Date());
latentDangerFlowRecordService.saveOrUpdate(record); latentDangerFlowRecordService.saveOrUpdate(record);
return record; return record;
...@@ -1148,7 +1151,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1148,7 +1151,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
ReginParams reginParams) throws Exception { ReginParams reginParams) throws Exception {
// 隐患的巡查信息 // 隐患的巡查信息
JSONObject bizInfo = latentDanger.getBizInfo(); JSONObject bizInfo = latentDanger.getBizInfo();
if (ValidationUtil.isEmpty(bizInfo) || ValidationUtil.isEmpty(bizInfo.get("planType")) || ValidationUtil.isEmpty(bizInfo.get("accompanyingUserId"))) { if (ValidationUtil.isEmpty(bizInfo) || ValidationUtil.isEmpty(bizInfo.get("planType")) || ValidationUtil.isEmpty(bizInfo.get("leadPeopleId"))) {
executeSubmitDto.setIsOk(false); executeSubmitDto.setIsOk(false);
executeSubmitDto.setMsg("业务信息错误"); executeSubmitDto.setMsg("业务信息错误");
return executeSubmitDto; return executeSubmitDto;
......
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
concat(wlesal.equipment_specific_name,wlesal.equipment_specific_index_name) as alamContent, concat(wlesal.equipment_specific_name,wlesal.equipment_specific_index_name) as alamContent,
if(confirm_type is null,'未处理','已处理') handleStatus, if(confirm_type is null,'未处理','已处理') handleStatus,
IF ( IF (
wlesal.clean_time <![CDATA[<>]]> '', wlesal.clean_time IS NOT NULL,
'已消除', '已消除',
'未消除' '未消除'
) cleanStatus, ) cleanStatus,
...@@ -307,7 +307,7 @@ ...@@ -307,7 +307,7 @@
'去确认' '去确认'
) handleStatus, ) handleStatus,
IF ( IF (
wlesal.clean_time <![CDATA[<>]]> '', wlesal.clean_time IS NOT NULL,
'已消除', '已消除',
'未消除' '未消除'
) cleanStatus, ) cleanStatus,
...@@ -361,6 +361,12 @@ ...@@ -361,6 +361,12 @@
<when test="param.confirmType != null and param.confirmType != '' and param.confirmType == 0"> <when test="param.confirmType != null and param.confirmType != '' and param.confirmType == 0">
AND d.handleType IS NULL AND d.handleType IS NULL
</when> </when>
<when test="param.confirmType != null and param.confirmType != '' and param.confirmType == 2">
AND d.cleanStatus = '未消除'
</when>
<when test="param.confirmType != null and param.confirmType != '' and param.confirmType == 3">
AND d.cleanStatus = '已消除'
</when>
</choose> </choose>
<if test="param.beginDate!=null">AND d.createDate <![CDATA[>=]]> #{param.beginDate}</if> <if test="param.beginDate!=null">AND d.createDate <![CDATA[>=]]> #{param.beginDate}</if>
<if test="param.endDate!=null">AND d.createDate <![CDATA[<=]]> #{param.endDate}</if> <if test="param.endDate!=null">AND d.createDate <![CDATA[<=]]> #{param.endDate}</if>
...@@ -375,6 +381,12 @@ ...@@ -375,6 +381,12 @@
</if> </if>
<if test="param.id!=null and param.id!=''">AND d.fireEquipmentId = #{param.id}</if> <if test="param.id!=null and param.id!=''">AND d.fireEquipmentId = #{param.id}</if>
<if test="param.status!=null and param.status!=3">AND d.status = #{param.status}</if> <if test="param.status!=null and param.status!=3">AND d.status = #{param.status}</if>
<if test="param.cleanStatus != null and param.cleanStatus != '' and param.cleanStatus == 1">AND
d.cleanStatus = '已消除'
</if>
<if test="param.cleanStatus != null and param.cleanStatus != '' and param.cleanStatus == 2">AND
d.cleanStatus = '未消除'
</if>
ORDER BY d.createDate DESC ORDER BY d.createDate DESC
</select> </select>
<select id="getAlarmList" resultType="java.util.HashMap"> <select id="getAlarmList" resultType="java.util.HashMap">
......
...@@ -480,8 +480,10 @@ ...@@ -480,8 +480,10 @@
d.fireEquipmentName, d.fireEquipmentName,
d.warehouseStructureName, d.warehouseStructureName,
d.fireEquipmentSpecificIndexName, d.fireEquipmentSpecificIndexName,
d.createDate,d.confirmType, d.createDate,
d.type d.confirmType,
d.type,
d.cleanStatus
FROM FROM
( (
SELECT SELECT
...@@ -492,7 +494,8 @@ ...@@ -492,7 +494,8 @@
wlesal.equipment_index_id AS fireEquipmentIndexId, wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey, wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName, wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
if(wlesal.confirm_type IS NULL,0,1) AS confirmType, if(wlesal.confirm_type IS NULL, 0, 1) AS confirmType,
if(wlesal.clean_time IS NULL, 0, 1) AS cleanStatus,
CASE CASE
wlesal.equipment_specific_index_value wlesal.equipment_specific_index_value
WHEN 'true' THEN WHEN 'true' THEN
...@@ -540,6 +543,12 @@ ...@@ -540,6 +543,12 @@
<if test='confirmType != null and confirmType == 1'> <if test='confirmType != null and confirmType == 1'>
and wlesal.confirm_type IS NOT NULL and wlesal.confirm_type IS NOT NULL
</if> </if>
<if test='confirmType != null and confirmType == 2'>
and wlesal.clean_time IS NULL
</if>
<if test='confirmType != null and confirmType == 3'>
and wlesal.clean_time IS NOT NULL
</if>
</where> </where>
) d ) d
<where> <where>
......
<?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.yeejoin.equipmanage.mapper.VideoEquipmentSpecificMapper">
<select id="findBySpecificIdAndVideoIdIn" resultType="com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific">
SELECT
v.id,
v.equipment_specific_id AS equipmentSpecificId,
v.video_id AS videoId
FROM
`wl_video_equipment_specific` v
<where>
<if test="equipmentSpecificId != null">
v.equipment_specific_id = #{equipmentSpecificId}
</if>
<if test="list != null and list.size() >0">
AND v.video_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>
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