package com.ycl.scheme; import java.util.List; import java.util.ArrayList; import java.util.ArrayList; import com.ycl.scheme.service.SchemeService; import com.ycl.scheme.AbstractSchemeRunner; import java.time.LocalDateTime; import java.time.LocalDate; class scheme_1 extends AbstractSchemeRunner { SchemeService service; void run(SchemeService service){ this.service = service; if(func_0() &&func_1() ){ service.doAction(1) } } def func_0(){ List pars = new ArrayList<>(); def sql= "select count() from t_info where create_time between ? and ? and content like '%抢夺%' and address like '%金牛大道%' " def p_0 = LocalDateTime.now();; pars.add(p_0); def p_1 = LocalDateTime.now().minusDays(5);; pars.add(p_1); def rs = service.execQuery(sql,pars); if(rs > 2){ return true; }else{ return false; } } def func_1(){ List pars = new ArrayList<>(); def sql= "select from t_case where create_time between ? and ? and content like '%命案%' and address like '%金牛大道%' " def p_0 = LocalDateTime.now();; pars.add(p_0); def p_1 = LocalDateTime.now().minusDays(5);; pars.add(p_1); def rs = service.execQuery(sql,pars); if(rs >=2){ return true; }else{ return false; } } }