package com.yihu.hos.rest.common.dao;


import com.yihu.hos.rest.models.rs.RsDatapushLog;
import com.yihu.hos.web.framework.dao.SQLGeneralDAO;
import org.springframework.stereotype.Repository;

import java.util.Date;

/**
 * Created by hzp on 2016/1/11.
 */
@Repository("DatacollectLogDao")
public class DatacollectLogDao extends SQLGeneralDAO {


    /******************************** 推模式日志 ***************************************/
    /**
     * 推数据新增日志
     */
    public void addDataPushLog(String type,String success,String content) throws Exception {
        RsDatapushLog log = new RsDatapushLog();
        log.setType(type);
        log.setSuccess(success);
        log.setContent(content);
        log.setDatetime(new Date());
        this.saveEntity(log);
    }

    public void updateJobDatasetKeyvalue(String id,String jobDatasetKeyvalue) throws Exception {
        String sql = "update rs_job_dataset set job_dataset_keyvalue='"+jobDatasetKeyvalue+"' where id='"+id+"'";
        super.execute(sql);
    }
}
