<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskDetailMapper">
	<update id="finishTaskDetail">
		call updatePlanTask(#{planTaskId}, #{pointId}, #{planTaskDetailId} ,#{executorId},#{executorName},#{size},#{planTaskStatus})
	</update>
	
	<select id="findPlanTaskByTaskIdAndPointId" resultType="Map">
		SELECT
			p.name planName, pt.begin_time beginTime, pt.end_time endTime, pp.name pointName, pp.point_no pointNo, ptd.id planTaskDetailId, pt.route_id routeId, pr.name routeName
		FROM
			p_plan_task pt
		LEFT JOIN p_plan p ON pt.plan_id = p.id
		LEFT JOIN p_plan_task_detail ptd on ptd.task_no = pt.id
		left join p_point pp on pp.id = ptd.point_id
		left join p_route pr on pr.id = pt.route_id
		where pp.id = #{pointId}
		and pt.id = #{planTaskId}
	</select>
</mapper>