浏览代码

bug修改

demon 8 年之前
父节点
当前提交
b142bf5c45

+ 1 - 1
src/main/java/com/yihu/hos/datacollect/dao/DatacollectDao.java

@ -115,7 +115,7 @@ public class DatacollectDao extends SQLGeneralDAO implements IDatacollectDao {
     */
    public void deleteJobDatasetByJobId(String jobId) throws Exception
    {
        List<RsJobDataset> list = super.queryListBySql("select * from rs_job_dataset where job_id='"+jobId+"'",RsJobDataset.class);
        List<RsJobDataset> list = (List<RsJobDataset>) super.hibernateTemplate.find("from RsJobDataset s where s.jobId=? ", jobId);
        //判断是否存在数据
        if(list!=null && list.size()>0)
        {

+ 5 - 4
src/main/java/com/yihu/hos/interceptor/JdbcTemplateAdvice.java

@ -8,7 +8,7 @@ import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;
/**
 *  jdbctemplate 预编译执行拦截
 *  jdbc
 * @author HZY
 * @vsrsion 1.0
 * Created at 2016/12/7.
@ -18,7 +18,7 @@ import org.springframework.stereotype.Component;
public class JdbcTemplateAdvice {
    @Around("execution(* org.springframework.jdbc.core.JdbcTemplate.query*(..)) || execution(* org.springframework.jdbc.core.JdbcTemplate.execute*(..))")
    public void process(ProceedingJoinPoint point) throws Throwable {
    public Object process(ProceedingJoinPoint point) throws Throwable {
        String schemaName = getSchema();
        //访问目标方法的参数:
        Object[] args = point.getArgs();
@ -31,8 +31,9 @@ public class JdbcTemplateAdvice {
            args[0]=completeSql;
        }
        //用改变后的参数执行目标方法
        point.proceed(args);
        Object returnValue = point.proceed(args);
        System.out.println("@Around:被织入的目标对象为:" + point.getTarget());
        return returnValue;
    }
//    @Before("execution(* org.springframework.jdbc.core.JdbcTemplate.query*(..)) || execution(* org.springframework.jdbc.core.JdbcTemplate.execute*(..))")