| | |
| | | |
| | | import com.flightfeather.uav.domain.entity.Mission |
| | | import com.flightfeather.uav.domain.mapper.MissionMapper |
| | | import com.flightfeather.uav.lightshare.bean.AreaVo |
| | | import org.springframework.stereotype.Repository |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.util.* |
| | |
| | | .andIsNotNull("endTime") |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 根据区域和时间范围查询有效走航任务列表 |
| | | * 筛选指定行政区划内、特定时间段且已完成有效里程记录的走航任务 |
| | | * @param areaVo 区域参数对象,包含省、市、区三级行政区划编码 |
| | | * @param startTime 查询起始时间(包含) |
| | | * @param endTime 查询结束时间(包含) |
| | | * @return 符合条件的走航任务列表,若无可返回空列表 |
| | | * @see AreaVo 区域参数数据结构 |
| | | * @see Mission 走航任务实体类 |
| | | */ |
| | | fun findByAreaAndTime(areaVo: AreaVo, startTime: Date, endTime: Date): List<Mission?> { |
| | | return missionMapper.selectByExample(Example(Mission::class.java).apply { |
| | | createCriteria().andBetween("startTime", startTime, endTime) |
| | | .andEqualTo("provinceCode", areaVo.provinceCode) |
| | | .andEqualTo("cityCode", areaVo.cityCode) |
| | | .andEqualTo("districtCode", areaVo.districtCode) |
| | | .andIsNotNull("kilometres") |
| | | .andNotEqualTo("kilometres", 0) |
| | | }) |
| | | } |
| | | } |