long now = LibDateUtils.DateTime2LibDateTime(DateTime.Now); long today = LibDateUtils.Date2LibDate(DateTime.Now); string planSql = $@"SELECT plan.code as plan_id,comb.quiz_id,commUser.user_code AS creator_id,plan.name as plan_name, commUser.user_name AS creator_name FROM ers_{ModuleName}_comb_detail comb INNER JOIN ers_{ModuleName}_comb ersComb ON ersComb.id = comb.comb_id INNER JOIN comm_user commUser ON commUser.id = ersComb.creator_id INNER JOIN ers_{ModuleName}_plan plan ON comb.comb_id=plan.comb_id INNER JOIN ers_plan_config config ON plan.config_id=config.id WHERE comb.quiz_id={id} AND plan.company_id=1 AND plan.publish_status=1 AND plan.is_deleted=FALSE AND ( if(config.is_over_submit_time,{now} >= plan.begin_time AND plan.expire_to>={today},{now} BETWEEN plan.begin_time AND plan.end_time) OR plan.begin_time>{now})"; return this.DataAccess.ExecuteDataTable(planSql, false)