| | |
| | | * @return |
| | | */ |
| | | int updateInspectDistance(@Param("inspectId") Long inspectId, @Param("distance")Double distance ); |
| | | |
| | | /** |
| | | * 根据巡检员ID获取巡检记录数量 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | Long getInstectsCountByInspectorId(Map<?, ?> params); |
| | | |
| | | /** |
| | | * 根据巡检员ID获取巡检列表 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoInspect> getInstectsByInspectorId(Map<?, ?> params); |
| | | } |
| | |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.dy.pipIrrGlobal.pojoOp.OpeTrack; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @JsonPropertyOrder({"inspectorId", "inspectorName", "inspectId", "startTime", "stopTime", "inspectDistance", "tracks"}) |
| | | public class VoInspect implements BaseEntity { |
| | | private static final long serialVersionUID = 202411201537001L; |
| | | |
| | |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date stopTime; |
| | | |
| | | /** |
| | | * 各个巡检点 |
| | | */ |
| | | private List<OpeTrack> tracks; |
| | | |
| | | /** |
| | | * 巡检距离 |
| | | */ |
| | | private Double inspectDistance; |
| | | } |
| | |
| | | SET inspect_distance = #{distance} |
| | | WHERE id = #{inspectId} |
| | | </update> |
| | | |
| | | <!--根据巡检员ID获取巡检记录数量--> |
| | | <select id="getInstectsCountByInspectorId" resultType="java.lang.Long"> |
| | | SELECT |
| | | count(*) |
| | | FROM ope_inspect ins |
| | | LEFT JOIN ba_user user ON user.id = ins.inspector_id |
| | | WHERE ins.inspector_id = #{inspectorId} |
| | | </select> |
| | | |
| | | <!--根据巡检员ID获取巡检列表--> |
| | | <select id="getInstectsByInspectorId" resultType="com.dy.pipIrrGlobal.voOp.VoInspect"> |
| | | SELECT |
| | | user.id AS inspectorId, |
| | | user.name AS inspectorName, |
| | | ins.id AS inspectId, |
| | | ins.start_time AS startTime, |
| | | ins.stop_time AS stopTime, |
| | | ins.inspect_distance AS inspectDistance |
| | | FROM ope_inspect ins |
| | | LEFT JOIN ba_user user ON user.id = ins.inspector_id |
| | | WHERE ins.inspector_id = #{inspectorId} |
| | | ORDER BY ins.start_time DESC |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | return EARTH_RADIUS * c; |
| | | } |
| | | |
| | | /** |
| | | * 根据巡检员ID获取巡检列表 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/getInspectRecords") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoInspect>>> getInspectRecords(QoInspect vo) { |
| | | try { |
| | | QueryResultVo<List<VoInspect>> res = inspectSv.getInstectsByInspectorId(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取迅疾爱你记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | public int updateInspectDistance(Long inspectId, double distance ) { |
| | | return opeInspectMapper.updateInspectDistance(inspectId, distance); |
| | | } |
| | | |
| | | /** |
| | | * 根据巡检员ID获取巡检列表 |
| | | * @param queryVo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoInspect>> getInstectsByInspectorId(QoInspect queryVo) { |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); |
| | | |
| | | Long itemTotal = opeInspectMapper.getInstectsCountByInspectorId(params); |
| | | |
| | | QueryResultVo<List<VoInspect>> rsVo = new QueryResultVo<>(); |
| | | rsVo.pageSize = queryVo.pageSize; |
| | | rsVo.pageCurr = queryVo.pageCurr; |
| | | |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | rsVo.obj = opeInspectMapper.getInstectsByInspectorId(params); |
| | | return rsVo; |
| | | } |
| | | } |