定时器 配置 方式 1
配置文件
<bean id="zgGISJob" class="com.jt.zgsic.scheduler.ZGGISJob" />
<task:scheduled-tasks>
<task:scheduled ref="zgGISJob" method="gisRun" cron="0 */1 * * * ?" />
</task:scheduled-tasks>
java 代码
@Component
public class ZGGISJob {
private static Logger log = Logger.getLogger(ZGGISJob.class);
@Autowired
SysAreaService sysAreaService;
public void gisRun(){
System.out.println("hello!");
//SysArea record=new SysArea();
//sysAreaService.selectByEntity(record);
}
}
定时器配置方式2
(1):修改配置 文件 如下: