
com.higgschain.trust.slave.dao.mysql.config.ConfigJDBCDao Maven / Gradle / Ivy
package com.higgschain.trust.slave.dao.mysql.config;
import com.google.common.collect.Lists;
import com.higgschain.trust.slave.common.enums.SlaveErrorEnum;
import com.higgschain.trust.slave.common.exception.SlaveException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* The type Config jdbc dao.
*
* @author liuyu
* @description
* @date 2018 -08-02
*/
@Component @Slf4j public class ConfigJDBCDao {
@Autowired private NamedParameterJdbcTemplate jdbc;
@Autowired private JdbcTemplate jdbcTemplate;
/**
* batch update
*
* @param nodes the nodes
*/
public void batchEnable(List nodes) {
String sql = "UPDATE config SET ";
String errorCodeConditionSql = "`pubKey`= `tmpPubKey`";
String errorMsgConditionSql = ",`priKey`= `tmpPriKey`";
String updateStatusSql = ", `valid`=true";
String updateTimeSql = ", `update_time`=NOW(3)";
String whereSql = "";
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy