DataUtil.java 789 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
package pwc.taxtech.atms.common.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Component;
import pwc.taxtech.atms.entity.Organization;
import pwc.taxtech.atms.entity.Project;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map;

/**
 * author kevin
 * version 1.0
 * 封装一些简单的数据处理
 */
@Component
public class DataUtil {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    //通过projectId查询project信息
    public  Map<String, Object> getProjectById(String projectId){
        return  jdbcTemplate.queryForMap("select * from project where id = ?", projectId);
    }
}