更新监测点时新增新能源站字段

This commit is contained in:
guofeihu
2024-08-22 09:08:09 +08:00
parent bddd1efef3
commit f27a107bba
6 changed files with 14 additions and 6 deletions

View File

@@ -198,6 +198,6 @@
<select id="getLineByDeptIdAndNewStation" resultType="string">
select pdl.Line_Id from pq_dept_line pdl
inner join pq_line_detail pld on pdl.Line_Id = pld.Id
where pdl.Id = #{id} and pld.New_Station_Id in (select pns.id from pq_new_station pns where pns.station_type = #{stationType})
where pdl.Id = #{id} and pld.New_Station_Id in (select pns.id from pq_new_station pns where pns.station_type = #{stationType} and pns.state = 1)
</select>
</mapper>

View File

@@ -2,6 +2,7 @@ package com.njcn.device.pq.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.common.pojo.exception.BusinessException;
@@ -80,7 +81,9 @@ public class NewStationServiceImpl extends ServiceImpl<NewStationMapper, NewStat
@Override
public NewStation selectById(String id) {
return this.baseMapper.selectById(id);
LambdaQueryWrapper<NewStation> lambdaUpdateWrapper = new LambdaQueryWrapper<>();
lambdaUpdateWrapper.eq(NewStation::getId,id).eq(NewStation::getState,1);
return this.baseMapper.selectOne(lambdaUpdateWrapper);
}
}