select plan_id from tab_haoban_qw_moment_plan where status_flag = 1 and begin_date <![CDATA[ < ]]> now() and end_date > now() and delete_flag = 0 and task_clerk_num > done_num
</if>
<iftest="type==2">
select plan_id from tab_haoban_qw_moment_plan where status_flag = 1 and begin_date <![CDATA[ < ]]> now() and end_date > now() and delete_flag = 0 and done_num > 0
</if>
</select>
<updateid="del"parameterType="java.lang.Long">
update tab_haoban_qw_moment_plan set delete_flag = 1 where plan_id = #{planId}