|
|
|
|
|
|
|
|
<result property="emergencyDataInspectionId" column="emergency_data_inspection_id" /> |
|
|
<result property="emergencyDataInspectionId" column="emergency_data_inspection_id" /> |
|
|
<result property="mark" column="mark" /> |
|
|
<result property="mark" column="mark" /> |
|
|
</resultMap> |
|
|
</resultMap> |
|
|
|
|
|
|
|
|
|
|
|
<resultMap id="ForeignResult" type="com.tuoheng.admin.entity.Inspection" extends="InspectionResult"> |
|
|
|
|
|
<result property="createUserName" column="create_user_name" /> |
|
|
|
|
|
</resultMap> |
|
|
|
|
|
<!-- |
|
|
<sql id="Base_Column_list"> |
|
|
<sql id="Base_Column_list"> |
|
|
id, tenant_id, dept_id, code, name, type, road_id, road_name, section_id, section_name, inspection_type, |
|
|
id, tenant_id, dept_id, code, name, type, road_id, road_name, section_id, section_name, inspection_type, |
|
|
inspectionCycleI, airport_task_id, airport_id, drone_id, airport_name, inspection_line, inspection_line_name, |
|
|
|
|
|
|
|
|
inspectionCycleId, airport_task_id, airport_id, drone_id, airport_name, inspection_line, inspection_line_name, |
|
|
equipment_id, equipment_name, equipment_mount_id, equipment_mount_name, cloud_box_id, cloud_box_name, box_sn, |
|
|
equipment_id, equipment_name, equipment_mount_id, equipment_mount_name, cloud_box_id, cloud_box_name, box_sn, |
|
|
flight_hand, flight_hand_name, inspection_time, execution_start_time, execution_end_time, is_live, is_taken, is_tilt, |
|
|
flight_hand, flight_hand_name, inspection_time, execution_start_time, execution_end_time, is_live, is_taken, is_tilt, |
|
|
video_url, ai_video_url, report_url, srt_url, status, analyse_status, progressbar, note, weather, |
|
|
video_url, ai_video_url, report_url, srt_url, status, analyse_status, progressbar, note, weather, |
|
|
fly_height, flytime, mileage, srt_name, heartbeat_time, execution_status, |
|
|
fly_height, flytime, mileage, srt_name, heartbeat_time, execution_status, |
|
|
start_longitude, start_latitude, end_longitude, end_latitude, mobile, patrol_location, |
|
|
start_longitude, start_latitude, end_longitude, end_latitude, mobile, patrol_location, |
|
|
create_user, create_time, update_user, update_time, mark |
|
|
create_user, create_time, update_user, update_time, mark |
|
|
|
|
|
</sql>--> |
|
|
|
|
|
|
|
|
|
|
|
<sql id="Base_Column_list"> |
|
|
|
|
|
t.id, t.tenant_id, t.dept_id, t.code, t.name, t.type, t.inspection_type, t.inspection_cycle_id, t.airport_task_id, |
|
|
|
|
|
t.airport_id, t.airport_name, t.drone_id, t.inspection_line, t.inspection_line_name, t.airport_line_length, t.equipment_id, t.equipment_name, t.equipment_mount_id, |
|
|
|
|
|
t.equipment_mount_name, t.cloud_box_id, t.cloud_box_name, t.box_sn, t.flight_hand, t.flight_hand_name, t.inspection_time, |
|
|
|
|
|
t.execution_start_time, t.execution_end_time, t.is_live, t.is_taken, t.is_tilt, t.video_url, t.ai_video_url, t.report_url, t.srt_url, |
|
|
|
|
|
t.status, t.analyse_status, t.progressbar, t.note, t.weather, t.fly_height, t.mileage, t.flytime, t.srt_name, t.heartbeat_time, t.execution_status, |
|
|
|
|
|
t.start_longitude, t.start_latitude, t.end_longitude, t.end_latitude, t.mobile, t.patrol_location, t.dsp_service_inst_id, t.emergency_data_inspection_id, |
|
|
|
|
|
t.create_user, t.create_time, t.update_user, t.update_time, t.mark |
|
|
</sql> |
|
|
</sql> |
|
|
|
|
|
|
|
|
<sql id="selectInspectionVo"> |
|
|
<sql id="selectInspectionVo"> |
|
|
|
|
|
|
|
|
and tenant_id = #{tenantId} |
|
|
and tenant_id = #{tenantId} |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<select id="selectPageList" parameterType="com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest" resultMap="InspectionResult"> |
|
|
|
|
|
<include refid="selectInspectionVo"/> |
|
|
|
|
|
|
|
|
<select id="selectPageList" parameterType="com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest" resultMap="ForeignResult"> |
|
|
|
|
|
select <include refid="Base_Column_list"/> ,u.realname as create_user_name |
|
|
|
|
|
from th_inspection t |
|
|
|
|
|
left join th_user u on u.id = t.create_user |
|
|
<where> |
|
|
<where> |
|
|
<if test="1 == 1"> and mark = 1 </if> |
|
|
|
|
|
<if test="request.type != null and request.type != 0"> and type = #{request.type} </if> |
|
|
|
|
|
<if test="request.code != null and request.code != ''"> and code like concat('%', #{request.code}, '%') </if> |
|
|
|
|
|
<if test="request.tenantId != null and request.tenantId != ''"> and tenant_id = #{request.tenantId} </if> |
|
|
|
|
|
<if test="request.airportId != null and request.airportId != 0"> and airport_id = #{request.airportId} </if> |
|
|
|
|
|
<if test="request.inspectionLine != null and request.inspectionLine != 0"> and inspection_line = #{request.inspectionLine} </if> |
|
|
|
|
|
<if test="request.type != null and request.type != 0"> and type = #{request.type} </if> |
|
|
|
|
|
<if test="request.status != null and request.status != 0"> and status = #{request.status} </if> |
|
|
|
|
|
<if test="request.inspectionType != null and request.inspectionType != 0"> and inspection_type = #{request.inspectionType} </if> |
|
|
|
|
|
<if test="request.deptId != null and request.deptId != ''"> and dept_id = #{request.deptId} </if> |
|
|
|
|
|
|
|
|
<if test="1 == 1"> and t.mark = 1 </if> |
|
|
|
|
|
<if test="request.code != null and request.code != ''"> and t.code like concat('%', #{request.code}, '%') </if> |
|
|
|
|
|
<if test="request.name != null and request.name != ''"> and t.name like concat('%', #{request.name}, '%') </if> |
|
|
|
|
|
<if test="request.tenantId != null and request.tenantId != ''"> and t.tenant_id = #{request.tenantId} </if> |
|
|
|
|
|
<if test="request.airportId != null and request.airportId != 0"> and t.airport_id = #{request.airportId} </if> |
|
|
|
|
|
<if test="request.inspectionLine != null and request.inspectionLine != 0"> and t.inspection_line = #{request.inspectionLine} </if> |
|
|
|
|
|
<if test="request.type != null and (request.type == 0 or request.type == 1)"> and t.type = #{request.type} </if> |
|
|
|
|
|
<if test="request.inspectionType != null and request.inspectionType != 0"> and t.inspection_type = #{request.inspectionType} </if> |
|
|
|
|
|
<if test="request.statusList != null and request.statusList.size() > 0"> |
|
|
|
|
|
and t.status in |
|
|
|
|
|
<foreach item="status" collection="request.statusList" open="(" separator="," close=")"> |
|
|
|
|
|
#{status} |
|
|
|
|
|
</foreach> |
|
|
|
|
|
</if> |
|
|
<if test="request.deptIdList != null and request.deptIdList.size() > 0"> |
|
|
<if test="request.deptIdList != null and request.deptIdList.size() > 0"> |
|
|
and dept_id in |
|
|
|
|
|
|
|
|
and t.dept_id in |
|
|
<foreach item="deptId" collection="request.deptIdList" open="(" separator="," close=")"> |
|
|
<foreach item="deptId" collection="request.deptIdList" open="(" separator="," close=")"> |
|
|
#{deptId} |
|
|
#{deptId} |
|
|
</foreach> |
|
|
</foreach> |
|
|
</if> |
|
|
</if> |
|
|
|
|
|
-- 部门筛选 |
|
|
|
|
|
<if test="request.deptId != null and request.deptId !=''"> |
|
|
|
|
|
and t.dept_id = #{request.deptId} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="request.inspectionTimeBegin != null and request.inspectionTimeBegin != ''"> |
|
|
|
|
|
and t.inspection_time >= #{request.inspectionTimeBegin} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="request.inspectionTimeEnd != null and request.inspectionTimeEnd != ''"> |
|
|
|
|
|
and t.inspection_time <= #{request.inspectionTimeEnd} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="request.executionTimeBegin != null and request.executionTimeBegin != ''"> |
|
|
|
|
|
and t.execution_start_time >= #{request.executionTimeBegin} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="request.executionTimeEnd != null and request.executionTimeEnd != ''"> |
|
|
|
|
|
and t.execution_start_time <= #{request.executionTimeEnd} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="request.inspectionCycleId != null and request.inspectionCycleId != ''"> |
|
|
|
|
|
and t.type = 0 and t.inspection_cycle_id = #{request.inspectionCycleId} |
|
|
|
|
|
</if> |
|
|
|
|
|
<choose> |
|
|
|
|
|
<!-- 单次任务程序:只展示待执行(5)的单次任务 --> |
|
|
|
|
|
<when test="request.singleTask != null and request.singleTask == 1"> |
|
|
|
|
|
and t.type = 1 and t.status = 5 |
|
|
|
|
|
</when> |
|
|
|
|
|
<!-- 执行任务程序:只展示准备中(6)、飞行中(10)、飞行完成(15)、飞行失败(7)、已取消(16)的单次任务、周期任务子任务 --> |
|
|
|
|
|
<otherwise> |
|
|
|
|
|
and t.type in(0,1) and t.status in (6,10,15,7,16) |
|
|
|
|
|
</otherwise> |
|
|
|
|
|
</choose> |
|
|
</where> |
|
|
</where> |
|
|
order by create_time desc |
|
|
|
|
|
|
|
|
<choose> |
|
|
|
|
|
<!-- 单次任务程序:按创建时间倒序排 --> |
|
|
|
|
|
<when test="request.singleTask != null and request.singleTask == 1"> |
|
|
|
|
|
order by t.create_time desc |
|
|
|
|
|
</when> |
|
|
|
|
|
<!-- 执行任务程序:按实际巡检时间倒序排,null为后 --> |
|
|
|
|
|
<otherwise> |
|
|
|
|
|
order by t.execution_start_time desc |
|
|
|
|
|
</otherwise> |
|
|
|
|
|
</choose> |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- 根据云盒ID查询执行中的巡检任务--> |
|
|
<!-- 根据云盒ID查询执行中的巡检任务--> |
|
|
<select id="getListByBox" resultType="com.tuoheng.admin.entity.Inspection"> |
|
|
<select id="getListByBox" resultType="com.tuoheng.admin.entity.Inspection"> |
|
|
<include refid="selectInspectionVo"/> |
|
|
<include refid="selectInspectionVo"/> |