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
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
</if>
</if>
<iftest="type==2">
<iftest="type==2">
select plan_id from tab_haoban_qw_moment_plan where status_flag = 1 and begin_date <![CDATA[ < ]]> now() and DATE_ADD(end_date , INTERVAL 3 DAY) > now() and delete_flag = 0 and done_num > 0
select plan_id from tab_haoban_qw_moment_plan where status_flag = 1 and begin_date <![CDATA[ < ]]> now() and end_date > DATE_ADD(now(), INTERVAL -3 DAY) and delete_flag = 0 and done_num > 0