// Path: server/src/main/java/com/cloudwise/sap/niping/common/entity/Task.java
// @Data
// @Builder
// @EqualsAndHashCode(callSuper = true)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Task extends AbstractEntity {
// 
//     private static final long serialVersionUID = 5824620618374870988L;
// 
//     private String taskId;
//     private String name;
//     private int interval;
//     private String configJson;
//     private int status;
// 
//     @JsonIgnore
//     private JobDesc jobDesc;
//     @JsonIgnore
//     private List<Monitor> monitors;
//     @JsonIgnore
//     private List<String> selectMonitorIds;
//     @JsonIgnore
//     private String selectMonitorIdString;
//     @JsonIgnore
//     private MonitorJob.Action action;
//     @JsonIgnore
//     private String monitorId;
//     @JsonIgnore
//     private String monitorName;
//     @JsonIgnore
//     private String resultId;
//     @JsonIgnore
//     private int errno;
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public enum Status {
//         enable(1), disable(0), deleted(-1);
// 
//         @Getter
//         private int status;
// 
//         Status(int status) {this.status = status;}
//     }
// }
// 
// Path: server/src/main/java/com/cloudwise/sap/niping/dao/mapper/TaskMapper.java
// @Slf4j
// public class TaskMapper implements ResultSetMapper<Task> {
// 
//     @Override
//     public Task map(int index, ResultSet r, StatementContext ctx) throws SQLException {
//         Task task = Task.builder()
//                 .taskId(r.getString("TASK_ID"))
//                 .name(r.getString("NAME"))
//                 .interval(r.getInt("INTERVAL"))
//                 .configJson(r.getString("CONFIG_JSON"))
//                 .status(r.getInt("STATUS")).build();
// 
//         try {
//             task.setMonitorId(r.getString("MONITOR_ID"));
//             task.setMonitorName(r.getString("MONITOR_NAME"));
//         }
//         catch (Exception e) {
//             log.debug(ExceptionUtils.getMessage(e));
//         }
// 
//         try {
//             task.setResultId(r.getString("RESULT_ID"));
//             task.setErrno(r.getInt("ERRNO"));
//         }
//         catch (Exception e) {
//             log.debug(ExceptionUtils.getMessage(e));
//         }
//         task.set(r.getString("ACCOUNT_ID"), r.getDate("CREATION_TIME"), r.getDate("MODIFIED_TIME"));
//         return task;
//     }
// }


import com.cloudwise.sap.niping.common.entity.Task;
import com.cloudwise.sap.niping.dao.mapper.TaskMapper;
import org.jvnet.hk2.annotations.Service;
import org.skife.jdbi.v2.sqlobject.Bind;
import org.skife.jdbi.v2.sqlobject.BindBean;
import org.skife.jdbi.v2.sqlobject.SqlQuery;
import org.skife.jdbi.v2.sqlobject.SqlUpdate;
import org.skife.jdbi.v2.sqlobject.customizers.Define;
import org.skife.jdbi.v2.sqlobject.customizers.MaxRows;
import org.skife.jdbi.v2.sqlobject.customizers.RegisterMapper;
import org.skife.jdbi.v2.sqlobject.stringtemplate.UseStringTemplate3StatementLocator;
import org.skife.jdbi.v2.unstable.BindIn;
import java.util.Date;
import java.util.List;
package com.cloudwise.sap.niping.dao;



@Service
@UseStringTemplate3StatementLocator
public interface TaskDao {

    @SqlUpdate("INSERT INTO SNM_TASK (TASK_ID, ACCOUNT_ID, NAME, TASK_INTERVAL, CONFIG_JSON, STATUS, CREATION_TIME, MODIFIED_TIME)" +
            " VALUES (:taskId, :accountId, :name, :interval, :configJson, :status, :creationTime, :modifiedTime)")
// Path: server/src/main/java/com/cloudwise/sap/niping/common/entity/Task.java
// @Data
// @Builder
// @EqualsAndHashCode(callSuper = true)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Task extends AbstractEntity {
// 
//     private static final long serialVersionUID = 5824620618374870988L;
// 
//     private String taskId;
//     private String name;
//     private int interval;
//     private String configJson;
//     private int status;
// 
//     @JsonIgnore
//     private JobDesc jobDesc;
//     @JsonIgnore
//     private List<Monitor> monitors;
//     @JsonIgnore
//     private List<String> selectMonitorIds;
//     @JsonIgnore
//     private String selectMonitorIdString;
//     @JsonIgnore
//     private MonitorJob.Action action;
//     @JsonIgnore
//     private String monitorId;
//     @JsonIgnore
//     private String monitorName;
//     @JsonIgnore
//     private String resultId;
//     @JsonIgnore
//     private int errno;
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public enum Status {
//         enable(1), disable(0), deleted(-1);
// 
//         @Getter
//         private int status;
// 
//         Status(int status) {this.status = status;}
//     }
// }
// 
// Path: server/src/main/java/com/cloudwise/sap/niping/dao/mapper/TaskMapper.java
// @Slf4j
// public class TaskMapper implements ResultSetMapper<Task> {
// 
//     @Override
//     public Task map(int index, ResultSet r, StatementContext ctx) throws SQLException {
//         Task task = Task.builder()
//                 .taskId(r.getString("TASK_ID"))
//                 .name(r.getString("NAME"))
//                 .interval(r.getInt("INTERVAL"))
//                 .configJson(r.getString("CONFIG_JSON"))
//                 .status(r.getInt("STATUS")).build();
// 
//         try {
//             task.setMonitorId(r.getString("MONITOR_ID"));
//             task.setMonitorName(r.getString("MONITOR_NAME"));
//         }
//         catch (Exception e) {
//             log.debug(ExceptionUtils.getMessage(e));
//         }
// 
//         try {
//             task.setResultId(r.getString("RESULT_ID"));
//             task.setErrno(r.getInt("ERRNO"));
//         }
//         catch (Exception e) {
//             log.debug(ExceptionUtils.getMessage(e));
//         }
//         task.set(r.getString("ACCOUNT_ID"), r.getDate("CREATION_TIME"), r.getDate("MODIFIED_TIME"));
//         return task;
//     }
// }


// Path: server/src/main/java/com/cloudwise/sap/niping/dao/TaskDao.java
import com.cloudwise.sap.niping.common.entity.Task;
import com.cloudwise.sap.niping.dao.mapper.TaskMapper;
import org.jvnet.hk2.annotations.Service;
import org.skife.jdbi.v2.sqlobject.Bind;
import org.skife.jdbi.v2.sqlobject.BindBean;
import org.skife.jdbi.v2.sqlobject.SqlQuery;
import org.skife.jdbi.v2.sqlobject.SqlUpdate;
import org.skife.jdbi.v2.sqlobject.customizers.Define;
import org.skife.jdbi.v2.sqlobject.customizers.MaxRows;
import org.skife.jdbi.v2.sqlobject.customizers.RegisterMapper;
import org.skife.jdbi.v2.sqlobject.stringtemplate.UseStringTemplate3StatementLocator;
import org.skife.jdbi.v2.unstable.BindIn;
import java.util.Date;
import java.util.List;

package com.cloudwise.sap.niping.dao;



@Service
@UseStringTemplate3StatementLocator
public interface TaskDao {

    @SqlUpdate("INSERT INTO SNM_TASK (TASK_ID, ACCOUNT_ID, NAME, TASK_INTERVAL, CONFIG_JSON, STATUS, CREATION_TIME, MODIFIED_TIME)" +
            " VALUES (:taskId, :accountId, :name, :interval, :configJson, :status, :creationTime, :modifiedTime)")
    void insertTask(@BindBean Task task);