class ProcessDefinitionDao {

    public Map<Integer,String> queryAllProcessDefinition(Connection conn){

        Map<Integer,String> processDefinitionJsonMap = new HashMap<>();

        String sql = String.format("SELECT id,process_definition_json FROM t_ds_process_definition");
        ResultSet rs = null;
        PreparedStatement pstmt = null;
        try {
            pstmt = conn.prepareStatement(sql);
            rs = pstmt.executeQuery();

            while (rs.next()){
                Integer id = rs.getInt(1);
                String processDefinitionJson = rs.getString(2);
                processDefinitionJsonMap.put(id,processDefinitionJson);
            }

        } catch (Exception e) {
            logger.error(e.getMessage(),e);
            throw new RuntimeException("sql: " + sql, e);
        } finally {
            ConnectionUtils.releaseResource(rs, pstmt, conn);
        }

        return processDefinitionJsonMap;
    }

}