| | |
| | | WHERE id = #{planId} |
| | | </update> |
| | | |
| | | <!--获取未完成的计划列表,小程序计划列表页使用--> |
| | | <select id="getNotCompletePlans" resultType="com.dy.pipIrrGlobal.voIr.VoPlans"> |
| | | SELECT |
| | | id AS planId, |
| | | plan_name AS planName, |
| | | startup_mode AS startupMode, |
| | | plan_start_time AS planStartTime, |
| | | plan_stop_time AS planStopTime, |
| | | duration, |
| | | IF(plan_state = 1,'草稿', |
| | | IF(NOW() < plan_start_time, '未执行', |
| | | IF(NOW() >= plan_start_time AND NOW() < plan_stop_time, '执行中', '已完成') |
| | | ) |
| | | ) AS planState |
| | | FROM ir_irrigate_plan plan |
| | | WHERE deleted = 0 AND (plan_state = 1 OR NOW() < plan_stop_time) |
| | | ORDER BY plan_state DESC |
| | | </select> |
| | | |
| | | <!--获取已完成的计划列表,小程序计划列表页使用--> |
| | | <select id="getCompletedPlans" resultType="com.dy.pipIrrGlobal.voIr.VoPlans"> |
| | | SELECT |
| | | id AS planId, |
| | | plan_name AS planName, |
| | | startup_mode AS startupMode, |
| | | plan_start_time AS planStartTime, |
| | | plan_stop_time AS planStopTime, |
| | | duration, |
| | | IF(plan_state = 1,'草稿', |
| | | IF(NOW() < plan_start_time, '未执行', |
| | | IF(NOW() >= plan_start_time AND NOW() < plan_stop_time, '执行中', '已完成') |
| | | ) |
| | | ) AS planState |
| | | FROM ir_irrigate_plan plan |
| | | WHERE deleted = 0 AND (plan_state = 2 AND NOW() >= plan_stop_time) |
| | | ORDER BY plan_state DESC |
| | | </select> |
| | | |
| | | </mapper> |