Commit e772e02e authored by 李腾威's avatar 李腾威

电梯物联信息查询优化

parent 1b73e96b
...@@ -22,11 +22,7 @@ public interface ElevatorMapper extends BaseMapper<Elevator> { ...@@ -22,11 +22,7 @@ public interface ElevatorMapper extends BaseMapper<Elevator> {
Long sequenceNbr, Long sequenceNbr,
int current, int size); int current, int size);
List<ElevatorWlInfoDto> queryElevatorListDetails(String address, List<ElevatorWlInfoDto> queryElevatorListDetails(
String registerCode,
Integer rescueCode,
String type,
Integer dealStatus,
Long sequenceNbr Long sequenceNbr
); );
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
select select
te.sequence_nbr sequenceNbr, te.sequence_nbr sequenceNbr,
concat(te.province,te.city,te.district) area, concat(te.province,te.city,te.district) area,
te.category, te.device_category category,
te.register_code registerCode, te.register_code registerCode,
te.rescue_code rescueCode, te.rescue_code rescueCode,
te.address , te.address ,
tea.start_date happenTime, te.start_date happenTime,
tea.type , te.type ,
case tea.deal_status case te.deal_status
when '0' then '处置完成' when '0' then '处置完成'
when '1' then '故障发生' when '1' then '故障发生'
when '2' then '发出通知' when '2' then '发出通知'
...@@ -21,8 +21,7 @@ ...@@ -21,8 +21,7 @@
ELSE '' END dealStatus, ELSE '' END dealStatus,
'电梯' categoryName, '电梯' categoryName,
'立信远大科技有限公司' IotServiceProvider '立信远大科技有限公司' IotServiceProvider
from tcb_elevator te inner join tz_elevator_alarm tea on from tz_elevator_alarm te
te.register_code = tea.register_code
where 1=1 where 1=1
<if test="address != null and address != ''"> <if test="address != null and address != ''">
and te.address like CONCAT(CONCAT('%',#{address}),'%') and te.address like CONCAT(CONCAT('%',#{address}),'%')
...@@ -34,14 +33,15 @@ ...@@ -34,14 +33,15 @@
and te.rescue_code like CONCAT(CONCAT('%',#{rescueCode}),'%') and te.rescue_code like CONCAT(CONCAT('%',#{rescueCode}),'%')
</if> </if>
<if test="type != null and type != ''"> <if test="type != null and type != ''">
and tec.type = #{type} and te.type = #{type}
</if> </if>
<if test="dealStatus != null and dealStatus != ''">sequenceNbr <if test="dealStatus != null and dealStatus != ''">
and tec.deal_status = #{dealStatus} and te.deal_status = #{dealStatus}
</if> </if>
<if test="sequenceNbr != null and sequenceNbr != ''"> <if test="sequenceNbr != null and sequenceNbr != ''">
and te.sequence_nbr = #{sequenceNbr} and te.sequence_nbr = #{sequenceNbr}
</if> </if>
group by register_code
order by start_date DESC limit #{current},#{size} order by start_date DESC limit #{current},#{size}
</select> </select>
...@@ -49,13 +49,13 @@ ...@@ -49,13 +49,13 @@
select select
te.sequence_nbr sequenceNbr, te.sequence_nbr sequenceNbr,
concat(te.province,te.city,te.district) area, concat(te.province,te.city,te.district) area,
te.category, te.device_category category,
te.register_code registerCode, te.register_code registerCode,
te.rescue_code rescueCode, te.rescue_code rescueCode,
te.address , te.address ,
tea.start_date happenTime, te.start_date happenTime,
tea.type , te.type ,
case tea.deal_status case te.deal_status
when '0' then '处置完成' when '0' then '处置完成'
when '1' then '故障发生' when '1' then '故障发生'
when '2' then '发出通知' when '2' then '发出通知'
...@@ -65,8 +65,7 @@ ...@@ -65,8 +65,7 @@
ELSE '' END dealStatus, ELSE '' END dealStatus,
'电梯' categoryName, '电梯' categoryName,
'立信远大科技有限公司' IotServiceProvider '立信远大科技有限公司' IotServiceProvider
from tcb_elevator te inner join tz_elevator_alarm tea on from tz_elevator_alarm te
te.register_code = tea.register_code
where 1=1 where 1=1
<if test="sequenceNbr != null and sequenceNbr != ''"> <if test="sequenceNbr != null and sequenceNbr != ''">
and te.sequence_nbr = #{sequenceNbr} and te.sequence_nbr = #{sequenceNbr}
...@@ -77,9 +76,9 @@ ...@@ -77,9 +76,9 @@
select count(1) from ( select count(1) from (
select select
te.sequence_nbr te.sequence_nbr
from tcb_elevator te inner join tz_elevator_alarm tea on from tz_elevator_alarm te
te.register_code = tea.register_code
where 1=1 where 1=1
group by register_code order by start_date desc
) te ) te
</select> </select>
......
...@@ -40,6 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -40,6 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.annotation.Condition; import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator; import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
...@@ -289,15 +290,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -289,15 +290,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
LambdaQueryWrapper<DispatchPaper> queryWrapper = new LambdaQueryWrapper(); LambdaQueryWrapper<DispatchPaper> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(DispatchPaper::getAlertId,Long.valueOf(alertId)); queryWrapper.eq(DispatchPaper::getAlertId,Long.valueOf(alertId));
DispatchPaper dispatchPaper = dispatchPaperService.getOne(queryWrapper); DispatchPaper dispatchPaper = dispatchPaperService.getOne(queryWrapper);
List<DispatchTask> dispatchTask = null;
if(!ValidationUtil.isEmpty(dispatchPaper)) {
LambdaQueryWrapper<DispatchTask> queryWrapper1 = new LambdaQueryWrapper(); LambdaQueryWrapper<DispatchTask> queryWrapper1 = new LambdaQueryWrapper();
queryWrapper1.eq(DispatchTask::getPaperId,Long.valueOf(dispatchPaper.getSequenceNbr())); queryWrapper1.eq(DispatchTask::getPaperId,Long.valueOf(dispatchPaper.getSequenceNbr()));
List<DispatchTask> dispatchTask = dispatchTaskService.list(queryWrapper1); dispatchTask = dispatchTaskService.list(queryWrapper1);
}
String [] str = new String[]{"使用单位","一级响应","二级响应","三级响应","市级监督"}; String [] str = new String[]{"使用单位","一级响应","二级响应","三级响应","市级监督"};
if(null != dispatchPaper) { if(null != dispatchPaper) {
for(String s:str) { for(String s:str) {
AlertHandlerInfoDto alertHandlerInfoDto = new AlertHandlerInfoDto(); AlertHandlerInfoDto alertHandlerInfoDto = new AlertHandlerInfoDto();
if(null != dispatchTask &&dispatchTask.size() > 0 ) { if(null != dispatchTask &&dispatchTask.size() > 0 ) {
......
...@@ -122,10 +122,8 @@ public class ElevatorServiceImpl extends BaseService<ElevatorDto, Elevator, Elev ...@@ -122,10 +122,8 @@ public class ElevatorServiceImpl extends BaseService<ElevatorDto, Elevator, Elev
} }
public List<ElevatorWlInfoDto> queryElevatorListDetails(ElevatorWlInfoDto esElevatorDto) { public List<ElevatorWlInfoDto> queryElevatorListDetails(ElevatorWlInfoDto esElevatorDto) {
return elevatorMapper.queryElevatorListDetails(esElevatorDto.getAddress(), return elevatorMapper.queryElevatorListDetails(
esElevatorDto.getRegisterCode(),esElevatorDto.getRescueCode(), esElevatorDto.getSequenceNbr());
esElevatorDto.getType(), esElevatorDto.getDealStatus() != null ? Integer.parseInt(esElevatorDto.getDealStatus()) :null
, esElevatorDto.getSequenceNbr());
} }
public int queryElevatorListCount() { public int queryElevatorListCount() {
......
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