Commit 3eb72617 authored by tangwei's avatar tangwei

解决冲突

parents 740a9b48 8c2a9bfb
......@@ -63,10 +63,10 @@ public class WaterResourcePoolDto extends BaseDto {
private String recUserName;
@ApiModelProperty(value = "最低报警水位(m)")
private float minWaterLevel;
private Float minWaterLevel;
@ApiModelProperty(value = "最高报警水位(m)")
private float maxWaterLevel;
private Float maxWaterLevel;
@ApiModelProperty("水池液位显示装置id")
private Long levelDeviceId;
......
......@@ -105,8 +105,11 @@
</select>
<select id="pageList" resultType="java.util.Map">
select
d.*
d.*,
jsc.*
from
jc_shift_change jsc
LEFT JOIN
(
select
i.INSTANCE_ID instanceId,
......@@ -130,10 +133,10 @@
</if>
</foreach>
GROUP by
i.INSTANCE_ID) d
i.INSTANCE_ID) d on jsc.instance_id = d.instanceId
<if test="params != null and params.size() > 0">
where
1=1
jsc.is_delete = 0
<foreach collection="params" index="key" item="value" separator="">
<choose>
<when test="fieldCodes[key] == 'like' and value !=null and value !=''">
......@@ -151,6 +154,9 @@
<if test="params.date != null and params.lift == 'descend'">
order by endDate desc
</if>
<if test="params.systemType != null and params.systemType != '' ">
jsc.system_type is not null
</if>
<if test="params.date != null and params.lift == 'ascend'">
order by endDate ASC
</if>
......
......@@ -6,6 +6,7 @@ import javax.persistence.Lob;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.TableName;
import org.hibernate.annotations.Where;
......@@ -16,6 +17,7 @@ import org.hibernate.annotations.Where;
@Table(name = "p_input_item")
@NamedQuery(name = "InputItem.findAll", query = "SELECT c FROM InputItem c")
@Where(clause = "is_delete=0")//表示未删除的数据
@TableName("p_input_item")
public class InputItem extends BasicEntity {
private static final long serialVersionUID = 1L;
......
package com.yeejoin.amos.patrol.dao.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
......@@ -11,6 +13,7 @@ import javax.persistence.Table;
*/
@Entity
@Table(name="p_point_inputitem")
@TableName("p_point_inputitem")
@NamedQuery(name="PointInputItem.findAll", query="SELECT p FROM PointInputItem p")
public class PointInputItem extends BasicEntity{
private static final long serialVersionUID = 1L;
......
......@@ -8,6 +8,8 @@ import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonBackReference;
......@@ -17,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonBackReference;
*/
@Entity
@Table(name="p_route_point_item")
@TableName("p_route_point_item")
@NamedQuery(name="RoutePointItem.findAll", query="SELECT r FROM RoutePointItem r")
public class RoutePointItem extends BasicEntity {
private static final long serialVersionUID = 1L;
......
......@@ -422,17 +422,19 @@ public class CommandController extends BaseController {
QueryWrapper<AirportStand> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("stand_code",alertFormValue.getFieldValue());
AirportStand airportStand = airportStandMapper.selectOne(queryWrapper);
//机位坐标
par.setLatitude(Double.valueOf(airportStand.getLatitude()));
par.setLongitude(Double.valueOf(airportStand.getLongitude()));
}
}
//集结点坐标
par.setLatitudeTwo(alertCalled.getCoordinateX());
par.setLongitudeTwo(alertCalled.getCoordinateY());
break;
case "229":
if (alertCalled.getAlertSourceCode().equals("1326")){
case "229"://一般火灾
par.setLatitude(alertCalled.getCoordinateX());
par.setLongitude(alertCalled.getCoordinateY());
if (alertCalled.getAlertSourceCode().equals("1326")){ //警情来源为物联报警的
result = this.getDetailsById(Long.valueOf(alertCalled.getRelationId()),null,null,null);
par.setLatitudeTwo(alertCalled.getCoordinateX());
par.setLongitudeTwo(alertCalled.getCoordinateY());
......@@ -453,7 +455,7 @@ public class CommandController extends BaseController {
}
ResponseModel<Page<Map<String, Object>>> data = null;
if (ValidationUtil.isEmpty(par.getLatitudeTwo()) ){
if (ValidationUtil.isEmpty(par.getLatitude()) ){
data = equipFeignClient.getVideopagList( String.valueOf((pageNum - 1) * pageSize), pageSize.toString(),par.getBuildingId(),par.getCode(),par.getEquipmentName(),par.getBizOrgCode(),par.getType());
}else {
data = equipFeignClient.pageVideoByAlertType( pageNum, pageSize, par);
......
......@@ -128,14 +128,13 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta
return this.baseMapper.selectList(wrapper);
}
public IPage<Map<String, Object>> pageList(int current, int size, String groupCode) {
public IPage<Map<String, Object>> pageList(int current, int size, String groupCode,String systemType) {
Map<String, String> params = this.getRequestParamMap();
//systemType 不是null 则查询的为120系统交接班
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class);
Page page = new Page();
if (current > 0){
page.setCurrent((long) (current - 1) *size);
}
page.setCurrent(current);
page.setSize(size);
if (!params.isEmpty()&&params !=null){
if (!params.get("sort").isEmpty() && params.get("sort") != null){
......@@ -144,6 +143,7 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta
params.put("lift",sorts[1]);
}
}
return this.getBaseMapper().pageList(page, RequestContext.getAppKey(), fieldCodes, groupCode, params);
}
// 不存在值班数据则不查找 修改sql 方法去除 by kongfm 2021-09-14
......
......@@ -3135,7 +3135,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if (map1.containsKey(fieldCode.substring(0,fieldCode.length()-4))){
dynamicFormInstance.setFieldValueLabel(map1.get(fieldCode.substring(0,fieldCode.length()-4)).toString());
}
if ("birthdayTime".equals(dynamicFormInstance.getFieldCode()) && ObjectUtils.isEmpty(peopleInfoDto.getFirefighters().getBirthdayTime())){
dynamicFormInstance.setFieldValue(null);
}
dynamicFormInstancelist.add(dynamicFormInstance);
});
......
......@@ -171,6 +171,7 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
waterResourceNaturalService.createWithModel(waterResourceNaturalDto);
break;
case "industryPool":
case "waterTank":
case "pool":
// 新增基础信息
model.setIsIot(true);
......
......@@ -104,9 +104,6 @@ public class ShiftChangeController extends BaseController {
public ResponseModel queryForPage(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
if (current >= 1){
current = (current-1)*size;
}
return ResponseHelper.buildResponse(iShiftChangeService.queryForShiftChangePage(current, size));
}
......
......@@ -261,12 +261,20 @@ public class ESAlertCalledService {
boolMustAll.must(qb0);
}
//接警时间,距离当前时间不超过48小时的
long currentTime = System.currentTimeMillis();
currentTime = currentTime - 60 * 60 * 1000*48;
BoolQueryBuilder qb9 = QueryBuilders.boolQuery()
.must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime));
boolMustAll.must(qb9);
BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
//接警时间,距离当前时间不超过半小时的
long currentTime = System.currentTimeMillis();
currentTime = currentTime - 30 * 60 * 1000;
long currentTime2 = System.currentTimeMillis();
currentTime2 = currentTime2 - 30 * 60 * 1000;
BoolQueryBuilder qb1 = QueryBuilders.boolQuery()
.must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime));
.must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime2));
boolMust.should(qb1);
//报警人及报警电话一致
if (!ValidationUtil.isEmpty(alertCalled.getContactUser()) && !ValidationUtil.isEmpty(alertCalled.getContactPhone())) {
......@@ -404,12 +412,20 @@ public class ESAlertCalledService {
}
boolMustAll.must(qb0);
//接警时间,距离当前时间不超过48小时的
long currentTime = System.currentTimeMillis();
currentTime = currentTime - 60 * 60 * 1000*48;
BoolQueryBuilder qb9 = QueryBuilders.boolQuery()
.must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime));
boolMustAll.must(qb9);
BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
//接警时间,距离当前时间不超过半小时的
long currentTime = System.currentTimeMillis();
currentTime = currentTime - 30 * 60 * 1000;
long currentTime2 = System.currentTimeMillis();
currentTime2 = currentTime2 - 30 * 60 * 1000;
BoolQueryBuilder qb1 = QueryBuilders.boolQuery()
.must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime));
.must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime2));
boolMust.should(qb1);
//报警人及报警电话一致
if (!ValidationUtil.isEmpty(alertCalled.getContactUser()) && !ValidationUtil.isEmpty(alertCalled.getContactPhone())) {
......
......@@ -78,6 +78,7 @@ public class RuleAlertCalledService {
// 警情 报送类型
alertCalledRo.setAlertWay(alertWay);
alertCalledRo.setCallTimeStr(alertCalledVo.getAlertCalled().getCallTime().toString());
alertCalledRo.setReplaceContent(replaceContent);
alertCalledRo.setUsIds(usIds);
......
......@@ -4,15 +4,13 @@ import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -98,33 +96,14 @@ public class ShiftChangeServiceImpl extends BaseService<ShiftChangeDto, ShiftCha
@Override
public IPage<Map<String, Object>> queryForShiftChangePage(int current, int size) {
IPage<Map<String, Object>> page = dynamicFormInstanceService.pageList(current,size,GROUP_CODE);
LambdaQueryWrapper<ShiftChange> wrapper = new LambdaQueryWrapper<>();
wrapper.isNull(ShiftChange::getSystemType);
wrapper.eq(BaseEntity::getIsDelete,false);
List<ShiftChange> shiftChanges = this.baseMapper.selectList(wrapper);
Map<Long,ShiftChange> shiftChangeMap = shiftChanges.stream().collect(Collectors.toMap(ShiftChange::getInstanceId, Function.identity()));
page.getRecords().forEach(r->{
//instanceId 必输 所以未进行 null判断
ShiftChange shiftChange = shiftChangeMap.get(Long.parseLong(r.get("instanceId").toString()));
r.putAll(Bean.BeantoMap(shiftChange));
});
IPage<Map<String, Object>> page = dynamicFormInstanceService.pageList(current,size,GROUP_CODE,"");
return page;
}
@Override
public IPage<Map<String, Object>> queryForShiftChangePageByAid(int current, int size) {
IPage<Map<String, Object>> page = dynamicFormInstanceService.pageList(current,size,GROUP_CODE);
LambdaQueryWrapper<ShiftChange> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ShiftChange::getSystemType,"120");
wrapper.eq(BaseEntity::getIsDelete,false);
List<ShiftChange> shiftChanges = this.baseMapper.selectList(wrapper);
Map<Long,ShiftChange> shiftChangeMap = shiftChanges.stream().collect(Collectors.toMap(ShiftChange::getInstanceId, Function.identity()));
page.getRecords().forEach(r->{
//instanceId 必输 所以未进行 null判断
ShiftChange shiftChange = shiftChangeMap.get(Long.parseLong(r.get("instanceId").toString()));
r.putAll(Bean.BeantoMap(shiftChange));
});
IPage<Map<String, Object>> page = dynamicFormInstanceService.pageList(current,size,GROUP_CODE,"1214");
return page;
}
......
package com.yeejoin.amos.patrol.business.controller;
import java.util.*;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.patrol.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.patrol.business.dao.mapper.PointInputItemMapper;
import com.yeejoin.amos.patrol.business.dao.mapper.PointMapper;
import com.yeejoin.amos.patrol.business.dao.mapper.RoutePointItemMapper;
import com.yeejoin.amos.patrol.business.dao.repository.*;
import com.yeejoin.amos.patrol.business.feign.EquipFeign;
import com.yeejoin.amos.patrol.business.feign.JcsFeignClient;
......@@ -22,6 +26,7 @@ import org.springframework.data.domain.PageImpl;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.scheduling.annotation.Async;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
......@@ -104,6 +109,15 @@ public class PointController extends AbstractBaseController {
@Autowired
private IRoutePointItemDao iRoutePointItemDao;
@Autowired
private InputItemMapper inputItemMapper;
@Autowired
private PointInputItemMapper pointInputItemMapper;
@Autowired
private RoutePointItemMapper routePointItemMapper;
/**
*
* 新增接口
......@@ -181,7 +195,7 @@ public class PointController extends AbstractBaseController {
}
@Transactional
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "新增巡查对象", notes = "新增巡查对象")
@PostMapping(value = "/addPointXcdx", produces = "application/json;charset=UTF-8")
......@@ -191,9 +205,6 @@ public class PointController extends AbstractBaseController {
List<RoutePoint> routePointList = iRoutePointDao.queryByPointId(pointClassify.getPointId());
AgencyUserModel user = getUserInfo();
PointClassify newPointClassify = new PointClassify();
List<PointInputItemVo> customInputList = pointClassify.getEquipIputDetailData();//巡检项
if(pointClassify.getId()==null){
newPointClassify.setEquipmentId(pointClassify.getEquipmentId());
newPointClassify.setName(pointClassify.getName());
newPointClassify.setInspectionSpecName(pointClassify.getInspectionName());
......@@ -204,7 +215,6 @@ public class PointController extends AbstractBaseController {
newPointClassify.setDataSourceName(pointClassify.getDataSourceName());
newPointClassify.setAddress(pointClassify.getAddress());
newPointClassify.setBuildingId(pointClassify.getBuildingId());
if(pointClassify.getBuildingName()==null){
FeignClientResult responseModel = equipFeign.getBuildingTreeOne(pointClassify.getBuildingId());
......@@ -225,14 +235,22 @@ public class PointController extends AbstractBaseController {
String uuid= UUID.randomUUID().toString().replace("-","");
newPointClassify.setOriginalId(uuid.substring(0,16));
}
if (null != pointClassify.getId()) {
newPointClassify.setId(pointClassify.getId());
}
newPointClassify.setCategoryCode(pointClassify.getCategoryCode());
newPointClassify.setCategoryName(pointClassify.getCategoryName());
newPointClassify.setCode(pointClassify.getCode());
List<PointInputItemVo> customInputList = pointClassify.getEquipIputDetailData();//巡检项
iPointService.addPointClassifyByPointId(newPointClassify);
List<PointInputItemVo> oldInputItemList = new ArrayList<>();
List<Long> collect = new ArrayList<>();
if(pointClassify.getId()==null){
pointClassify.setId(newPointClassify.getId());
}else{
newPointClassify.setId(pointClassify.getId());
List<PointInputItemVo> oldInputItemList =iPointService.queryOldPointInputItemNew(pointClassify.getPointId(),pointClassify.getId()); // 新的巡检项的补集,即需要删除的项
oldInputItemList =iPointService.queryOldPointInputItemNew(pointClassify.getPointId(),pointClassify.getId()); // 新的巡检项的补集,即需要删除的项
collect = oldInputItemList.stream().map(PointInputItemVo::getPointItemId).collect(Collectors.toList());
List<PointInputItemVo> newInputItemList = new ArrayList<>();
List<PointInputItemVo> classList = pointClassify.getEquipIputDetailData();
newInputItemList.addAll(classList);
......@@ -251,8 +269,9 @@ public class PointController extends AbstractBaseController {
}
});
if (pItemIds.size() > 0) {
iPointInputItemDao.delPointInputItemById(pItemIds);
iRoutePointItemDao.delRoutePointItemByItemId(pItemIds);// 删除p_route_point_item中使用到该项的行
inputItemMapper.delPointInputItemById(pItemIds);
// iPointInputItemDao.delPointInputItemById(pItemIds);
inputItemMapper.delRoutePointItemByItemId(pItemIds);// 删除p_route_point_item中使用到该项的行
}
}
......@@ -264,31 +283,36 @@ public class PointController extends AbstractBaseController {
pointInputItem.setPointId(pointClassify.getPointId());
pointInputItem.setInputItemId(pItemVo.getId());
pointInputItem.setClassifyIds(Long.valueOf(newPointClassify.getId()).toString());
pointInputItem.setId(0);
// pointInputItem.setId(0);
pointInputItem.setOrderNo(pItemVo.getpOrderNo());
PointInputItem pointInputItemResult = iPointInputItemDao.save(pointInputItem);
pointInputItemMapper.insert(pointInputItem);
// PointInputItem pointInputItemResult = iPointInputItemDao.save(pointInputItem);
//更新巡检路线
if(routePointList.size()>0){
Long classifyId=newPointClassify.getId();
for (RoutePoint routePoint :routePointList) {
RoutePointItem routePointItem = new RoutePointItem();
routePointItem.setPointClassifyId(classifyId);
routePointItem.setPointInputItemId(pointInputItemResult.getId());
routePointItem.setPointInputItemId(pointInputItem.getId());
routePointItem.setRoutePointId(routePoint.getId());
iRoutePointItemDao.save(routePointItem);
routePointItemMapper.insert(routePointItem);
// iRoutePointItemDao.save(routePointItem);
}
}
}else{
}else {
if (!collect.contains(pItemVo.getPointItemId())) {
pointInputItem.setId(pItemVo.getPointItemId());
pointInputItem.setInputItemId(pItemVo.getId());
pointInputItem.setPointId(pointClassify.getPointId());
pointInputItem.setClassifyIds(Long.valueOf(newPointClassify.getId()).toString());
pointInputItem.setId(pItemVo.getPointItemId());
pointInputItem.setOrderNo(pItemVo.getpOrderNo());
iPointInputItemDao.save(pointInputItem);
pointInputItemMapper.insert(pointInputItem);
// iPointInputItemDao.save(pointInputItem);
}
}
return CommonResponseUtil.success();
}
return CommonResponseUtil.success(pointClassify);
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage(), e);
......
......@@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.patrol.business.vo.PointInputItemVo;
import com.yeejoin.amos.patrol.dao.entity.PointInputItem;
import org.apache.ibatis.annotations.Mapper;
......@@ -15,7 +16,8 @@ import com.yeejoin.amos.patrol.dao.entity.InputItem;
import org.springframework.stereotype.Repository;
@Repository
public interface InputItemMapper extends BaseMapper {
@Mapper
public interface InputItemMapper extends BaseMapper<InputItem> {
/**
* 新接口
......@@ -62,4 +64,8 @@ public interface InputItemMapper extends BaseMapper {
public List<PointInputItemVo> queryCustomInputItemByPointId(@Param("classifyId") String classifyId );
public PointInputItemVo getInputItemByEquipmentName(@Param("equipmentName") String equipmentName );
void delPointInputItemById(@Param("ids") List<Long> ids);
void delRoutePointItemByItemId(@Param("ids") List<Long> ids);
}
package com.yeejoin.amos.patrol.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.patrol.dao.entity.PointInputItem;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface PointInputItemMapper extends BaseMapper<PointInputItem> {
}
package com.yeejoin.amos.patrol.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.patrol.dao.entity.RoutePointItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
public interface RoutePointItemMapper extends BaseMapper{
@Mapper
public interface RoutePointItemMapper extends BaseMapper<RoutePointItem> {
public void updateRoutePointItem( RoutePointItem pointItem);
......
......@@ -137,7 +137,7 @@ public class PointServiceImpl implements IPointService {
@Override
public void addPointClassifyByPointId(PointClassify pointClassify) {
iPointClassifyDao.save(pointClassify);
iPointClassifyDao.saveAndFlush(pointClassify);
}
......
......@@ -4,6 +4,7 @@ package com.yeejoin.amos.supervision.business.dao.mapper;
import com.yeejoin.amos.supervision.business.param.InputItemPageParam;
import com.yeejoin.amos.supervision.business.vo.RoutePointItemVo;
import com.yeejoin.amos.supervision.dao.entity.RoutePointItem;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......
......@@ -359,7 +359,7 @@
<select id="pageBuildingVideoList" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO">
select a.* from (
<if test="dto.buildingId!=null and dto.buildingId!=''">
SELECT
v.id AS id,
v.name AS name,
......@@ -372,7 +372,7 @@
<choose>
<when test="dto.buildingId!=null and dto.buildingId!=''">
JOIN wl_video_source vc ON vc.video_id = v.id
join wl_form_instance wfl on wfl.instance_id = vc.source_id
JOIN wl_form_instance wfl on wfl.instance_id = vc.source_id
WHERE
FIND_IN_SET(#{dto.buildingId}, vc.parent_source_ids)
<if test="dto.equipmentName!=null and dto.equipmentName!=''">
......@@ -387,6 +387,9 @@
<if test="dto.type!=null and dto.type!=''">
and v.type = #{dto.type}
</if>
<if test="dto.bizOrgCode!=null and dto.bizOrgCode!=''">
and v.biz_org_code LIKE CONCAT(#{dto.bizOrgCode}, '%')
</if>
GROUP BY id
</when>
<when test='dto.buildingId == null || dto.buildingId ==""'>
......@@ -410,8 +413,9 @@
GROUP BY id
</when>
</choose>
UNION
</if>
) AS a limit #{current},#{size}
</select>
<!-- UNION
SELECT
v.id AS id,
v.name AS name,
......@@ -438,9 +442,7 @@
and v.type =#{dto.type}
</if>
GROUP BY id
) AS a limit #{current},#{size}
</select>
) AS a limit #{current},#{size}-->
<select id="pageBuildingVideoCount" resultType="int">
select count(a.id) from (
<if test="dto.buildingId!=null and dto.buildingId!=''">
......@@ -530,8 +532,29 @@
a.*
FROM
(
<if test='par.longitude!=null and par.latitude!=null '>
<if test="par.buildingId!=null and par.buildingId!=''">
SELECT
v.id AS id,
v.name AS name,
v.token AS token,
v.url AS url,
v.code AS code,
v.address,
'' as distance,
v.longitude,
v.latitude
FROM wl_video v
JOIN wl_video_source vc ON vc.video_id = v.id
join wl_form_instance wfl on wfl.instance_id = vc.source_id
WHERE
FIND_IN_SET(#{par.buildingId}, vc.parent_source_ids)
GROUP BY id
</if>
<if test='par.longitude!=null and par.buildingId!=null '>
UNION ALL
</if>
<if test='par.longitude!=null and par.latitude!=null '>
(SELECT
wle.id ,
wle.`code` ,
wle.url,
......@@ -556,12 +579,14 @@
<if test='par.code!=null and par.code!="" '>
wle.code like concat ('%',#{par.code},'%')
</if>
ORDER BY
distance DESC)
</if>
<if test="par.longitudeTwo != null and par.longitude != null">
UNION
</if>
<if test='par.longitudeTwo !=null and par.latitudeTwo !=null '>
SELECT
(SELECT
wle.id,
wle.`code`,
wle.url,
......@@ -584,14 +609,16 @@
&lt;= #{par.distance}
</if>
<if test='par.type!=null and par.type!="" '>
wle.type = #{par.type}
AND wle.type = #{par.type}
</if>
<if test='par.remark!=null and par.remark!="" '>
wle.remake like concat ('%',#{par.remark},'%')
AND wle.remake like concat ('%',#{par.remark},'%')
</if>
<if test='par.code!=null and par.code!="" '>
wle.code like concat ('%',#{par.code},'%')
AND wle.code like concat ('%',#{par.code},'%')
</if>
ORDER BY
distance DESC)
</if>
union
SELECT
......@@ -610,7 +637,7 @@
WHERE
FIND_IN_SET(#{deptId}, vc.parent_source_ids)
GROUP BY id
) AS a ORDER BY a.distance desc limit #{pageNum},#{pageSize}
) AS a limit #{pageNum},#{pageSize}
</select>
......@@ -637,13 +664,13 @@
&lt;= #{par.distance}
</if>
<if test='par.type!=null and par.type!="" '>
wle.type = #{type}
AND wle.type = #{type}
</if>
<if test='par.remark!=null and par.remark!="" '>
wle.remake like concat ('%',#{par.remake},'%')
AND wle.remake like concat ('%',#{par.remake},'%')
</if>
<if test='par.code!=null and par.code!="" '>
wle.code like concat ('%',#{par.code},'%')
AND wle.code like concat ('%',#{par.code},'%')
</if>
</if>
<if test="par.longitudeTwo != null and par.longitude != null">
......@@ -674,13 +701,13 @@
&lt;= #{par.distance}
</if>
<if test='par.type!=null and par.type!="" '>
wle.type = #{par.type}
AND wle.type = #{par.type}
</if>
<if test='par.remark!=null and par.remark!="" '>
wle.remake like concat ('%',#{par.remark},'%')
AND wle.remake like concat ('%',#{par.remark},'%')
</if>
<if test='par.code!=null and par.code!="" '>
wle.code like concat ('%',#{par.code},'%')
AND wle.code like concat ('%',#{par.code},'%')
</if>
</if>
union
......
......@@ -446,4 +446,19 @@
<select id="getAllCategoryName" resultType="java.util.Map">
select code, `name` from wl_equipment_category
</select>
<delete id="delPointInputItemById">
DELETE FROM p_point_inputitem WHERE id IN
<foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</delete>
<delete id="delRoutePointItemByItemId">
DELETE FROM p_route_point_item WHERE point_input_item_id IN
<foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</delete>
</mapper>
\ No newline at end of file
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