| | |
| | | |
| | | </select> |
| | | |
| | | <!--根据计划ID获取计划详情,包括计划名称,项目名,计划开始时间,计划结束时间,计划详情页使用--> |
| | | <select id="getPlanDetails" resultType="com.dy.pipIrrGlobal.voIr.VoPlanDetails"> |
| | | SELECT |
| | | plan.plan_name AS planName, |
| | | pro.project_name AS projectName, |
| | | IF(plan.executing_state = 3, '5', |
| | | IF(NOW() < plan.plan_start_time,'2', |
| | | IF(NOW() < plan.plan_stop_time, '3', '4'))) AS state, |
| | | plan.plan_start_time AS planStartTime, |
| | | plan.plan_stop_time AS planStopTime, |
| | | NULL AS groupDetails, |
| | | NULL AS failureCount |
| | | FROM ir_irrigate_plan plan |
| | | INNER JOIN ir_project pro ON pro.id = plan.project_id |
| | | WHERE plan.id = #{planId} |
| | | AND plan.deleted = 0 |
| | | </select> |
| | | |
| | | <!--根据计划ID获取计划状态,用于判断是否可以删除计划--> |
| | | <select id="getPlanState" resultType="java.lang.Integer"> |
| | | SELECT |
| | | plan_state |
| | | FROM ir_irrigate_plan |
| | | WHERE id = #{planId} |
| | | AND deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |