You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aggregation-platform/src/com/platform/service/impl/MySqlServiceImpl.java

57 lines
1.4 KiB

package com.platform.service.impl;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.platform.dao.GatherOracleDao;
import com.platform.entities.GatherOracleInfo;
import com.platform.service.IMySqlService;
@Service(value = "mySqlService")
public class MySqlServiceImpl implements IMySqlService{
@Resource(name = "gatherOracleDao")
private GatherOracleDao gatherOracleDao;
@Override
public List<GatherOracleInfo> findAllMySql() throws Exception {
List<GatherOracleInfo> result = gatherOracleDao.selectAllOracle();
return result;
}
@Override
public int deleteMySql(int id) throws Exception {
int result = 0;
if (id > 0) {
// result = gatherOracleDao.deleteOracleById(id);
GatherOracleInfo oracle = new GatherOracleInfo();
oracle.setId(id);
oracle.setRemove("1");
result = gatherOracleDao.updateOracleById(oracle );
}
return result;
}
public int insertOracle(GatherOracleInfo oracle) throws Exception {
int result = gatherOracleDao.insertOracle(oracle);
return result;
}
@Override
public int updateOracle(GatherOracleInfo oracle) throws Exception {
int result;
if (oracle.getId() > 0) {
result = gatherOracleDao.updateOracleById(oracle);
}
else {
result = gatherOracleDao.insertOracle(oracle);
}
return result;
}
}